diff --git a/gendocwafo.py b/gendocwafo.py
deleted file mode 100755
index a93850d..0000000
--- a/gendocwafo.py
+++ /dev/null
@@ -1,4 +0,0 @@
-
-import os
-
-os.system('epydoc --html -o html --name wafo --graph all src/wafo')
\ No newline at end of file
diff --git a/manifest b/manifest
deleted file mode 100755
index c64f3a8..0000000
--- a/manifest
+++ /dev/null
@@ -1,22 +0,0 @@
-setup.py
-src\wafo\__init__.py
-src\wafo\dctpack.py
-src\wafo\definitions.py
-src\wafo\demo_sg.py
-src\wafo\info.py
-src\wafo\interpolate.py
-src\wafo\kdetools.py
-src\wafo\misc.py
-src\wafo\namedtuple.py
-src\wafo\objects.py
-src\wafo\plotbackend.py
-src\wafo\polynomial.py
-src\wafo\polynomial_old.py
-src\wafo\sg_filter.py
-src\wafo\data\__init__.py
-src\wafo\data\info.py
-src\wafo\spectrum\__init__.py
-src\wafo\spectrum\dispersion_relation.py
-src\wafo\spectrum\models.py
-src\wafo\transform\__init__.py
-src\wafo\transform\models.py
diff --git a/setup.py b/setup.py
deleted file mode 100755
index 465474e..0000000
--- a/setup.py
+++ /dev/null
@@ -1,56 +0,0 @@
-"""
-Install wafo
-
-Usage:
-
-python setup.py install [, --prefix=$PREFIX]
-
-python setup.py develop
-python setup.py bdist_wininst
-"""
-#!/usr/bin/env python
-import os, sys
-
-# make sure we import from WAFO in this package, not an installed one:
-sys.path.insert(0, os.path.join('src'))
-import wafo
-
-if __file__ == 'setupegg.py':
- # http://peak.telecommunity.com/DevCenter/setuptools
- from setuptools import setup, Extension
-else:
- from distutils.core import setup
-
-package_name = "wafo"
-subpackages = ('spectrum','data','transform','covariance')
-subpackagesfull = [os.path.join(package_name,f) for f in subpackages]
-subtests = [os.path.join(subpkg,'test') for subpkg in subpackages]
-
-testscripts = [os.path.join(subtst, f) for subtst in subtests
- for f in os.listdir(os.path.join('src',package_name,subtst))
- if not (f.startswith('.') or f.endswith('~') or
- f.endswith('.old') or f.endswith('.bak'))]
-datadir = 'data'
-datafiles = [os.path.join(datadir, f) for f in os.listdir(os.path.join('src',package_name,datadir))
- if not (f.endswith('.py') or f.endswith('test') )]
-#docs = [os.path.join('doc', f) for f in os.listdir('doc')]
-packagedata = testscripts + datafiles + ['c_library.pyd'] #,'disufq1.c','diffsumfunq.pyd','diffsumfunq.pyf','findrfc.c','rfc.pyd','rfc.pyf']
-
-
-setup(
- version = '0.11',
- author='WAFO-group',
- author_email='wafo@maths.lth.se',
- description = wafo.__doc__,
- license = "GPL",
- url='http://www.maths.lth.se/matstat/wafo/',
- name = package_name.upper(),
- package_dir = {'': 'src'},
- packages = [package_name,] + list(subpackagesfull),
- package_data = {package_name: packagedata},
- #package_data = {'': ['wafo.cfg']},
- #scripts = [os.path.join('bin', f)
- # for f in os.listdir('bin')
- # if not (f.startswith('.') or f.endswith('~') or
- # f.endswith('.old') or f.endswith('.bak'))],
- )
diff --git a/src/Wafo.egg-info/PKG-INFO b/src/Wafo.egg-info/PKG-INFO
new file mode 100644
index 0000000..b1d5172
--- /dev/null
+++ b/src/Wafo.egg-info/PKG-INFO
@@ -0,0 +1,92 @@
+Metadata-Version: 1.0
+Name: WAFO
+Version: 0.11
+Summary:
+WAFO
+=====
+ WAFO is a toolbox Python routines for statistical analysis and simulation of random waves and random loads.
+ WAFO is freely redistributable software, see WAFO licence, cf. the GNU General Public License (GPL) and
+ contain tools for:
+
+Fatigue Analysis
+----------------
+-Fatigue life prediction for random loads
+-Theoretical density of rainflow cycles
+
+Sea modelling
+-------------
+-Simulation of linear and non-linear Gaussian waves
+-Estimation of seamodels (spectrums)
+-Joint wave height, wave steepness, wave period distributions
+
+Statistics
+------------
+-Extreme value analysis
+-Kernel density estimation
+-Hidden markov models
+
+ WAFO consists of several modules with short descriptions below.
+ The modules SPECTRUM, COVARIANCE, TRANSFORM, WAVEMODELS, and MULTIDIM are
+ mainly for oceanographic applications.
+ The modules CYCLES, MARKOV, and DAMAGE are mainly for fatigue problems.
+ The contents file for each module is shown by typing 'help module-name'
+ Type 'help fatigue' for a presentation of all routines related to fatigue.
+
+ The paths to the modules are initiated by the function 'initwafo'.
+
+ ONEDIM - Data analysis of time series. Example: extraction of
+ turning points, estimation of spectrum and covariance function.
+ Estimation transformation used in transformed Gaussian model.
+ COVARIANCE - Computation of spectral functions, linear
+ and non-linear time series simulation.
+ SPECTRUM - Computation of spectral moments and covariance functions, linear
+ and non-linear time series simulation.
+ Ex: common spectra implemented, directional spectra,
+ bandwidth measures, exact distributions for wave characteristics.
+ TRANSFORM - Modelling with linear or transformed Gaussian waves. Ex:
+
+ WAVEMODELS - Models for distributions of wave characteristics found in
+ the literature. Ex: parametric models for breaking
+ limited wave heights.
+ MULTIDIM - Multi-dimensional time series analysis. (Under construction)
+ CYCLES - Cycle counting, discretization, and crossings, calculation of
+ damage. Simulation of discrete Markov chains, switching Markov
+ chains, harmonic oscillator. Ex: Rainflow cycles and matrix,
+ discretization of loads. Damage of a rainflow count or
+ matrix, damage matrix, S-N plot.
+ MARKOV - Routines for Markov loads, switching Markov loads, and
+ their connection to rainflow cycles.
+ DAMAGE - Calculation of damage. Ex: Damage of a rainflow count or
+ matrix, damage matrix, S-N plot.
+ SIMTOOLS - Simulation of random processes. Ex: spectral simulation,
+ simulation of discrete Markov chains, switching Markov
+ chains, harmonic oscillator
+ STATISTICS - Statistical tools and extreme-value distributions.
+ Ex: generation of random numbers, estimation of parameters,
+ evaluation of pdf and cdf
+ KDETOOLS - Kernel-density estimation.
+ MISC - Miscellaneous routines. Ex: numerical integration, smoothing
+ spline, binomial coefficient, water density.
+ WDEMOS - WAFO demos.
+ DOCS - Documentation of toolbox, definitions. An overview is given
+ in the routine wafomenu.
+ DATA - Measurements from marine applications.
+ PAPERS - Commands that generate figures in selected scientific
+ publications.
+ SOURCE - Fortran and C files. Information on compilation.
+ EXEC - Executable files (cf. SOURCE), pre-compiled for Solaris,
+ Alpha-Dec or Windows.
+
+ WAFO homepage:
+ On the WAFO home page you will find:
+ - The WAFO Tutorial
+ - New versions of WAFO to download.
+ - Reported bugs.
+ - List of publications related to WAFO.
+
+Home-page: http://www.maths.lth.se/matstat/wafo/
+Author: WAFO-group
+Author-email: wafo@maths.lth.se
+License: GPL
+Description: UNKNOWN
+Platform: UNKNOWN
diff --git a/src/Wafo.egg-info/SOURCES.txt b/src/Wafo.egg-info/SOURCES.txt
new file mode 100644
index 0000000..741d609
--- /dev/null
+++ b/src/Wafo.egg-info/SOURCES.txt
@@ -0,0 +1,39 @@
+setup.py
+setup_old.py
+src/WAFO.egg-info/SOURCES.txt
+src/Wafo.egg-info/PKG-INFO
+src/Wafo.egg-info/SOURCES.txt
+src/Wafo.egg-info/dependency_links.txt
+src/Wafo.egg-info/top_level.txt
+src/wafo/__init__.py
+src/wafo/data_structures.py
+src/wafo/dctpack.py
+src/wafo/definitions.py
+src/wafo/demo_sg.py
+src/wafo/gaussian.py
+src/wafo/info.py
+src/wafo/integrate.py
+src/wafo/interpolate.py
+src/wafo/kdetools.py
+src/wafo/meshgrid.py
+src/wafo/misc.py
+src/wafo/namedtuple.py
+src/wafo/objects.py
+src/wafo/plotbackend.py
+src/wafo/polynomial.py
+src/wafo/polynomial_old.py
+src/wafo/sg_filter.py
+src/wafo/wafodata.py
+src/wafo.egg-info/SOURCES.txt
+src/wafo/covariance/__init__.py
+src/wafo/covariance/core.py
+src/wafo/data/__init__.py
+src/wafo/data/info.py
+src/wafo/spectrum/__init__.py
+src/wafo/spectrum/core.py
+src/wafo/spectrum/dispersion_relation.py
+src/wafo/spectrum/models.py
+src/wafo/test/__init__.py
+src/wafo/transform/__init__.py
+src/wafo/transform/core.py
+src/wafo/transform/models.py
\ No newline at end of file
diff --git a/src/Wafo.egg-info/dependency_links.txt b/src/Wafo.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/Wafo.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/src/Wafo.egg-info/top_level.txt b/src/Wafo.egg-info/top_level.txt
new file mode 100644
index 0000000..151ea7e
--- /dev/null
+++ b/src/Wafo.egg-info/top_level.txt
@@ -0,0 +1,5 @@
+wafo\spectrum
+wafo\covariance
+wafo
+wafo\data
+wafo\transform
diff --git a/src/epydoc_wafo.prj b/src/epydoc_wafo.prj
new file mode 100644
index 0000000..df8c73a
--- /dev/null
+++ b/src/epydoc_wafo.prj
@@ -0,0 +1,64 @@
+(dp0
+S'show_imports'
+p1
+I0
+sS'private_css'
+p2
+S'default'
+p3
+sS'prj_name'
+p4
+S'WAFO'
+p5
+sS'docformat'
+p6
+S'restructuredtext'
+p7
+sS'inheritance'
+p8
+S'grouped'
+p9
+sS'help'
+p10
+NsS'modules'
+p11
+(S'C:/pab/workspace/PYWAFO/src/wafo/objects.py'
+p12
+S'C:/pab/workspace/PYWAFO/src/wafo/__init__.py'
+p13
+S'C:/pab/workspace/PYWAFO/src/wafo/info.py'
+p14
+S'C:/pab/workspace/PYWAFO/src/wafo/plotbackend.py'
+p15
+S'C:/pab/workspace/PYWAFO/src/wafo/spectrum/__init__.py'
+p16
+S'C:/pab/workspace/PYWAFO/src/wafo/spectrum/dispersion_relation.py'
+p17
+S'C:/pab/workspace/PYWAFO/src/wafo/spectrum/models.py'
+p18
+S'C:/pab/workspace/PYWAFO/src/wafo/data/info.py'
+p19
+S'C:/pab/workspace/PYWAFO/src/wafo/transform/__init__.py'
+p20
+S'C:/pab/workspace/PYWAFO/src/wafo/transform/models.py'
+p21
+tp22
+sS'private'
+p23
+I1
+sS'prj_url'
+p24
+S'http://www.maths.lth.se/matstat/wafo/'
+p25
+sS'frames'
+p26
+I1
+sS'css'
+p27
+S'default'
+p28
+sS'outdir'
+p29
+S'html'
+p30
+s.
\ No newline at end of file
diff --git a/wafo/__init__.py b/src/wafo/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/__init__.py
rename to src/wafo/__init__.py
diff --git a/wafo/c_library.pyd b/src/wafo/c_library.pyd
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/c_library.pyd
rename to src/wafo/c_library.pyd
diff --git a/wafo/covariance/__init__.py b/src/wafo/covariance/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/covariance/__init__.py
rename to src/wafo/covariance/__init__.py
diff --git a/wafo/covariance/core.py b/src/wafo/covariance/core.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/covariance/core.py
rename to src/wafo/covariance/core.py
diff --git a/wafo/data/__init__.py b/src/wafo/data/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/__init__.py
rename to src/wafo/data/__init__.py
diff --git a/wafo/data/atlantic.dat b/src/wafo/data/atlantic.dat
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/atlantic.dat
rename to src/wafo/data/atlantic.dat
diff --git a/wafo/data/gfaks89.dat b/src/wafo/data/gfaks89.dat
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/gfaks89.dat
rename to src/wafo/data/gfaks89.dat
diff --git a/wafo/data/gfaksr89.dat b/src/wafo/data/gfaksr89.dat
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/gfaksr89.dat
rename to src/wafo/data/gfaksr89.dat
diff --git a/wafo/data/info.py b/src/wafo/data/info.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/info.py
rename to src/wafo/data/info.py
diff --git a/src/wafo/data/info.~py b/src/wafo/data/info.~py
new file mode 100644
index 0000000..6a0aec3
--- /dev/null
+++ b/src/wafo/data/info.~py
@@ -0,0 +1,456 @@
+"""
+Data package in WAFO Toolbox.
+
+Contents
+--------
+atlantic - Significant wave-height data recorded in the Atlantic Ocean
+gfaks89 - Surface elevation measured at Gullfaks C 24.12.1989
+gfaksr89 - Reconstructed surface elevation measured at Gullfaks C 24.12.1989.
+japansea - coastline map of The Japan Sea
+northsea - coastline map of The Nortsea
+sea - Surface elevation dataset used in WAT version 1.1.
+sfa89 - Wind measurements at Statfjord A 24.12.1989
+sn - Fatigue experiment, constant-amplitude loading.
+yura87 - Surface elevation measured off the coast of Yura
+
+
+
+This module gives gives detailed information and easy access to all datasets
+included in WAFO
+
+"""
+#from pylab import load
+#from scipy.io import read_array
+from numpy import (loadtxt,nan)
+import os
+__path2data = os.path.dirname( os.path.realpath(__file__))
+
+__all__ =['atlantic','gfaks89','gfaksr89','japansea','northsea','sea','sfa89',
+ 'sn','yura87']
+
+def _load(file):
+ """ local load function
+ """
+ return loadtxt(os.path.join(__path2data,file))
+
+def _tofloat(x):
+ if x=='nan' or x=='NaN':
+ y = nan
+ else:
+ y = float(x or 0)
+ return y
+def _loadnan(file):
+ """ local load function accepting nan's
+ """
+ myconverter = {0: _tofloat, 1: _tofloat}
+ return loadtxt(os.path.join(__path2data,file),converters=myconverter)
+
+def atlantic():
+ """
+ Return Significant wave-height data recorded in the Atlantic Ocean
+
+ Data summary
+ ------------
+ Size : 582 X 1
+ Sampling Rate : ~ 14 times a month
+ Device :
+ Source :
+ Format : ascii
+
+ Description
+ ------------
+ atlantic.dat contains average significant wave-height data recorded
+ approximately 14 times a month in December-February during 7 years and
+ at 2 locations in the Atlantic Ocean
+
+ Example
+ --------
+ >>> import pylab
+ >>> import wafo
+ >>> Hs = wafo.data.atlantic()
+ >>> h = pylab.plot(Hs)
+
+ Acknowledgement:
+ ---------------
+ This dataset were made available by Dr. David Carter
+ and Dr. David Cotton, Satellite Observing Systems, UK.
+ """
+ return _load('atlantic.dat')
+def gfaks89():
+ """
+ Return Surface elevation measured at Gullfaks C 24.12.1989
+
+ Data summary
+ ------------
+ Size : 39000 X 2
+ Sampling Rate : 2.5 Hz
+ Device : EMI laser
+ Source : STATOIL
+ Format : ascii, c1: time c2: surface elevation
+
+ Description
+ ------------
+ The wave data was measured 24th December 1989 at the Gullfaks C platform
+ in the North Sea from 17.00 to 21.20. The period from 20.00 to 20.20
+ is missing and contains NaNs. The water depth of 218 m is
+ regarded as deep water for the most important wave components.
+ There are two EMI laser sensors named 219 and 220. This data set is
+ obtained from sensor 219, which is located in the Northwest
+ corner approximately two platform leg diameters away from
+ the closest leg.
+ Thus the wave elevation is not expected to be significantly
+ affected by diffraction effects for incoming waves in the western sector.
+ The wind direction for this period is from the south.
+ Some difficulties in calibration of the instruments have been reported
+ resulting in several consecutive measured values being equal or almost equal
+ in the observed data set.
+
+ This dataset is for non-commercial use only.
+
+ Hm0 = 6.8m, Tm02 = 8s, Tp = 10.5
+
+ Example
+ -------
+ >>> import pylab
+ >>> import wafo
+ >>> x = wafo.data.gfaks89()
+ >>> h = pylab.plot(x[:,0],x[:,1])
+
+ Acknowledgement:
+ ---------------
+ This dataset were prepared and made available by Dr. S. Haver,
+ STATOIL, Norway
+
+ See also
+ --------
+ gfaksr89, northsea
+
+ """
+ return _loadnan('gfaks89.dat')
+def gfaksr89():
+ """
+ Return a reconstruction of surface elevation measured at Gullfaks C 24.12.1989.
+
+
+ Data summary
+ ------------
+ Size : 39000 X 2
+ Sampling Rate : 2.5 Hz
+ Device : EMI laser
+ Source : STATOIL
+ Format : ascii, c1: time c2: surface elevation
+
+ Description
+ -----------
+ This is a reconstructed version of the data in the GFAKS89.DAT file.
+ The following calls were made to reconstruct the data:
+
+ inds = findoutliers(gfaks89,.02,2,1.23);
+ gfaksr89 = reconstruct(gfaks89,inds,6);
+
+ The wave data was measured 24th December 1989 at the Gullfaks C platform
+ in the North Sea from 17.00 to 21.20. The period from 20.00 to 20.20
+ is missing in the original data. The water depth of 218 m is
+ regarded as deep water for the most important wave components.
+ There are two EMI laser sensors named 219 and 220. This data set is
+ obtained from sensor 219, which is located in the Northwest
+ corner approximately two platform leg diameters away from
+ the closest leg.
+ Thus the wave elevation is not expected to be significantly
+ affected by diffraction effects for incoming waves in the western sector.
+ The wind direction for this period is from the south.
+ Some difficulties in calibration of the instruments have been reported
+ resulting in several consecutive measured values being equal or almost equal
+ in the observed data set.
+
+ Hm0 = 6.8m, Tm02 = 8s, Tp = 10.5
+
+
+ Example
+ -------
+ >>> import pylab
+ >>> import wafo
+ >>> x = wafo.data.gfaksr89()
+ >>> h = pylab.plot(x[:,0],x[:,1])
+
+
+ See also
+ --------
+ gfaks89
+ """
+ return _loadnan('gfaksr89.dat')
+def japansea():
+ """
+ Return coastline map of The Japan Sea
+
+
+ Data summary
+ ------------
+ Size : 692 X 2
+ Sampling Rate :
+ Device :
+ Source : http://crusty.er.usgs.gov/coast/getcoast.html
+ Format : ascii, c1: longitude c2: latitude
+
+ Description
+ -----------
+ JAPANSEA.DAT contains data for plotting a map of The Japan Sea.
+ The data is obtained from USGS coastline extractor.
+
+ Example:
+ -------
+ #the map is seen by
+
+ >>> import pylab
+ >>> import wafo
+ >>> map1 = wafo.data.japansea()
+ >>> h = pylab.plot(map1[:,0],map1[:,1])
+ >>> lon_loc = [131,132,132,135,139.5,139]
+ >>> lat_loc = [46, 43, 40, 35, 38.3, 35.7]
+ >>> loc = ['China','Vladivostok','Japan Sea', 'Japan', 'Yura','Tokyo']
+ >>> algn = 'right'
+ >>> for lon, lat, name in zip(lon_loc,lat_loc,loc):
+ pylab.text(lon,lat,name,horizontalalignment=algn)
+
+
+ # If you have the m_map toolbox (see http://www.ocgy.ubc.ca/~rich/):
+ m_proj('lambert','long',[130 148],'lat',[30 48]);
+ m_line(map(:,1),map(:,2));
+ m_grid('box','fancy','tickdir','out');
+ m_text(131,46,'China');
+ m_text(132,43,'Vladivostok');
+ m_text(132,40,'Japan Sea');
+ m_text(135,35,'Japan');
+ m_text(139.5,38.3,'Yura');
+ m_text(139,35.7,'Tokyo');
+ """
+ return _loadnan('japansea.dat')
+def northsea():
+ """
+ NORTHSEA coastline map of The Nortsea
+
+ Data summary
+ -------------
+ Size : 60646 X 2
+ Sampling Rate :
+ Device :
+ Source : http://crusty.er.usgs.gov/coast/getcoast.html
+ Format : ascii, c1: longitude c2: latitude
+
+ Description
+ -----------
+ NORTHSEA.DAT contains data for plotting a map of The Northsea.
+ The data is obtained from USGS coastline extractor.
+
+ Example
+ -------
+ # the map is seen by
+
+ >>> import pylab
+ >>> import wafo
+ >>> map1 = wafo.data.northsea()
+ >>> h = pylab.plot(map1[:,0],map1[:,1])
+ >>> lon_pltfrm = [1.8, 2.3, 2., 1.9, 2.6]
+ >>> lat_pltfrm = [61.2, 61.2, 59.9, 58.4, 57.7]
+ >>> pltfrm = ['Statfjord A', 'Gullfaks C', 'Frigg', 'Sleipner', 'Draupner']
+ >>> h = pylab.scatter(lon_pltfrm,lat_pltfrm);
+ >>> algn = 'right'
+ >>> for lon, lat, name in zip(lon_pltfrm,lat_pltfrm,pltfrm):
+ pylab.text(lon,lat,name,horizontalalignment=algn); algn = 'left'
+
+
+ >>> lon_city = [10.8, 10.8, 5.52, 5.2]
+ >>> lat_city = [59.85, 63.4, 58.9, 60.3]
+ >>> city = ['Oslo','Trondheim','Stavanger', 'Bergen']
+ >>> h = pylab.scatter(lon_city,lat_city);
+ >>> algn = 'right'
+ >>> for lon, lat, name in zip(lon_city,lat_city,city):
+ pylab.text(lon,lat,name,horizontalalignment=algn)
+
+ >>> from mpl_toolkits.basemap import Basemap
+ >>> import matplotlib.pyplot as plt
+
+ # setup Lambert Conformal basemap.
+ >>> m = Basemap(width=1200000,height=900000,projection='lcc',
+ resolution='f',lat_1=56.,lat_2=64,lat_0=58,lon_0=5.)
+ # draw coastlines.
+ >>> m.drawcoastlines()
+ >>> h = m.scatter(lon_pltfrm,lat_pltfrm);
+ >>> algn = 'right'
+ >>> for lon, lat, name in zip(lon_pltfrm,lat_pltfrm,pltfrm):
+ m.text(lon,lat,name,horizontalalignment=algn); algn = 'left'
+ >>> m.scatter(lon_city,lat_city)
+ >>> m.scatter()
+
+ # If you have the m_map toolbox (see http://www.ocgy.ubc.ca/~rich/):
+ m_proj('lambert','long',[-2 12],'lat',[56 64]);
+ m_line(map(:,1),map(:,2));
+ m_grid('box','fancy','tickdir','out');
+ m_text( 1,62 ,'Statfjord A') ;
+ m_line([1.8, 1.8], [62 ,61.2 ]);
+ m_text(1.7,61.2,'x') ;
+ m_text(1,59.5,'Gullfaks C') ;
+ m_line([1.8, 2.3 ], [59.50 ,61.20 ]);
+ m_text(2.20,61.20,'x') ;
+ m_text(10.10,60.05,'Oslo');
+ m_text(8.5,63.5,'Trondheim');
+ m_text(4.00,58.80,'Stavanger');
+ m_text(3.50,60.30,'Bergen') ;
+ m_text(8,61,'Norway');
+ """
+ return _loadnan('northsea.dat')
+def sea():
+ """
+ Return Surface elevation dataset used in WAT version 1.1.
+
+ Data summary
+ ------------
+ Size : 9524 X 2
+ Sampling Rate : 4.0 Hz
+ Device : unknown
+ Source : unknown
+ Format : ascii, c1: time c2: surface elevation
+
+ Description
+ -----------
+ The wave data was used in one of WAFO predecessors, i.e. the Wave
+ Analysis Toolbox version 1.1 (WAT)
+ Hm0 = 1.9m, Tm02 = 4.0s, Tp2 = 11.5s Tp1=5.6s
+
+ Example
+ -------
+ >>> import pylab
+ >>> import wafo
+ >>> x = wafo.data.sea()
+ >>> h = pylab.plot(x[:,0],x[:,1])
+ """
+ return _load('sea.dat')
+def sfa89():
+ """
+ Return Wind measurements at Statfjord A 24.12.1989
+
+ Data summary
+ ------------
+ Size : 144 X 3
+ Sampling Rate : 1/600 Hz
+ Device :
+ Source : DNMI (The Norwegian Meteorological Institute)
+ Format : ascii, c1: time (hours)
+ c2: velocity (m/s)
+ c3: direction (degrees)
+ Description
+ -----------
+ The registration of wind speeds at the Gullfaks field
+ started up on Statfjord A in 1978 and continued until 1990.
+ The dataregistration was transferred to Gullfaks C in Nov 1989.
+ Due to some difficulties of the windregistration on Gullfaks C in
+ the beginning, they continued to use the registered data from
+ Statfjord A.
+ The windspeed is measured in (meter/second), 110 m above mean water
+ level (MWL) and the wind direction is given in degrees for the data.
+ The data are a mean value of every 10 minutes.
+ Wind directions are defined in the meteorological convention, i.e.,
+ 0 degrees = wind approaching from North, 90 degrees = wind from East, etc.
+ This dataset is for non-commercial use only.
+
+ Example
+ -------
+ >>> import pylab
+ >>> import wafo
+ >>> x = wafo.data.sfa89()
+ >>> h = pylab.plot(x[:,0],x[:,1])
+
+ Acknowledgement
+ ----------------
+ These data are made available by Knut A. Iden, DNMI.
+
+ See also
+ --------
+ northsea
+ """
+ return _load('sfa89.dat')
+def sn():
+ """
+ Return SN Fatigue experiment, constant-amplitude loading.
+
+
+ Data summary
+ ------------
+ Size : 40 X 2
+ Source : unknown
+ Format : ascii, c1: Amplitude MPa c2: Number of cycles
+
+ Description
+ -----------
+ A fatigue experiment with constant amplitudes at five levels:
+ 10,15,20,25 and 30 MPa. For each level is related 8 observations of
+ the number of cycles to failure.
+
+ The origin of the data is unknown.
+
+ Example
+ -------
+ >>> import pylab
+ >>> import wafo
+ >>> x = wafo.data.sn()
+ >>> h = pylab.plot(x[:,0],x[:,1])
+
+ See also
+ --------
+ The same data appear in the directory wdemos/itmkurs/
+ as SN.mat.
+
+ """
+ return _load('sn.dat')
+def yura87():
+ """
+ Return Surface elevation measured off the coast of Yura.
+
+
+ Data summary
+ -----------
+ Size : 85547 X 4
+ Sampling Rate : 1 Hz
+ Device : ultrasonic wave gauges
+ Source : SRI, Ministry of Transport, Japan
+ Format : ascii, c1: time (sec) c2-4: surface elevation (m)
+
+ Description
+ -----------
+ The wave data was measured at the Poseidon platform
+ in the Japan Sea from 24th November 1987 08.12 hours to 25th November
+ 1987 07.57 hours. Poseidon was located 3 km off the coast of Yura
+ in the Yamagata prefecture, in the Japan Sea during the measurements.
+ The most important wave components are to some extent influenced by the
+ water depth of 42 m. The data are measured with three ultrasonic wave
+ gauges located at the sea floor and the relative coordinates of the
+ gauges are as follows (x-axis points to the East, y-axis points to
+ the North):
+ X (m) Y (m)
+ c2: -4.93, 25.02
+ c3: 5.80, 92.12
+ c4: 0.00, 0.00
+
+ This dataset is for non-commercial use only.
+
+ Hm0 = 5.1m, Tm02 = 7.7s, Tp = 12.8s
+ Example
+ -------
+ >>> import pylab
+ >>> import wafo
+ >>> x = wafo.data.yura87()
+ >>> h = pylab.plot(x[:,0],x[:,1])
+
+ Acknowledgement:
+ -----------------
+ This dataset were prepared and made available by Dr. Sc. H. Tomita,
+ Ship Research Institute, Ministry of Transport, Japan.
+
+ See also
+ --------
+ japansea
+ """
+ return _load('yura87.dat')
+if __name__=='__main__':
+ import doctest
+ doctest.testmod()
\ No newline at end of file
diff --git a/wafo/data/japansea.dat b/src/wafo/data/japansea.dat
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/japansea.dat
rename to src/wafo/data/japansea.dat
diff --git a/wafo/data/northsea.dat b/src/wafo/data/northsea.dat
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/northsea.dat
rename to src/wafo/data/northsea.dat
diff --git a/wafo/data/sea.dat b/src/wafo/data/sea.dat
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/sea.dat
rename to src/wafo/data/sea.dat
diff --git a/wafo/data/sea.m b/src/wafo/data/sea.m
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/sea.m
rename to src/wafo/data/sea.m
diff --git a/wafo/data/sfa89.dat b/src/wafo/data/sfa89.dat
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/sfa89.dat
rename to src/wafo/data/sfa89.dat
diff --git a/wafo/data/sn.dat b/src/wafo/data/sn.dat
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/sn.dat
rename to src/wafo/data/sn.dat
diff --git a/wafo/data/wafoLogoNewWithBorder.png b/src/wafo/data/wafoLogoNewWithBorder.png
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/wafoLogoNewWithBorder.png
rename to src/wafo/data/wafoLogoNewWithBorder.png
diff --git a/wafo/data/wafoLogoNewWithBorder.svg b/src/wafo/data/wafoLogoNewWithBorder.svg
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/wafoLogoNewWithBorder.svg
rename to src/wafo/data/wafoLogoNewWithBorder.svg
diff --git a/wafo/data/wafoLogoNewWithoutBorder.png b/src/wafo/data/wafoLogoNewWithoutBorder.png
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/wafoLogoNewWithoutBorder.png
rename to src/wafo/data/wafoLogoNewWithoutBorder.png
diff --git a/wafo/data/wafoLogoNewWithoutBorder.svg b/src/wafo/data/wafoLogoNewWithoutBorder.svg
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/wafoLogoNewWithoutBorder.svg
rename to src/wafo/data/wafoLogoNewWithoutBorder.svg
diff --git a/wafo/data/wafologoWithBorder.png b/src/wafo/data/wafologoWithBorder.png
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/wafologoWithBorder.png
rename to src/wafo/data/wafologoWithBorder.png
diff --git a/wafo/data/yura87.dat b/src/wafo/data/yura87.dat
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data/yura87.dat
rename to src/wafo/data/yura87.dat
diff --git a/wafo/data_structures.py b/src/wafo/data_structures.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/data_structures.py
rename to src/wafo/data_structures.py
diff --git a/wafo/dctpack.py b/src/wafo/dctpack.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/dctpack.py
rename to src/wafo/dctpack.py
diff --git a/wafo/definitions.py b/src/wafo/definitions.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/definitions.py
rename to src/wafo/definitions.py
diff --git a/wafo/definitions.~py b/src/wafo/definitions.~py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/definitions.~py
rename to src/wafo/definitions.~py
diff --git a/wafo/demo_sg.py b/src/wafo/demo_sg.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/demo_sg.py
rename to src/wafo/demo_sg.py
diff --git a/wafo/diffsumfunq.pyd b/src/wafo/diffsumfunq.pyd
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/diffsumfunq.pyd
rename to src/wafo/diffsumfunq.pyd
diff --git a/wafo/diffsumfunq.pyf b/src/wafo/diffsumfunq.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/diffsumfunq.pyf
rename to src/wafo/diffsumfunq.pyf
diff --git a/wafo/disufq.pyf b/src/wafo/disufq.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/disufq.pyf
rename to src/wafo/disufq.pyf
diff --git a/wafo/disufq1.c b/src/wafo/disufq1.c
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/disufq1.c
rename to src/wafo/disufq1.c
diff --git a/wafo/findrfc.c b/src/wafo/findrfc.c
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/findrfc.c
rename to src/wafo/findrfc.c
diff --git a/wafo/gaussian.py b/src/wafo/gaussian.py
old mode 100755
new mode 100644
similarity index 97%
rename from wafo/gaussian.py
rename to src/wafo/gaussian.py
index 1f616a5..44d6cab
--- a/wafo/gaussian.py
+++ b/src/wafo/gaussian.py
@@ -2,7 +2,7 @@ import numpy as np
from numpy import (r_, minimum, maximum, atleast_1d, atleast_2d, mod, zeros, #@UnresolvedImport
ones, floor, random, eye, nonzero, repeat, sqrt, inf, diag, triu) #@UnresolvedImport
from scipy.special import ndtri as invnorm
-import rindmod
+import wafo.rindmod as rindmod
class Rind(object):
diff --git a/wafo/info.py b/src/wafo/info.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/info.py
rename to src/wafo/info.py
diff --git a/wafo/integrate.py b/src/wafo/integrate.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/integrate.py
rename to src/wafo/integrate.py
diff --git a/wafo/interpolate.py b/src/wafo/interpolate.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/interpolate.py
rename to src/wafo/interpolate.py
diff --git a/wafo/kdetools.py b/src/wafo/kdetools.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/kdetools.py
rename to src/wafo/kdetools.py
diff --git a/wafo/meshgrid.py b/src/wafo/meshgrid.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/meshgrid.py
rename to src/wafo/meshgrid.py
diff --git a/wafo/misc.py b/src/wafo/misc.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/misc.py
rename to src/wafo/misc.py
diff --git a/src/wafo/mvn.pyd b/src/wafo/mvn.pyd
new file mode 100644
index 0000000..b12d5b4
Binary files /dev/null and b/src/wafo/mvn.pyd differ
diff --git a/wafo/mvn.pyf b/src/wafo/mvn.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/mvn.pyf
rename to src/wafo/mvn.pyf
diff --git a/wafo/mvn1.pyf b/src/wafo/mvn1.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/mvn1.pyf
rename to src/wafo/mvn1.pyf
diff --git a/wafo/mvndst.f b/src/wafo/mvndst.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/mvndst.f
rename to src/wafo/mvndst.f
diff --git a/src/wafo/mvnprdmod.pyd b/src/wafo/mvnprdmod.pyd
new file mode 100644
index 0000000..3a0c1d6
Binary files /dev/null and b/src/wafo/mvnprdmod.pyd differ
diff --git a/wafo/namedtuple.py b/src/wafo/namedtuple.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/namedtuple.py
rename to src/wafo/namedtuple.py
diff --git a/wafo/objects.py b/src/wafo/objects.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/objects.py
rename to src/wafo/objects.py
diff --git a/wafo/plotbackend.py b/src/wafo/plotbackend.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/plotbackend.py
rename to src/wafo/plotbackend.py
diff --git a/wafo/polynomial.py b/src/wafo/polynomial.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/polynomial.py
rename to src/wafo/polynomial.py
diff --git a/wafo/polynomial_old.py b/src/wafo/polynomial_old.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/polynomial_old.py
rename to src/wafo/polynomial_old.py
diff --git a/wafo/rfcmodule.pyf b/src/wafo/rfcmodule.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/rfcmodule.pyf
rename to src/wafo/rfcmodule.pyf
diff --git a/src/wafo/rindmod.pyd b/src/wafo/rindmod.pyd
new file mode 100644
index 0000000..d32eded
Binary files /dev/null and b/src/wafo/rindmod.pyd differ
diff --git a/wafo/sg_filter.py b/src/wafo/sg_filter.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/sg_filter.py
rename to src/wafo/sg_filter.py
diff --git a/src/wafo/source/Debug/DF60.PDB b/src/wafo/source/Debug/DF60.PDB
new file mode 100644
index 0000000..7abddab
Binary files /dev/null and b/src/wafo/source/Debug/DF60.PDB differ
diff --git a/src/wafo/source/Debug/mvnprd.obj b/src/wafo/source/Debug/mvnprd.obj
new file mode 100644
index 0000000..1155385
Binary files /dev/null and b/src/wafo/source/Debug/mvnprd.obj differ
diff --git a/wafo/source/c_codes/build_all.py b/src/wafo/source/c_codes/build_all.py
old mode 100755
new mode 100644
similarity index 92%
rename from wafo/source/c_codes/build_all.py
rename to src/wafo/source/c_codes/build_all.py
index 03c43b2..2877a00
--- a/wafo/source/c_codes/build_all.py
+++ b/src/wafo/source/c_codes/build_all.py
@@ -8,7 +8,7 @@ def compile_all():
#compile_format = 'f2py %s %s -c --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71'
# Install microsoft visual c++ .NET 2003 and run the following to build the module:
- compile_format = 'f2py %s %s -c'
+ compile_format = 'f2py.py %s %s -c'
pyfs = ('c_library.pyf',)
files =('c_functions.c',)
diff --git a/wafo/source/c_codes/c_functions.c b/src/wafo/source/c_codes/c_functions.c
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/c_functions.c
rename to src/wafo/source/c_codes/c_functions.c
diff --git a/wafo/source/c_codes/c_library.pyd b/src/wafo/source/c_codes/c_library.pyd
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/c_library.pyd
rename to src/wafo/source/c_codes/c_library.pyd
diff --git a/wafo/source/c_codes/c_library.pyf b/src/wafo/source/c_codes/c_library.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/c_library.pyf
rename to src/wafo/source/c_codes/c_library.pyf
diff --git a/wafo/source/c_codes/old/build_all.py b/src/wafo/source/c_codes/old/build_all.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/old/build_all.py
rename to src/wafo/source/c_codes/old/build_all.py
diff --git a/wafo/source/c_codes/old/diffsumfunq.pyd b/src/wafo/source/c_codes/old/diffsumfunq.pyd
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/old/diffsumfunq.pyd
rename to src/wafo/source/c_codes/old/diffsumfunq.pyd
diff --git a/wafo/source/c_codes/old/diffsumfunq.pyf b/src/wafo/source/c_codes/old/diffsumfunq.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/old/diffsumfunq.pyf
rename to src/wafo/source/c_codes/old/diffsumfunq.pyf
diff --git a/wafo/source/c_codes/old/disufq.pyf b/src/wafo/source/c_codes/old/disufq.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/old/disufq.pyf
rename to src/wafo/source/c_codes/old/disufq.pyf
diff --git a/wafo/source/c_codes/old/disufq1.c b/src/wafo/source/c_codes/old/disufq1.c
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/old/disufq1.c
rename to src/wafo/source/c_codes/old/disufq1.c
diff --git a/wafo/source/c_codes/old/findcross.c b/src/wafo/source/c_codes/old/findcross.c
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/old/findcross.c
rename to src/wafo/source/c_codes/old/findcross.c
diff --git a/wafo/source/c_codes/old/findrfc.c b/src/wafo/source/c_codes/old/findrfc.c
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/old/findrfc.c
rename to src/wafo/source/c_codes/old/findrfc.c
diff --git a/wafo/source/c_codes/old/rfc.pyd b/src/wafo/source/c_codes/old/rfc.pyd
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/old/rfc.pyd
rename to src/wafo/source/c_codes/old/rfc.pyd
diff --git a/wafo/source/c_codes/old/rfc.pyf b/src/wafo/source/c_codes/old/rfc.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/c_codes/old/rfc.pyf
rename to src/wafo/source/c_codes/old/rfc.pyf
diff --git a/wafo/source/cov2XXXpdf/bounds/cov2acdfb.f b/src/wafo/source/cov2XXXpdf/bounds/cov2acdfb.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/bounds/cov2acdfb.f
rename to src/wafo/source/cov2XXXpdf/bounds/cov2acdfb.f
diff --git a/wafo/source/cov2XXXpdf/bounds/cov2mmpdfb.f b/src/wafo/source/cov2XXXpdf/bounds/cov2mmpdfb.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/bounds/cov2mmpdfb.f
rename to src/wafo/source/cov2XXXpdf/bounds/cov2mmpdfb.f
diff --git a/wafo/source/cov2XXXpdf/bounds/cov2tccpdfb.f b/src/wafo/source/cov2XXXpdf/bounds/cov2tccpdfb.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/bounds/cov2tccpdfb.f
rename to src/wafo/source/cov2XXXpdf/bounds/cov2tccpdfb.f
diff --git a/wafo/source/cov2XXXpdf/bounds/cov2tthpdfb.f b/src/wafo/source/cov2XXXpdf/bounds/cov2tthpdfb.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/bounds/cov2tthpdfb.f
rename to src/wafo/source/cov2XXXpdf/bounds/cov2tthpdfb.f
diff --git a/wafo/source/cov2XXXpdf/cov2acdf.f b/src/wafo/source/cov2XXXpdf/cov2acdf.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/cov2acdf.f
rename to src/wafo/source/cov2XXXpdf/cov2acdf.f
diff --git a/wafo/source/cov2XXXpdf/cov2mmpdf.f b/src/wafo/source/cov2XXXpdf/cov2mmpdf.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/cov2mmpdf.f
rename to src/wafo/source/cov2XXXpdf/cov2mmpdf.f
diff --git a/wafo/source/cov2XXXpdf/cov2mmtpdf.f b/src/wafo/source/cov2XXXpdf/cov2mmtpdf.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/cov2mmtpdf.f
rename to src/wafo/source/cov2XXXpdf/cov2mmtpdf.f
diff --git a/wafo/source/cov2XXXpdf/cov2tccpdf.f b/src/wafo/source/cov2XXXpdf/cov2tccpdf.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/cov2tccpdf.f
rename to src/wafo/source/cov2XXXpdf/cov2tccpdf.f
diff --git a/wafo/source/cov2XXXpdf/cov2tcpdf.f b/src/wafo/source/cov2XXXpdf/cov2tcpdf.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/cov2tcpdf.f
rename to src/wafo/source/cov2XXXpdf/cov2tcpdf.f
diff --git a/wafo/source/cov2XXXpdf/cov2thpdf.f b/src/wafo/source/cov2XXXpdf/cov2thpdf.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/cov2thpdf.f
rename to src/wafo/source/cov2XXXpdf/cov2thpdf.f
diff --git a/wafo/source/cov2XXXpdf/cov2thpdfalan.f b/src/wafo/source/cov2XXXpdf/cov2thpdfalan.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/cov2thpdfalan.f
rename to src/wafo/source/cov2XXXpdf/cov2thpdfalan.f
diff --git a/wafo/source/cov2XXXpdf/cov2tthpdf.f b/src/wafo/source/cov2XXXpdf/cov2tthpdf.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/cov2XXXpdf/cov2tthpdf.f
rename to src/wafo/source/cov2XXXpdf/cov2tthpdf.f
diff --git a/wafo/source/mreg/build_all.py b/src/wafo/source/mreg/build_all.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/build_all.py
rename to src/wafo/source/mreg/build_all.py
diff --git a/wafo/source/mreg/checkmod.mod b/src/wafo/source/mreg/checkmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/checkmod.mod
rename to src/wafo/source/mreg/checkmod.mod
diff --git a/wafo/source/mreg/cov2mmpdfmod.mod b/src/wafo/source/mreg/cov2mmpdfmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/cov2mmpdfmod.mod
rename to src/wafo/source/mreg/cov2mmpdfmod.mod
diff --git a/wafo/source/mreg/cov2mmpdfreg.f b/src/wafo/source/mreg/cov2mmpdfreg.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/cov2mmpdfreg.f
rename to src/wafo/source/mreg/cov2mmpdfreg.f
diff --git a/wafo/source/mreg/cov2mmpdfreg_intfc.f b/src/wafo/source/mreg/cov2mmpdfreg_intfc.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/cov2mmpdfreg_intfc.f
rename to src/wafo/source/mreg/cov2mmpdfreg_intfc.f
diff --git a/wafo/source/mreg/dsvdc.f b/src/wafo/source/mreg/dsvdc.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/dsvdc.f
rename to src/wafo/source/mreg/dsvdc.f
diff --git a/wafo/source/mreg/epsmod.mod b/src/wafo/source/mreg/epsmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/epsmod.mod
rename to src/wafo/source/mreg/epsmod.mod
diff --git a/wafo/source/mreg/expaccmod.mod b/src/wafo/source/mreg/expaccmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/expaccmod.mod
rename to src/wafo/source/mreg/expaccmod.mod
diff --git a/wafo/source/mreg/infcmod.mod b/src/wafo/source/mreg/infcmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/infcmod.mod
rename to src/wafo/source/mreg/infcmod.mod
diff --git a/wafo/source/mreg/mregmod.mod b/src/wafo/source/mreg/mregmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/mregmod.mod
rename to src/wafo/source/mreg/mregmod.mod
diff --git a/wafo/source/mreg/mregmodule.f b/src/wafo/source/mreg/mregmodule.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/mregmodule.f
rename to src/wafo/source/mreg/mregmodule.f
diff --git a/wafo/source/mreg/quadrmod.mod b/src/wafo/source/mreg/quadrmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/quadrmod.mod
rename to src/wafo/source/mreg/quadrmod.mod
diff --git a/wafo/source/mreg/rintmod.mod b/src/wafo/source/mreg/rintmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/rintmod.mod
rename to src/wafo/source/mreg/rintmod.mod
diff --git a/wafo/source/mreg/sizemod.mod b/src/wafo/source/mreg/sizemod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/sizemod.mod
rename to src/wafo/source/mreg/sizemod.mod
diff --git a/wafo/source/mreg/svd.mod b/src/wafo/source/mreg/svd.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/svd.mod
rename to src/wafo/source/mreg/svd.mod
diff --git a/wafo/source/mreg/tbrmod.mod b/src/wafo/source/mreg/tbrmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mreg/tbrmod.mod
rename to src/wafo/source/mreg/tbrmod.mod
diff --git a/wafo/source/mvnprd/adaptivegausskronrod.mod b/src/wafo/source/mvnprd/adaptivegausskronrod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/adaptivegausskronrod.mod
rename to src/wafo/source/mvnprd/adaptivegausskronrod.mod
diff --git a/wafo/source/mvnprd/build_all.py b/src/wafo/source/mvnprd/build_all.py
old mode 100755
new mode 100644
similarity index 88%
rename from wafo/source/mvnprd/build_all.py
rename to src/wafo/source/mvnprd/build_all.py
index 636037d..5600c25
--- a/wafo/source/mvnprd/build_all.py
+++ b/src/wafo/source/mvnprd/build_all.py
@@ -10,7 +10,7 @@ def compile_all():
os.system(compile1_format % file)
file_objects = '%s.o %s.o' % tuple(files)
- os.system('f2py -m mvnprdmod -c %s mvnprd_interface.f --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71' % file_objects)
+ os.system('f2py.py -m mvnprdmod -c %s mvnprd_interface.f --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71' % file_objects)
#compile1_txt = 'gfortran -fPIC -c mvnprd.f'
#compile2_txt = 'f2py -m mvnprdmod -c mvnprd.o mvnprd_interface.f --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71'
#os.system(compile1_txt)
diff --git a/wafo/source/mvnprd/erfcoremod.mod b/src/wafo/source/mvnprd/erfcoremod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/erfcoremod.mod
rename to src/wafo/source/mvnprd/erfcoremod.mod
diff --git a/wafo/source/mvnprd/functioninterface.mod b/src/wafo/source/mvnprd/functioninterface.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/functioninterface.mod
rename to src/wafo/source/mvnprd/functioninterface.mod
diff --git a/wafo/source/mvnprd/integration1dmodule.mod b/src/wafo/source/mvnprd/integration1dmodule.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/integration1dmodule.mod
rename to src/wafo/source/mvnprd/integration1dmodule.mod
diff --git a/wafo/source/mvnprd/mvnprd.dsp b/src/wafo/source/mvnprd/mvnprd.dsp
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/mvnprd.dsp
rename to src/wafo/source/mvnprd/mvnprd.dsp
diff --git a/wafo/source/mvnprd/mvnprd.dsw b/src/wafo/source/mvnprd/mvnprd.dsw
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/mvnprd.dsw
rename to src/wafo/source/mvnprd/mvnprd.dsw
diff --git a/wafo/source/mvnprd/mvnprd.f b/src/wafo/source/mvnprd/mvnprd.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/mvnprd.f
rename to src/wafo/source/mvnprd/mvnprd.f
diff --git a/wafo/source/mvnprd/mvnprd.pyf b/src/wafo/source/mvnprd/mvnprd.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/mvnprd.pyf
rename to src/wafo/source/mvnprd/mvnprd.pyf
diff --git a/wafo/source/mvnprd/mvnprd_interface.f b/src/wafo/source/mvnprd/mvnprd_interface.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/mvnprd_interface.f
rename to src/wafo/source/mvnprd/mvnprd_interface.f
diff --git a/src/wafo/source/mvnprd/mvnprdmod.pyd b/src/wafo/source/mvnprd/mvnprdmod.pyd
new file mode 100644
index 0000000..3a0c1d6
Binary files /dev/null and b/src/wafo/source/mvnprd/mvnprdmod.pyd differ
diff --git a/wafo/source/mvnprd/mvnprodcorrprb.f b/src/wafo/source/mvnprd/mvnprodcorrprb.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/mvnprodcorrprb.f
rename to src/wafo/source/mvnprd/mvnprodcorrprb.f
diff --git a/wafo/source/mvnprd/mvnprodcorrprb_interface.f b/src/wafo/source/mvnprd/mvnprodcorrprb_interface.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/mvnprodcorrprb_interface.f
rename to src/wafo/source/mvnprd/mvnprodcorrprb_interface.f
diff --git a/wafo/source/mvnprd/mvnprodcorrprbmod.mod b/src/wafo/source/mvnprd/mvnprodcorrprbmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/mvnprodcorrprbmod.mod
rename to src/wafo/source/mvnprd/mvnprodcorrprbmod.mod
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/DF60.PDB b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/DF60.PDB
new file mode 100644
index 0000000..37b3931
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/DF60.PDB differ
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/adaptivegausskronrod.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/adaptivegausskronrod.mod
new file mode 100644
index 0000000..30fb457
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/adaptivegausskronrod.mod differ
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/erfcoremod.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/erfcoremod.mod
new file mode 100644
index 0000000..3e3c364
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/erfcoremod.mod differ
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/functioninterface.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/functioninterface.mod
new file mode 100644
index 0000000..fb09733
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/functioninterface.mod differ
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/integration1dmodule.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/integration1dmodule.mod
new file mode 100644
index 0000000..b6494bb
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/integration1dmodule.mod differ
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/mvnprodcorrprb.obj b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/mvnprodcorrprb.obj
new file mode 100644
index 0000000..270a6ae
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/mvnprodcorrprb.obj differ
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/mvnprodcorrprbmod.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/mvnprodcorrprbmod.mod
new file mode 100644
index 0000000..7d95c20
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/mvnprodcorrprbmod.mod differ
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.exe b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.exe
new file mode 100644
index 0000000..7fbaad6
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.exe differ
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.ilk b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.ilk
new file mode 100644
index 0000000..e52ed2a
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.ilk differ
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.obj b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.obj
new file mode 100644
index 0000000..24b800c
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.obj differ
diff --git a/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.pdb b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.pdb
new file mode 100644
index 0000000..70cf0a4
Binary files /dev/null and b/src/wafo/source/mvnprd/old/mvnprodcorrprb/Debug/test_mvnprodcorrprb.pdb differ
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/adaptivegausskronrod.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/adaptivegausskronrod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/adaptivegausskronrod.mod
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/adaptivegausskronrod.mod
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/build_all.py b/src/wafo/source/mvnprd/old/mvnprodcorrprb/build_all.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/build_all.py
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/build_all.py
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/erfcoremod.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/erfcoremod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/erfcoremod.mod
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/erfcoremod.mod
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/functioninterface.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/functioninterface.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/functioninterface.mod
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/functioninterface.mod
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/integration1dmodule.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/integration1dmodule.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/integration1dmodule.mod
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/integration1dmodule.mod
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprdmod.pyd b/src/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprdmod.pyd
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/mvnprdmod.pyd
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprdmod.pyd
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprb.f b/src/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprb.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprb.f
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprb.f
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprb_interface.f b/src/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprb_interface.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprb_interface.f
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprb_interface.f
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprbmod.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprbmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprbmod.mod
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/mvnprodcorrprbmod.mod
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/AdaptiveGaussKronrod.f90 b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/AdaptiveGaussKronrod.f90
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/AdaptiveGaussKronrod.f90
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/AdaptiveGaussKronrod.f90
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.mod
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.mod
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.pyf b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.pyf
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.pyf
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.pyfo b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.pyfo
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.pyfo
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/adaptivegausskronrod.pyfo
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/dea.f b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/dea.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/dea.f
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/dea.f
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/deamod.pyf b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/deamod.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/deamod.pyf
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/deamod.pyf
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcore.f90 b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcore.f90
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcore.f90
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcore.f90
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcore.pyd b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcore.pyd
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcore.pyd
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcore.pyd
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcoremod.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcoremod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcoremod.mod
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/erfcoremod.mod
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/functioninterface.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/functioninterface.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/functioninterface.mod
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/functioninterface.mod
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1Dmodule.f b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1Dmodule.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1Dmodule.f
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1Dmodule.f
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1Dmodule.f90 b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1Dmodule.f90
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1Dmodule.f90
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1Dmodule.f90
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1dmodule.mod b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1dmodule.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1dmodule.mod
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/integration1dmodule.mod
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvn.exe b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvn.exe
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/mvn.exe
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvn.exe
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprb.f90 b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprb.f90
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprb.f90
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprb.f90
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprb.pyf b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprb.pyf
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprb.pyf
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprb.pyf
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprbmod.f90 b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprbmod.f90
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprbmod.f90
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/mvnprodcorrprbmod.f90
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.dsp b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.dsp
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.dsp
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.dsp
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.dsw b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.dsw
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.dsw
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.dsw
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.f b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.f
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.f
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.opt b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.opt
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.opt
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.opt
diff --git a/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.plg b/src/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.plg
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.plg
rename to src/wafo/source/mvnprd/old/mvnprodcorrprb/old/test_mvnprodcorrprb.plg
diff --git a/src/wafo/source/old/adaptivegausskronrod.mod b/src/wafo/source/old/adaptivegausskronrod.mod
new file mode 100644
index 0000000..211b8c8
--- /dev/null
+++ b/src/wafo/source/old/adaptivegausskronrod.mod
@@ -0,0 +1,112 @@
+GFORTRAN module created from mvnprodcorrprb.f on Mon Nov 10 15:32:07 2008
+MD5:3741e25b152f50d5036e26826a6dde6c -- If you edit this, you'll get what you deserve.
+
+(() () () () () () () () () () () () () () () () () () () () () () () ()
+() () ())
+
+()
+
+(('dqagpe' 'adaptivegausskronrod' 2) ('dqagp' 'adaptivegausskronrod' 3))
+
+()
+
+()
+
+(3 'dqagp' 'adaptivegausskronrod' 'dqagp' 1 ((PROCEDURE UNKNOWN-INTENT
+MODULE-PROC DECL UNKNOWN SUBROUTINE GENERIC) (UNKNOWN 0 0 0 UNKNOWN ())
+4 0 (5 6 7 8 9 10 11 12 13 14 15 16) () 0 () () 0 0)
+2 'dqagpe' 'adaptivegausskronrod' 'dqagpe' 1 ((PROCEDURE UNKNOWN-INTENT
+MODULE-PROC DECL UNKNOWN SUBROUTINE GENERIC) (UNKNOWN 0 0 0 UNKNOWN ())
+17 0 (18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38) ()
+0 () () 0 0)
+18 'f' '' 'f' 17 ((PROCEDURE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN
+EXTERNAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+19 'a' '' 'a' 17 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+20 'b' '' 'b' 17 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+21 'npts' '' 'npts' 17 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+22 'points' '' 'points' 17 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 EXPLICIT (CONSTANT (
+INTEGER 4 0 0 INTEGER ()) 0 '1') (VARIABLE (INTEGER 4 0 0 INTEGER ()) 0
+21 ())) 0 () () 0 0)
+23 'epsabs' '' 'epsabs' 17 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+37 'ndin' '' 'ndin' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () (1 EXPLICIT (
+CONSTANT (INTEGER 4 0 0 INTEGER ()) 0 '1') (OP (INTEGER 4 0 0 INTEGER ())
+0 PLUS (VARIABLE (INTEGER 4 0 0 INTEGER ()) 0 21 ()) (CONSTANT (INTEGER
+4 0 0 INTEGER ()) 0 '2'))) 0 () () 0 0)
+38 'last' '' 'last' 17 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN
+UNKNOWN DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+5 'f' '' 'f' 4 ((PROCEDURE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN
+EXTERNAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+6 'a' '' 'a' 4 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (REAL 8
+0 0 REAL ()) 0 0 () () 0 () () 0 0)
+7 'b' '' 'b' 4 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (REAL 8
+0 0 REAL ()) 0 0 () () 0 () () 0 0)
+8 'npts' '' 'npts' 4 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+9 'points' '' 'points' 4 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 EXPLICIT (CONSTANT (
+INTEGER 4 0 0 INTEGER ()) 0 '1') (VARIABLE (INTEGER 4 0 0 INTEGER ()) 0
+8 ())) 0 () () 0 0)
+10 'epsabs' '' 'epsabs' 4 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+11 'epsrel' '' 'epsrel' 4 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+12 'limit' '' 'limit' 4 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+13 'result1' '' 'result1' 4 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+14 'abserr' '' 'abserr' 4 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+15 'neval' '' 'neval' 4 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+16 'ier' '' 'ier' 4 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+24 'epsrel' '' 'epsrel' 17 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+25 'limit' '' 'limit' 17 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+26 'result' '' 'result' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+27 'abserr' '' 'abserr' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+28 'neval' '' 'neval' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+29 'ier' '' 'ier' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+30 'alist' '' 'alist' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 EXPLICIT (CONSTANT (
+INTEGER 4 0 0 INTEGER ()) 0 '1') (VARIABLE (INTEGER 4 0 0 INTEGER ()) 0
+25 ())) 0 () () 0 0)
+31 'blist' '' 'blist' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 EXPLICIT (CONSTANT (
+INTEGER 4 0 0 INTEGER ()) 0 '1') (VARIABLE (INTEGER 4 0 0 INTEGER ()) 0
+25 ())) 0 () () 0 0)
+32 'rlist' '' 'rlist' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 EXPLICIT (CONSTANT (
+INTEGER 4 0 0 INTEGER ()) 0 '1') (VARIABLE (INTEGER 4 0 0 INTEGER ()) 0
+25 ())) 0 () () 0 0)
+33 'elist' '' 'elist' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 EXPLICIT (CONSTANT (
+INTEGER 4 0 0 INTEGER ()) 0 '1') (VARIABLE (INTEGER 4 0 0 INTEGER ()) 0
+25 ())) 0 () () 0 0)
+34 'pts' '' 'pts' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 EXPLICIT (CONSTANT (
+INTEGER 4 0 0 INTEGER ()) 0 '1') (OP (INTEGER 4 0 0 INTEGER ()) 0 PLUS (
+VARIABLE (INTEGER 4 0 0 INTEGER ()) 0 21 ()) (CONSTANT (INTEGER 4 0 0
+INTEGER ()) 0 '2'))) 0 () () 0 0)
+35 'iord' '' 'iord' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () (1 EXPLICIT (
+CONSTANT (INTEGER 4 0 0 INTEGER ()) 0 '1') (VARIABLE (INTEGER 4 0 0
+INTEGER ()) 0 25 ())) 0 () () 0 0)
+36 'level' '' 'level' 17 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () (1 EXPLICIT (
+CONSTANT (INTEGER 4 0 0 INTEGER ()) 0 '1') (VARIABLE (INTEGER 4 0 0
+INTEGER ()) 0 25 ())) 0 () () 0 0)
+)
+
+('dqagp' 0 3 'dqagpe' 0 2)
diff --git a/src/wafo/source/old/dunnettprb.f b/src/wafo/source/old/dunnettprb.f
new file mode 100644
index 0000000..296b54e
--- /dev/null
+++ b/src/wafo/source/old/dunnettprb.f
@@ -0,0 +1,1209 @@
+
+ MODULE ERFCOREMOD
+ IMPLICIT NONE
+
+ INTERFACE CALERF
+ MODULE PROCEDURE CALERF
+ END INTERFACE
+
+ INTERFACE DERF
+ MODULE PROCEDURE DERF
+ END INTERFACE
+
+ INTERFACE DERFC
+ MODULE PROCEDURE DERFC
+ END INTERFACE
+
+ INTERFACE DERFCX
+ MODULE PROCEDURE DERFCX
+ END INTERFACE
+ CONTAINS
+C--------------------------------------------------------------------
+C
+C DERF subprogram computes approximate values for erf(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, January 8, 1985
+C
+C--------------------------------------------------------------------
+ FUNCTION DERF( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 0
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERF
+C--------------------------------------------------------------------
+C
+C DERFC subprogram computes approximate values for erfc(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, January 8, 1985
+C
+C--------------------------------------------------------------------
+ FUNCTION DERFC( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 1
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERFC
+C------------------------------------------------------------------
+C
+C DERFCX subprogram computes approximate values for exp(x*x) * erfc(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, March 30, 1987
+C
+C------------------------------------------------------------------
+ FUNCTION DERFCX( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 2
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERFCX
+
+ SUBROUTINE CALERF(ARG,RESULT,JINT)
+ IMPLICIT NONE
+C------------------------------------------------------------------
+C
+C CALERF packet evaluates erf(x), erfc(x), and exp(x*x)*erfc(x)
+C for a real argument x. It contains three FUNCTION type
+C subprograms: ERF, ERFC, and ERFCX (or DERF, DERFC, and DERFCX),
+C and one SUBROUTINE type subprogram, CALERF. The calling
+C statements for the primary entries are:
+C
+C Y=ERF(X) (or Y=DERF(X)),
+C
+C Y=ERFC(X) (or Y=DERFC(X)),
+C and
+C Y=ERFCX(X) (or Y=DERFCX(X)).
+C
+C The routine CALERF is intended for internal packet use only,
+C all computations within the packet being concentrated in this
+C routine. The function subprograms invoke CALERF with the
+C statement
+C
+C CALL CALERF(ARG,RESULT,JINT)
+C
+C where the parameter usage is as follows
+C
+C Function Parameters for CALERF
+C call ARG Result JINT
+C
+C ERF(ARG) ANY REAL ARGUMENT ERF(ARG) 0
+C ERFC(ARG) ABS(ARG) .LT. XBIG ERFC(ARG) 1
+C ERFCX(ARG) XNEG .LT. ARG .LT. XMAX ERFCX(ARG) 2
+C
+C The main computation evaluates near-minimax approximations
+C from "Rational Chebyshev approximations for the error function"
+C by W. J. Cody, Math. Comp., 1969, PP. 631-638. This
+C transportable program uses rational functions that theoretically
+C approximate erf(x) and erfc(x) to at least 18 significant
+C decimal digits. The accuracy achieved depends on the arithmetic
+C system, the compiler, the intrinsic functions, and proper
+C selection of the machine-dependent constants.
+C
+C*******************************************************************
+C*******************************************************************
+C
+C Explanation of machine-dependent constants
+C
+C XMIN = the smallest positive floating-point number.
+C XINF = the largest positive finite floating-point number.
+C XNEG = the largest negative argument acceptable to ERFCX;
+C the negative of the solution to the equation
+C 2*exp(x*x) = XINF.
+C XSMALL = argument below which erf(x) may be represented by
+C 2*x/sqrt(pi) and above which x*x will not underflow.
+C A conservative value is the largest machine number X
+C such that 1.0 + X = 1.0 to machine precision.
+C XBIG = largest argument acceptable to ERFC; solution to
+C the equation: W(x) * (1-0.5/x**2) = XMIN, where
+C W(x) = exp(-x*x)/[x*sqrt(pi)].
+C XHUGE = argument above which 1.0 - 1/(2*x*x) = 1.0 to
+C machine precision. A conservative value is
+C 1/[2*sqrt(XSMALL)]
+C XMAX = largest acceptable argument to ERFCX; the minimum
+C of XINF and 1/[sqrt(pi)*XMIN].
+C
+C Approximate values for some important machines are:
+C
+C XMIN XINF XNEG XSMALL
+C
+C C 7600 (S.P.) 3.13E-294 1.26E+322 -27.220 7.11E-15
+C CRAY-1 (S.P.) 4.58E-2467 5.45E+2465 -75.345 7.11E-15
+C IEEE (IBM/XT,
+C SUN, etc.) (S.P.) 1.18E-38 3.40E+38 -9.382 5.96E-8
+C IEEE (IBM/XT,
+C SUN, etc.) (D.P.) 2.23D-308 1.79D+308 -26.628 1.11D-16
+C IBM 195 (D.P.) 5.40D-79 7.23E+75 -13.190 1.39D-17
+C UNIVAC 1108 (D.P.) 2.78D-309 8.98D+307 -26.615 1.73D-18
+C VAX D-Format (D.P.) 2.94D-39 1.70D+38 -9.345 1.39D-17
+C VAX G-Format (D.P.) 5.56D-309 8.98D+307 -26.615 1.11D-16
+C
+C
+C XBIG XHUGE XMAX
+C
+C C 7600 (S.P.) 25.922 8.39E+6 1.80X+293
+C CRAY-1 (S.P.) 75.326 8.39E+6 5.45E+2465
+C IEEE (IBM/XT,
+C SUN, etc.) (S.P.) 9.194 2.90E+3 4.79E+37
+C IEEE (IBM/XT,
+C SUN, etc.) (D.P.) 26.543 6.71D+7 2.53D+307
+C IBM 195 (D.P.) 13.306 1.90D+8 7.23E+75
+C UNIVAC 1108 (D.P.) 26.582 5.37D+8 8.98D+307
+C VAX D-Format (D.P.) 9.269 1.90D+8 1.70D+38
+C VAX G-Format (D.P.) 26.569 6.71D+7 8.98D+307
+C
+C*******************************************************************
+C*******************************************************************
+C
+C Error returns
+C
+C The program returns ERFC = 0 for ARG .GE. XBIG;
+C
+C ERFCX = XINF for ARG .LT. XNEG;
+C and
+C ERFCX = 0 for ARG .GE. XMAX.
+C
+C
+C Intrinsic functions required are:
+C
+C ABS, AINT, EXP
+C
+C
+C Author: W. J. Cody
+C Mathematics and Computer Science Division
+C Argonne National Laboratory
+C Argonne, IL 60439
+C
+C Latest modification: March 19, 1990
+C Updated to F90 by pab 23.03.2003
+C
+C------------------------------------------------------------------
+ DOUBLE PRECISION, INTENT(IN) :: ARG
+ INTEGER, INTENT(IN) :: JINT
+ DOUBLE PRECISION, INTENT(INOUT):: RESULT
+! Local variables
+ INTEGER :: I
+ DOUBLE PRECISION :: DEL,X,XDEN,XNUM,Y,YSQ
+C------------------------------------------------------------------
+C Mathematical constants
+C------------------------------------------------------------------
+ DOUBLE PRECISION, PARAMETER :: ZERO = 0.0D0
+ DOUBLE PRECISION, PARAMETER :: HALF = 0.05D0
+ DOUBLE PRECISION, PARAMETER :: ONE = 1.0D0
+ DOUBLE PRECISION, PARAMETER :: TWO = 2.0D0
+ DOUBLE PRECISION, PARAMETER :: FOUR = 4.0D0
+ DOUBLE PRECISION, PARAMETER :: SIXTEN = 16.0D0
+ DOUBLE PRECISION, PARAMETER :: SQRPI = 5.6418958354775628695D-1
+ DOUBLE PRECISION, PARAMETER :: THRESH = 0.46875D0
+C------------------------------------------------------------------
+C Machine-dependent constants
+C------------------------------------------------------------------
+ DOUBLE PRECISION, PARAMETER :: XNEG = -26.628D0
+ DOUBLE PRECISION, PARAMETER :: XSMALL = 1.11D-16
+ DOUBLE PRECISION, PARAMETER :: XBIG = 26.543D0
+ DOUBLE PRECISION, PARAMETER :: XHUGE = 6.71D7
+ DOUBLE PRECISION, PARAMETER :: XMAX = 2.53D307
+ DOUBLE PRECISION, PARAMETER :: XINF = 1.79D308
+!---------------------------------------------------------------
+! Coefficents to the rational polynomials
+!--------------------------------------------------------------
+ DOUBLE PRECISION, DIMENSION(5) :: A, Q
+ DOUBLE PRECISION, DIMENSION(4) :: B
+ DOUBLE PRECISION, DIMENSION(9) :: C
+ DOUBLE PRECISION, DIMENSION(8) :: D
+ DOUBLE PRECISION, DIMENSION(6) :: P
+C------------------------------------------------------------------
+C Coefficients for approximation to erf in first interval
+C------------------------------------------------------------------
+ PARAMETER (A = (/ 3.16112374387056560D00,
+ & 1.13864154151050156D02,3.77485237685302021D02,
+ & 3.20937758913846947D03, 1.85777706184603153D-1/))
+ PARAMETER ( B = (/2.36012909523441209D01,2.44024637934444173D02,
+ & 1.28261652607737228D03,2.84423683343917062D03/))
+C------------------------------------------------------------------
+C Coefficients for approximation to erfc in second interval
+C------------------------------------------------------------------
+ PARAMETER ( C=(/5.64188496988670089D-1,8.88314979438837594D0,
+ 1 6.61191906371416295D01,2.98635138197400131D02,
+ 2 8.81952221241769090D02,1.71204761263407058D03,
+ 3 2.05107837782607147D03,1.23033935479799725D03,
+ 4 2.15311535474403846D-8/))
+ PARAMETER ( D =(/1.57449261107098347D01,1.17693950891312499D02,
+ 1 5.37181101862009858D02,1.62138957456669019D03,
+ 2 3.29079923573345963D03,4.36261909014324716D03,
+ 3 3.43936767414372164D03,1.23033935480374942D03/))
+C------------------------------------------------------------------
+C Coefficients for approximation to erfc in third interval
+C------------------------------------------------------------------
+ PARAMETER ( P =(/3.05326634961232344D-1,3.60344899949804439D-1,
+ 1 1.25781726111229246D-1,1.60837851487422766D-2,
+ 2 6.58749161529837803D-4,1.63153871373020978D-2/))
+ PARAMETER (Q =(/2.56852019228982242D00,1.87295284992346047D00,
+ 1 5.27905102951428412D-1,6.05183413124413191D-2,
+ 2 2.33520497626869185D-3/))
+C------------------------------------------------------------------
+ X = ARG
+ Y = ABS(X)
+ IF (Y .LE. THRESH) THEN
+C------------------------------------------------------------------
+C Evaluate erf for |X| <= 0.46875
+C------------------------------------------------------------------
+ !YSQ = ZERO
+ IF (Y .GT. XSMALL) THEN
+ YSQ = Y * Y
+ XNUM = A(5)*YSQ
+ XDEN = YSQ
+ DO I = 1, 3
+ XNUM = (XNUM + A(I)) * YSQ
+ XDEN = (XDEN + B(I)) * YSQ
+ END DO
+ RESULT = X * (XNUM + A(4)) / (XDEN + B(4))
+ ELSE
+ RESULT = X * A(4) / B(4)
+ ENDIF
+ IF (JINT .NE. 0) RESULT = ONE - RESULT
+ IF (JINT .EQ. 2) RESULT = EXP(YSQ) * RESULT
+ GO TO 800
+C------------------------------------------------------------------
+C Evaluate erfc for 0.46875 <= |X| <= 4.0
+C------------------------------------------------------------------
+ ELSE IF (Y .LE. FOUR) THEN
+ XNUM = C(9)*Y
+ XDEN = Y
+ DO I = 1, 7
+ XNUM = (XNUM + C(I)) * Y
+ XDEN = (XDEN + D(I)) * Y
+ END DO
+ RESULT = (XNUM + C(8)) / (XDEN + D(8))
+ IF (JINT .NE. 2) THEN
+ YSQ = AINT(Y*SIXTEN)/SIXTEN
+ DEL = (Y-YSQ)*(Y+YSQ)
+ RESULT = EXP(-YSQ*YSQ) * EXP(-DEL) * RESULT
+ END IF
+C------------------------------------------------------------------
+C Evaluate erfc for |X| > 4.0
+C------------------------------------------------------------------
+ ELSE
+ RESULT = ZERO
+ IF (Y .GE. XBIG) THEN
+ IF ((JINT .NE. 2) .OR. (Y .GE. XMAX)) GO TO 300
+ IF (Y .GE. XHUGE) THEN
+ RESULT = SQRPI / Y
+ GO TO 300
+ END IF
+ END IF
+ YSQ = ONE / (Y * Y)
+ XNUM = P(6)*YSQ
+ XDEN = YSQ
+ DO I = 1, 4
+ XNUM = (XNUM + P(I)) * YSQ
+ XDEN = (XDEN + Q(I)) * YSQ
+ ENDDO
+ RESULT = YSQ *(XNUM + P(5)) / (XDEN + Q(5))
+ RESULT = (SQRPI - RESULT) / Y
+ IF (JINT .NE. 2) THEN
+ YSQ = AINT(Y*SIXTEN)/SIXTEN
+ DEL = (Y-YSQ)*(Y+YSQ)
+ RESULT = EXP(-YSQ*YSQ) * EXP(-DEL) * RESULT
+ END IF
+ END IF
+C------------------------------------------------------------------
+C Fix up for negative argument, erf, etc.
+C------------------------------------------------------------------
+ 300 IF (JINT .EQ. 0) THEN
+ RESULT = (HALF - RESULT) + HALF
+ IF (X .LT. ZERO) RESULT = -RESULT
+ ELSE IF (JINT .EQ. 1) THEN
+ IF (X .LT. ZERO) RESULT = TWO - RESULT
+ ELSE
+ IF (X .LT. ZERO) THEN
+ IF (X .LT. XNEG) THEN
+ RESULT = XINF
+ ELSE
+ YSQ = AINT(X*SIXTEN)/SIXTEN
+ DEL = (X-YSQ)*(X+YSQ)
+ Y = EXP(YSQ*YSQ) * EXP(DEL)
+ RESULT = (Y+Y) - RESULT
+ END IF
+ END IF
+ END IF
+ 800 RETURN
+ END SUBROUTINE CALERF
+ END MODULE ERFCOREMOD
+
+ MODULE DUNNETMOD
+
+ SUBROUTINE MVNPRD(A, B, BPD, EPS, N, INF, IERC, HINC, PROB,
+ & BOUND,IFAULT)
+C
+C ALGORITHM AS 251.1 APPL.STATIST. (1989), VOL.38, NO.3
+C
+C FOR A MULTIVARIATE NORMAL VECTOR WITH CORRELATION STRUCTURE
+C DEFINED BY RHO(I,J) = BPD(I) * BPD(J), COMPUTES THE PROBABILITY
+C THAT THE VECTOR FALLS IN A RECTANGLE IN N-SPACE WITH ERROR
+C LESS THAN EPS.
+C
+ INTEGER NN
+ PARAMETER (NN = 50)
+ REAL A(*), B(*), BPD(*), ESTT(22), FV(5), FD(5), F1T(22),
+ * F2T(22), F3T(22), G1T(22), G3T(22), PSUM(22), H(NN), HL(NN),
+ * BB(NN)
+ INTEGER INF(*), INFT(NN), LDIR(22)
+ REAL ZERO, HALF, ONE, TWO, FOUR, SIX, PT1, PT24, ONEP5,
+ * X2880, SMALL, DXMIN, SQRT2, PROB, ERRL, BI, START,
+ * Z, HINC, ADDN, EPS2, EPS1, EPS, ZU, Z2, Z3, Z4, Z5, ZZ,
+ * ERFAC, EL, EL1, BOUND, PART0, PART2, PART3, FUNC0, FUNC2,
+ * FUNCN, WT, CONTRB, DLG, DX, DA, ESTL, ESTR, SUM, EXCESS, ERROR,
+ * PROB1, SAFE
+ INTEGER N, IERC, IFAULT, I, NTM, NMAX, LVL, NR, NDIM
+ REAL ALNORM, PPND7
+ EXTERNAL ALNORM, PPND7
+ DATA ZERO, HALF, ONE, TWO, FOUR, SIX /0.0, 0.5, 1.0, 2.0,
+ * 4.0, 6.0/
+ DATA PT1, PT24, ONEP5, X2880 /0.1, 0.24, 1.5, 2880.0/
+ DATA SMALL, DXMIN, SQRT2 /1.0E-10, 0.0000001, 1.41421356237310/
+C
+C CHECK FOR INPUT VALUES OUT OF RANGE.
+C
+ PROB = ZERO
+ BOUND = ZERO
+ IFAULT = 1
+ IF (N .LT. 1 .OR. N .GT. NN) RETURN
+ DO 10 I = 1, N
+ BI = ABS(BPD(I))
+ IFAULT = 2
+ IF (BI .GE. ONE) RETURN
+ IFAULT = 3
+ IF (INF(I) .LT. 0 .OR. INF(I) .GT. 2) RETURN
+ IFAULT = 4
+ IF (INF(I) .EQ. 2 .AND. A(I) .LE. B(I)) RETURN
+ 10 CONTINUE
+ IFAULT = 0
+ PROB = ONE
+C
+C CHECK WHETHER ANY BPD(I) = 0.
+C
+ NDIM = 0
+ DO 20 I = 1, N
+ IF (BPD(I) .NE. ZERO) THEN
+ NDIM = NDIM + 1
+ H(NDIM) = A(I)
+ HL(NDIM) = B(I)
+ BB(NDIM) = BPD(I)
+ INFT(NDIM) = INF(I)
+ ELSE
+C
+C IF ANY BPD(I) = 0, THE CONTRIBUTION TO PROB FOR THAT
+C VARIABLE IS COMPUTED FROM A UNIVARIATE NORMAL.
+C
+ IF (INF(I) .LT. 1) THEN
+ PROB = PROB * (ONE - ALNORM(B(I), .FALSE.))
+ ELSE IF (INF(I) .EQ. 1) THEN
+ PROB = PROB * ALNORM(A(I), .FALSE.)
+ ELSE
+ PROB = PROB * (ALNORM(A(I), .FALSE.) -
+ * ALNORM(B(I), .FALSE.))
+ END IF
+ IF (PROB .LE. SMALL) PROB = ZERO
+ END IF
+ 20 CONTINUE
+ IF (NDIM .EQ. 0 .OR. PROB .EQ. ZERO) RETURN
+C
+C IF NOT ALL BPD(I) = 0, PROB IS COMPUTED BY SIMPSON'S RULE.
+C BUT FIRST, INITIALIZE THE VARIABLES.
+C
+ Z = ZERO
+ IF (HINC .LE. ZERO) HINC = PT24
+ ADDN = -ONE
+ DO 30 I = 1, NDIM
+ IF (INFT(I) .EQ. 2 .OR.
+ * (INFT(I) .NE. INFT(1) .AND. BB(I) * BB(1) .GT. ZERO) .OR.
+ * (INFT(I) .EQ. INFT(1) .AND. BB(I) * BB(1) .LT. ZERO))
+ * ADDN = ZERO
+ 30 CONTINUE
+C
+C THE VALUE OF ADDN IS TO BE ADDED TO THE PRODUCT EXPRESSIONS IN
+C THE INTEGRAND TO INSURE THAT THE LIMITING VALUE IS ZERO.
+C
+ PROB1 = ZERO
+ NTM = 0
+ NMAX = 400
+ IF (IERC .EQ. 0) NMAX = NMAX * 2
+ CALL PFUNC (Z, H, HL, BB, NDIM, INFT, ADDN, SAFE, FUNC0, NTM,
+ * IERC, PART0)
+ EPS2 = EPS * PT1 * HALF
+C
+C SET UPPER BOUND ON Z AND APPORTION EPS.
+C
+ ZU = -PPND7(EPS2, IFAULT) / SQRT2
+ IF (IFAULT .NE. 0) THEN
+ IFAULT = 6
+ RETURN
+ END IF
+ NR = IFIX(ZU / HINC) + 1
+ ERFAC = ONE
+ IF (IERC .NE. 0) ERFAC = X2880 / HINC ** 5
+ EL = (EPS - EPS2) / FLOAT(NR) * ERFAC
+ EL1 = EL
+C
+C START COMPUTATIONS FOR THE INTERVAL (Z, Z + HINC).
+C
+ 40 ERROR = ZERO
+ LVL = 0
+ FV(1) = PART0
+ FD(1) = SAFE
+ START = Z
+ DA = HINC
+ Z3 = START + HALF * DA
+ CALL PFUNC(Z3, H, HL, BB, NDIM, INFT, ADDN, FD(3), FUNCN, NTM,
+ * IERC, FV(3))
+ Z5 = START + DA
+ CALL PFUNC(Z5, H, HL, BB, NDIM, INFT, ADDN, FD(5), FUNC2, NTM,
+ * IERC, FV(5))
+ PART2 = FV(5)
+ SAFE = FD(5)
+ WT = DA / SIX
+ CONTRB = WT * (FV(1) + FOUR * FV(3) + FV(5))
+ DLG = ZERO
+ IF (IERC .NE. 0) THEN
+ CALL WMAX(FD(1), FD(3), FD(5), DLG)
+ IF (DLG .LE. EL) GO TO 90
+ DX = DA
+ GO TO 60
+ END IF
+ LVL = 1
+ LDIR(LVL) = 2
+ PSUM(LVL) = ZERO
+C
+C BISECT INTERVAL. IF IERC = 1, COMPUTE ESTIMATE ON LEFT
+C HALF; IF IERC = 0, ON BOTH HALVES.
+C
+ 50 DX = HALF * DA
+ WT = DX / SIX
+ Z2 = START + HALF * DX
+ CALL PFUNC(Z2, H, HL, BB, NDIM, INFT, ADDN, FD(2), FUNCN, NTM,
+ * IERC,FV(2))
+ ESTL = WT * (FV(1) + FOUR * FV(2) + FV(3))
+ IF (IERC .EQ. 0) THEN
+ Z4 = START + ONEP5 * DX
+ CALL PFUNC(Z4, H, HL, BB, NDIM, INFT, ADDN, FD(4), FUNCN,
+ * NTM, IERC, FV(4))
+ ESTR = WT * (FV(3) + FOUR * FV(4) + FV(5))
+ SUM = ESTL + ESTR
+ DLG = ABS(CONTRB - SUM)
+ EPS1 = EL / TWO ** (LVL - 1)
+ ERRL = DLG
+ ELSE
+ FV(3) = FV(2)
+ FD(3) = FD(2)
+ CALL WMAX(FD(1), FD(3), FD(5), DLG)
+ ERRL = DLG / TWO ** (5 * LVL)
+ SUM = ESTL
+ EPS1 = EL * (TWO ** LVL) ** 4
+ END IF
+C
+C STOP SUBDIVIDING INTERVAL WHEN ACCURACY IS SUFFICIENT,
+C OR IF INTERVAL TOO NARROW OR SUBDIVIDED TOO OFTEN.
+C
+ IF (DLG .LE. EPS1 .OR. DLG .LT. SMALL) GO TO 70
+ IF (IFAULT .EQ. 0 .AND. NTM .GE. NMAX) IFAULT = 5
+ IF (ABS(DX) .LE. DXMIN .OR. LVL .GT. 21) IFAULT = 7
+ IF (IFAULT .NE. 0) GO TO 70
+C
+C RAISE LEVEL. STORE INFORMATION FOR RIGHT HALF AND APPLY
+C SIMPSON'S RULE TO LEFT HALF.
+C
+ 60 LVL = LVL + 1
+ LDIR(LVL) = 1
+ F1T(LVL) = FV(3)
+ F3T(LVL) = FV(5)
+ DA = DX
+ FV(5) = FV(3)
+ IF (IERC .EQ. 0) THEN
+ F2T(LVL) = FV(4)
+ ESTT(LVL) = ESTR
+ CONTRB = ESTL
+ FV(3) = FV(2)
+ ELSE
+ G1T(LVL) = FD(3)
+ G3T(LVL) = FD(5)
+ FD(5) = FD(3)
+ END IF
+ GO TO 50
+C
+C ACCEPT APPROXIMATE VALUE FOR INTERVAL.
+C RESTORE SAVED INFORMATION TO PROCESS
+C RIGHT HALF INTERVAL.
+C
+ 70 ERROR = ERROR + ERRL
+ 80 IF (LDIR(LVL) .EQ. 1) THEN
+ PSUM(LVL) = SUM
+ LDIR(LVL) = 2
+ IF (IERC .EQ. 0) DX = DX * TWO
+ START = START + DX
+ DA = HINC / TWO ** (LVL - 1)
+ FV(1) = F1T(LVL)
+ IF (IERC .EQ. 0) THEN
+ FV(3) = F2T(LVL)
+ CONTRB = ESTT(LVL)
+ ELSE
+ FV(3) = F3T(LVL)
+ FD(1) = G1T(LVL)
+ FD(5) = G3T(LVL)
+ END IF
+ FV(5) = F3T(LVL)
+ GO TO 50
+ END IF
+ SUM = SUM + PSUM(LVL)
+ LVL = LVL - 1
+ IF (LVL .GT. 0) GO TO 80
+ CONTRB = SUM
+ LVL = 1
+ DLG = ERROR
+ 90 PROB1 = PROB1 + CONTRB
+ BOUND = BOUND + DLG
+ EXCESS = EL - DLG
+ EL = EL1
+ IF (EXCESS .GT. ZERO) EL = EL1 + EXCESS
+ IF ((FUNC0 .GT. ZERO .AND. FUNC2 .LE. FUNC0) .OR.
+ * (FUNC0 .LT. ZERO .AND. FUNC2 .GE. FUNC0)) THEN
+ ZZ = -SQRT2 * Z5
+ PART3 = ABS(FUNC2) * ALNORM(ZZ, .FALSE.) + BOUND / ERFAC
+ IF (PART3 .LE. EPS .OR. NTM .GE. NMAX .OR. Z5 .GE. ZU) GOTO 100
+ END IF
+ Z = Z5
+ PART0 = PART2
+ FUNC0 = FUNC2
+ IF (Z .LT. ZU .AND. NTM .LT. NMAX) GO TO 40
+ 100 PROB = (PROB1 - ADDN * HALF) * PROB
+ BOUND = PART3
+ IF (NTM .GE. NMAX .AND. IFAULT .EQ. 0) IFAULT = 5
+ IF (BOUND .GT. EPS .AND. IFAULT .EQ. 0) IFAULT = 8
+ RETURN
+ END
+ SUBROUTINE PFUNC(Z, A, B, BPD, N, INF, ADDN, DERIV, FUNCN, NTM,
+ * IERC, RESULT)
+C
+C ALGORITHM AS 251.2 APPL.STATIST. (1989), VOL.38, NO.3
+C
+C
+C COMPUTE FUNCTION IN INTEGRAND AND ITS 4TH DERIVATIVE.
+C
+ INTEGER NN
+ PARAMETER (NN = 50)
+ REAL A(*), B(*), BPD(*), FOU(NN), FOU1(4, NN), TMP(4), GOU(NN),
+ * GOU1(4, NN), FF(4), GF(4), TERM(4), GERM(4)
+ INTEGER INF(*)
+ REAL ZERO, ONE, TWO, THREE, FOUR, SIX, EIGHT, TWELVE, SIXTN,
+ * SMALL, Z, U, U1, U2, BI, HI, HLI, BP, ADDN, DERIV, FUNCN,
+ * RESULT, RSLT1, RSLT2, DEN, SQRT2, SQRTPI, PHI, PHI1, PHI2,
+ * PHI3, PHI4, FRM, GRM
+ INTEGER N, NTM, IERC, INFI, I, J, K, M, L, IK
+ REAL ALNORM
+ EXTERNAL ALNORM
+ DATA ZERO, ONE, TWO, THREE, FOUR, SIX, EIGHT, TWELVE, SIXTN,
+ * SMALL /0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 12.0, 16.0, 0.1E-12/
+ DATA SQRT2, SQRTPI /1.41421356237310, 1.77245385090552/
+ DERIV = ZERO
+ NTM = NTM + 1
+ RSLT1 = ONE
+ RSLT2 = ONE
+ BI = ONE
+ HI = A(1) + ONE
+ HLI = B(1) + ONE
+ INFI = -1
+ DO 60 I = 1, N
+ IF (BPD(I) .EQ. BI .AND. A(I) .EQ. HI .AND. B(I) .EQ. HLI .AND.
+ * INF(I) .EQ. INFI) THEN
+ FOU(I) = FOU(I - 1)
+ GOU(I) = GOU(I - 1)
+ DO 10 IK = 1, 4
+ FOU1(IK, I) = FOU1(IK, I - 1)
+ GOU1(IK, I) = GOU1(IK, I - 1)
+ 10 CONTINUE
+ ELSE
+ BI = BPD(I)
+ HI = A(I)
+ HLI = B(I)
+ INFI = INF(I)
+ IF (BI .EQ. ZERO) THEN
+ IF (INFI .LT. 1) THEN
+ FOU(I) = ONE - ALNORM(HLI, .FALSE.)
+ ELSE IF (INFI .EQ. 1) THEN
+ FOU(I) = ALNORM(HI, .FALSE.)
+ ELSE
+ FOU(I) = ALNORM(HI, .FALSE.) - ALNORM(HLI, .FALSE.)
+ END IF
+ GOU(I) = FOU(I)
+ DO 20 IK = 1, 4
+ FOU1(IK, I) = ZERO
+ GOU1(IK, I) = ZERO
+ 20 CONTINUE
+ ELSE
+ DEN = SQRT(ONE - BI * BI)
+ BP = BI * SQRT2 / DEN
+ IF (INFI .LT. 1) THEN
+ U = -HLI / DEN + Z * BP
+ FOU(I) = ALNORM(U, .FALSE.)
+ CALL ASSIGN (U, BP, FOU1(1, I))
+ BP = -BP
+ U = -HLI / DEN + Z * BP
+ GOU(I) = ALNORM(U, .FALSE.)
+ CALL ASSIGN (U, BP, GOU1(1, I))
+ ELSE IF (INFI .EQ. 1) THEN
+ U = HI / DEN + Z * BP
+ GOU(I) = ALNORM(U, .FALSE.)
+ CALL ASSIGN (U, BP, GOU1(1, I))
+ BP = -BP
+ U = HI / DEN + Z * BP
+ FOU(I) = ALNORM(U, .FALSE.)
+ CALL ASSIGN (U, BP, FOU1(1, I))
+ ELSE
+ U2 = -HLI / DEN + Z * BP
+ CALL ASSIGN (U2, BP, FOU1(1, I))
+ BP = -BP
+ U1 = HI / DEN + Z * BP
+ CALL ASSIGN (U1, BP, TMP(1))
+ FOU(I) = ALNORM(U1, .FALSE.) + ALNORM(U2, .FALSE.) - ONE
+ DO 30 IK = 1, 4
+ FOU1(IK, I) = FOU1(IK, I) + TMP(IK)
+ 30 CONTINUE
+ IF (-HLI .EQ. HI) THEN
+ GOU(I) = FOU(I)
+ DO 40 IK = 1, 4
+ GOU1(IK, I) = FOU1(IK, I)
+ 40 CONTINUE
+ ELSE
+ U2 = -HLI / DEN + Z * BP
+ CALL ASSIGN (U2, BP, GOU1(1, I))
+ BP = -BP
+ U1 = HI / DEN + Z * BP
+ GOU(I) = ALNORM(U1, .FALSE.) + ALNORM(U2, .FALSE.)-ONE
+ CALL ASSIGN (U1, BP, TMP(1))
+ DO 50 IK = 1, 4
+ GOU1(IK, I) = GOU1(IK, I) + TMP(IK)
+ 50 CONTINUE
+ END IF
+ END IF
+ END IF
+ END IF
+ RSLT1 = RSLT1 * FOU(I)
+ RSLT2 = RSLT2 * GOU(I)
+ IF (RSLT1 .LE. SMALL) RSLT1 = ZERO
+ IF (RSLT2 .LE. SMALL) RSLT2 = ZERO
+ 60 CONTINUE
+ FUNCN = RSLT1 + RSLT2 + ADDN
+ RESULT = FUNCN * EXP(-Z * Z) / SQRTPI
+C
+C IF 4TH DERIVATIVE IS NOT WANTED, STOP HERE.
+C OTHERWISE, PROCEED TO COMPUTE 4TH DERIVATIVE.
+C
+ IF (IERC .EQ. 0) RETURN
+ DO 70 IK = 1, 4
+ FF(IK) = ZERO
+ GF(IK) = ZERO
+ 70 CONTINUE
+ DO 100 I = 1, N
+ FRM = ONE
+ GRM = ONE
+ DO 80 J = 1, N
+ IF (J .EQ. 1) GO TO 80
+ FRM = FRM * FOU(J)
+ GRM = GRM * GOU(J)
+ IF (FRM .LE. SMALL) FRM = ZERO
+ IF (GRM .LE. SMALL) GRM = ZERO
+ 80 CONTINUE
+ DO 90 IK = 1, 4
+ FF(IK) = FF(IK) + FRM * FOU1(IK, I)
+ GF(IK) = GF(IK) + GRM * GOU1(IK, I)
+ 90 CONTINUE
+ 100 CONTINUE
+ IF (N .LE. 2) GO TO 230
+ DO 130 I = 1, N
+ DO 120 J = I + 1, N
+ TERM(2) = FOU1(1, I) * FOU1(1, J)
+ GERM(2) = GOU1(1, I) * GOU1(1, J)
+ TERM(3) = FOU1(2, I) * FOU1(1, J)
+ GERM(3) = GOU1(2, I) * GOU1(1, J)
+ TERM(4) = FOU1(3, I) * FOU1(1, J)
+ GERM(4) = GOU1(3, I) * GOU1(1, J)
+ TERM(1) = FOU1(2, I) * FOU1(2, J)
+ GERM(1) = GOU1(2, I) * GOU1(2, J)
+ DO 110 K = 1, N
+ IF (K .EQ. I .OR. K .EQ. J) GO TO 110
+ CALL TOOSML (1, TERM, FOU(K))
+ CALL TOOSML (1, GERM, GOU(K))
+ 110 CONTINUE
+ FF(2) = FF(2) + TWO * TERM(2)
+ FF(3) = FF(3) + TWO * TERM(3) * THREE
+ FF(4) = FF(4) + TWO * (TERM(4) * FOUR + TERM(1) * THREE)
+ GF(2) = GF(2) + TWO * GERM(2)
+ GF(3) = GF(3) + TWO * GERM(3) * THREE
+ GF(4) = GF(4) + TWO * (GERM(4) * FOUR + GERM(1) * THREE)
+ 120 CONTINUE
+ 130 CONTINUE
+ DO 170 I = 1, N
+ DO 160 J = I + 1, N
+ DO 150 K = J + 1, N
+ TERM(3) = FOU1(1, I) * FOU1(1, J) * FOU1(1, K)
+ TERM(4) = FOU1(2, I) * FOU1(1, J) * FOU1(1, K)
+ GERM(3) = GOU1(1, I) * GOU1(1, J) * GOU1(1, K)
+ GERM(4) = GOU1(2, I) * GOU1(1, J) * GOU1(1, K)
+ IF (N .GT. 3) THEN
+ DO 140 M = 1, N
+ IF (M .EQ. I .OR. M .EQ. J .OR. M .EQ. K) GO TO 140
+ CALL TOOSML (3, TERM, FOU(M))
+ CALL TOOSML (3, GERM, GOU(M))
+ 140 CONTINUE
+ END IF
+ FF(3) = FF(3) + SIX * TERM(3)
+ FF(4) = FF(4) + SIX * TERM(4) * SIX
+ GF(3) = GF(3) + SIX * GERM(3)
+ GF(4) = GF(4) + SIX * GERM(4) * SIX
+ 150 CONTINUE
+ 160 CONTINUE
+ 170 CONTINUE
+ IF (N .LE. 3) GO TO 230
+ DO 220 I = 1, N
+ DO 210 J = I + 1, N
+ DO 200 K = J + 1, N
+ DO 190 M = K + 1, N
+ TERM(4) = FOU1(1, I) * FOU1(1, J) * FOU1(1, K) * FOU1(1, M)
+ GERM(4) = GOU1(1, I) * GOU1(1, J) * GOU1(1, K) * GOU1(1, M)
+ IF (N .GT. 4) THEN
+ DO 180 L = 1, N
+ IF (L .EQ. I .OR. L .EQ. J .OR. L .EQ. K .OR. L .EQ. M)GOTO 180
+ CALL TOOSML (4, TERM, FOU(L))
+ CALL TOOSML (4, GERM, GOU(L))
+ 180 CONTINUE
+ END IF
+ FF(4) = FF(4) + FOUR * SIX * TERM(4)
+ GF(4) = GF(4) + FOUR * SIX * GERM(4)
+ 190 CONTINUE
+ 200 CONTINUE
+ 210 CONTINUE
+ 220 CONTINUE
+C
+ 230 CONTINUE
+ PHI = EXP(-Z * Z) / SQRTPI
+ PHI1 = -TWO * Z * PHI
+ PHI2 = (FOUR * Z ** 2 - TWO) * PHI
+ PHI3 = (-EIGHT * Z ** 3 + TWELVE * Z) * PHI
+ PHI4 = (SIXTN * Z ** 2 * (Z ** 2 - THREE) + TWELVE) * PHI
+ DERIV = PHI * (FF(4) + GF(4)) + FOUR * PHI1 * (FF(3) + GF(3))
+ * + SIX * PHI2 * (FF(2) + GF(2)) + FOUR * PHI3 * (FF(1) + GF(1))
+ * + PHI4 * FUNCN
+ RETURN
+ END
+ SUBROUTINE ASSIGN (U, BP, FF)
+C
+C ALGORITHM AS 251.3 APPL.STATIST. (1989), VOL.38, NO.3
+C
+C
+C COMPUTE DERIVATIVES OF NORMAL CDF'S.
+C
+ REAL FF(4)
+ REAL U, U2, BP, HALF, ONE, THREE, SQ2PI, T1, T2, T3
+ INTEGER I
+ DATA HALF, ONE, THREE, SQ2PI /0.5, 1.0, 3.0, 2.50662827463100/
+ DATA ZERO, UMAX, SMALL /0.0, 8.0, 0.1E-07/
+ IF (ABS(U) .GT. UMAX) THEN
+ DO 10 I = 1, 4
+ FF(I) = ZERO
+ 10 CONTINUE
+ ELSE
+ U2 = U * U
+ T1 = BP * EXP(-HALF * U2) / SQ2PI
+ T2 = BP * T1
+ T3 = BP * T2
+ FF(1) = T1
+ FF(2) = -U * T2
+ FF(3) = (U2 - ONE) * T3
+ FF(4) = (THREE - U2) * U * BP * T3
+ DO 20 I = 1, 4
+ IF(ABS(FF(I)) .LT. SMALL) FF(I) = ZERO
+ 20 CONTINUE
+ END IF
+ RETURN
+ END
+ SUBROUTINE WMAX(W1, W2, W3, DLG)
+C
+C ALGORITHM AS 251.4 APPL.STATIST. (1989), VOL.38, NO.3
+C
+C
+C LARGEST ABSOLUTE VALUE OF QUADRATIC FUNCTION FITTED
+C TO THREE POINTS.
+C
+ REAL W1, W2, W3, DLG, QUAD, QLIM, QMIN, ONE, TWO, B2C
+ DATA ONE, TWO, QMIN /1.0, 2.0, 0.00001/
+ DLG = MAX( ABS(W1), ABS(W3) )
+ QUAD = W1 - W2 * TWO + W3
+ QLIM = MAX( ABS(W1 - W3) / TWO , QMIN)
+ IF (ABS(QUAD) .LE. QLIM) RETURN
+ B2C = (W1 - W3) / QUAD / TWO
+ IF (ABS(B2C) .GE. ONE) RETURN
+ DLG = MAX( DLG, ABS(W2 - B2C * QUAD * B2C / TWO) )
+ RETURN
+ END
+ SUBROUTINE TOOSML (N, FF, F)
+C
+C ALGORITHM AS 251.5 APPL.STATIST. (1989), VOL.38, NO.3
+C
+C
+C MULTIPLY FF(I) BY F FOR I = N TO 4. SET TO ZERO IF TOO SMALL.
+C
+ REAL FF(4), F, ZERO, SMALL
+ INTEGER N, I
+ DATA ZERO, SMALL /0.0, 0.1E-12/
+ DO 10 I = N, 4
+ FF(I) = FF(I) * F
+ IF (ABS(FF(I)) .LE. SMALL) FF(I) = ZERO
+ 10 CONTINUE
+ RETURN
+ END
+ REAL FUNCTION ALNORM(X, UPPER)
+C
+C ALGORITHM AS 66 APPL. STATIST. (1973) VOL.22, P.424
+C
+C EVALUATES THE TAIL AREA OF THE STANDARDIZED NORMAL CURVE
+C FROM X TO INFINITY IF UPPER IS .TRUE. OR
+C FROM MINUS INFINITY TO X IF UPPER IS .FALSE.
+C
+ REAL LTONE, UTZERO, ZERO, HALF, ONE, CON, A1, A2, A3,
+ $ A4, A5, A6, A7, B1, B2, B3, B4, B5, B6, B7, B8, B9,
+ $ B10, B11, B12, X, Y, Z, ZEXP
+ LOGICAL UPPER, UP
+C
+C LTONE AND UTZERO MUST BE SET TO SUIT THE PARTICULAR COMPUTER
+C (SEE INTRODUCTORY TEXT)
+C
+ DATA LTONE, UTZERO /7.0, 18.66/
+ DATA ZERO, HALF, ONE, CON /0.0, 0.5, 1.0, 1.28/
+ DATA A1, A2, A3,
+ $ A4, A5, A6,
+ $ A7
+ $ /0.398942280444, 0.399903438504, 5.75885480458,
+ $ 29.8213557808, 2.62433121679, 48.6959930692,
+ $ 5.92885724438/
+ DATA B1, B2, B3,
+ $ B4, B5, B6,
+ $ B7, B8, B9,
+ $ B10, B11, B12
+ $ /0.398942280385, 3.8052E-8, 1.00000615302,
+ $ 3.98064794E-4, 1.98615381364, 0.151679116635,
+ $ 5.29330324926, 4.8385912808, 15.1508972451,
+ $ 0.742380924027, 30.789933034, 3.99019417011/
+C
+ ZEXP(Z) = EXP(Z)
+C
+ UP = UPPER
+ Z = X
+ IF (Z .GE. ZERO) GOTO 10
+ UP = .NOT. UP
+ Z = -Z
+ 10 IF (Z .LE. LTONE .OR. UP .AND. Z .LE. UTZERO) GOTO 20
+ ALNORM = ZERO
+ GOTO 40
+ 20 Y = HALF * Z * Z
+ IF (Z .GT. CON) GOTO 30
+C
+ ALNORM = HALF - Z * (A1 - A2 * Y / (Y + A3 - A4 / (Y + A5 +
+ $ A6 / (Y + A7))))
+ GOTO 40
+C
+ 30 ALNORM = B1 * ZEXP(-Y) / (Z - B2 + B3 / (Z + B4 + B5 / (Z -
+ $ B6 + B7 / (Z + B8 - B9 / (Z + B10 + B11 / (Z + B12))))))
+C
+ 40 IF (.NOT. UP) ALNORM = ONE - ALNORM
+ RETURN
+ END
+ REAL FUNCTION PPND7 (P, IFAULT)
+C
+C ALGORITHM AS241 APPL. STATIST. (1988) VOL. 37, NO. 3
+C
+C PRODUCES THE NORMAL DEVIATE Z CORRESPONDING TO A GIVEN LOWER
+C TAIL AREA OF P; Z IS ACCURATE TO ABOUT 1 PART IN 10**7.
+C
+C THE HASH SUMS BELOW ARE THE SUMS OF THE MANTISSAS OF THE
+C COEFFICIENTS. THEY ARE INCLUDED FOR USE IN CHECKING
+C TRANSCRIPTION.
+C
+ INTEGER IFAULT
+ REAL ZERO, ONE, HALF, SPLIT1, SPLIT2, CONST1, CONST2,
+ * A0, A1, A2, A3, B1, B2, B3, C0, C1, C2, C3, D1, D2,
+ * E0, E1, E2, E3, F1, F2, P, Q, R
+ PARAMETER (ZERO = 0.0E0, ONE = 1.0E0, HALF = 0.5E0,
+ * SPLIT1 = 0.425E0, SPLIT2 = 5.0E0,
+ * CONST1 = 0.180625E0, CONST2 = 1.6E0)
+C
+C COEFFICIENTS FOR P CLOSE TO 1/2
+ PARAMETER (A0 = 3.38713 27179E0,
+ * A1 = 5.04342 71938E1,
+ * A2 = 1.59291 13202E2,
+ * A3 = 5.91093 74720E1,
+ * B1 = 1.78951 69469E1,
+ * B2 = 7.87577 57664E1,
+ * B3 = 6.71875 63600E1)
+C HASH SUM AB 32.31845 77772
+C
+C COEFFICIENTS FOR P NEITHER CLOSE TO 1/2 NOR 0 OR 1
+ PARAMETER (C0 = 1.42343 72777E0,
+ * C1 = 2.75681 53900E0,
+ * C2 = 1.30672 84816E0,
+ * C3 = 1.70238 21103E-1,
+ * D1 = 7.37001 64250E-1,
+ * D2 = 1.20211 32975E-1)
+C HASH SUM CD 15.76149 29821
+C
+C COEFFICIENTS FOR P NEAR 0 OR 1
+ PARAMETER (E0 = 6.65790 51150E0,
+ * E1 = 3.08122 63860E0,
+ * E2 = 4.28682 94337E-1,
+ * E3 = 1.73372 03997E-2,
+ * F1 = 2.41978 94225E-1,
+ * F2 = 1.22582 02635E-2)
+C HASH SUM EF 19.40529 10204
+C
+ IFAULT = 0
+ Q = P - HALF
+ IF (ABS(Q) .LE. SPLIT1) THEN
+ R = CONST1 - Q * Q
+ PPND7 = Q * (((A3 * R + A2) * R + A1) * R + A0) /
+ * (((B3 * R + B2) * R + B1) * R + ONE)
+ RETURN
+ ELSE
+ IF (Q .LT. 0) THEN
+ R = P
+ ELSE
+ R = ONE - P
+ ENDIF
+ IF (R .LE. ZERO) THEN
+ IFAULT = 1
+ PPND7 = ZERO
+ RETURN
+ ENDIF
+ R = SQRT(-LOG(R))
+ IF (R .LE. SPLIT2) THEN
+ R = R - CONST2
+ PPND7 = (((C3 * R + C2) * R + C1) * R + C0) /
+ * ((D2 * R + D1) * R + ONE)
+ ELSE
+ R = R - SPLIT2
+ PPND7 = (((E3 * R + E2) * R + E1) * R + E0) /
+ * ((F2 * R + F1) * R + ONE)
+ ENDIF
+ IF (Q .LT. 0) PPND7 = -PPND7
+ RETURN
+ ENDIF
+ END
+
+ SUBROUTINE SIMPSN (NDF,A,B,BPD,ERRB,N,INF,D,IERC,HNC,PROB,
+ * BND,IFLT)
+C
+C STUDENTIZES A MULTIVARIATE INTEGRAL USING SIMPSON'S RULE.
+C
+ DIMENSION A(*),B(*),BPD(*),INF(*),D(*),
+ * FV(5),F1T(30),F2T(30),F3T(30),
+ * LDIR(30),PSUM(30),ESTT(30),ERRR(30),GV(5),G1T(30),G2T(30),
+ * G3T(30),GSUM(30)
+ DATA ZERO,HALF,ONE,ONEP5,TWO,FOUR,SIX,DXMIN /0.0,0.5,1.0,1.5,
+ * 2.0,4.0,6.0,0.000004/
+ PROB = ZERO
+ BOUNDA = ZERO
+ BOUNDG = ZERO
+ IFLAG = 0
+ IER = 0
+ START = -ONE
+ DAX = ONE
+ ERB2 = ERRB * HALF
+ EPS1 = ERB2 * HALF
+ CALL FUN (ZERO,NDF,A,B,BPD,ERB2,N,INF,D,F0,G0,IERC,HNC,IER)
+ 10 FV(1) = ZERO
+ GV(1) = ZERO
+ ERROR = ZERO
+ DA = DAX
+ LVL = 1
+ Z3 = START + HALF*DA
+ CALL FUN(Z3,NDF,A,B,BPD,ERB2,N,INF,D,FV(3),GV(3),IERC,HNC,IER)
+ FV(5) = F0
+ GV(5) = G0
+ WT = ABS(DA) / SIX
+ CONTRB = WT * (FV(1) + FOUR * FV(3) + FV(5))
+ CONTRG = WT * (GV(1) + FOUR * GV(3) + GV(5))
+ LDIR(LVL) = 2
+ PSUM(LVL) = ZERO
+ GSUM(LVL) = ZERO
+C
+C BISECT INTERVAL; COMPUTE ESTIMATES FOR EACH HALF.
+C
+ 20 DX = HALF * DA
+ WT = ABS(DX) / SIX
+ Z2 = START + HALF * DX
+ CALL FUN(Z2,NDF,A,B,BPD,ERB2,N,INF,D,FV(2),GV(2),IERC,HNC,IER)
+ Z4 = START + ONEP5 * DX
+ CALL FUN(Z4,NDF,A,B,BPD,ERB2,N,INF,D,FV(4),GV(4),IERC,HNC,IER)
+ ESTL = WT * (FV(1) + FOUR * FV(2) + FV(3))
+ ESTR = WT * (FV(3) + FOUR * FV(4) + FV(5))
+ ESTGL = WT * (GV(1) + FOUR * GV(2) + GV(3))
+ ESTGR = WT * (GV(3) + FOUR * GV(4) + GV(5))
+ SUM = ESTL + ESTR
+ SUMG = ESTGL + ESTGR
+ DLG = ABS(CONTRB - SUM)
+ ERRL = DLG
+C
+C STOP BISECTING WHEN ACCURACY SUFFICIENT, OR IF
+C INTERVAL TOO NARROW OR BISECTED TOO OFTEN.
+C
+ 30 IF (DLG .LE. EPS1) GO TO 50
+ IF (ABS(DX) .LE. DXMIN .OR. LVL .GE. 30) GO TO 40
+C
+C RAISE LEVEL. STORE INFORMATION FOR RIGHT HALF
+C AND APPLY SIMPSON'S RULE TO LEFT HALF.
+C
+ LVL = LVL + 1
+ LDIR(LVL) = 1
+ F1T(LVL) = FV(3)
+ F2T(LVL) = FV(4)
+ F3T(LVL) = FV(5)
+ G1T(LVL) = GV(3)
+ G2T(LVL) = GV(4)
+ G3T(LVL) = GV(5)
+ DA = DX
+ FV(5) = FV(3)
+ FV(3) = FV(2)
+ GV(5) = GV(3)
+ GV(3) = GV(2)
+ ESTT(LVL) = ESTR
+ CONTRB = ESTL
+ CONTRG = ESTGL
+ EPS1 = EPS1 * HALF
+ ERRR(LVL) = EPS1
+ GO TO 20
+C
+C ACCEPT APPROXIMATE VALUE FOR INTERVAL.
+C
+ 40 IFLAG = 11
+ 50 ERROR = ERROR + ERRL
+ 60 IF (LDIR(LVL) .EQ. 1) GO TO 70
+ SUM = SUM + PSUM(LVL)
+ SUMG = SUMG + GSUM(LVL)
+ LVL = LVL - 1
+ IF (LVL .GT. 0) GO TO 60
+ CONTRB = SUM
+ CONTRG = SUMG
+ LVL = 1
+ DLG = ERROR
+ GO TO 80
+C
+C RESTORE SAVED INFORMATION TO PROCESS RIGHT HALF.
+C
+ 70 PSUM(LVL) = SUM
+ GSUM(LVL) = SUMG
+ LDIR(LVL) = 2
+ DA = DAX / TWO**(LVL-1)
+ START = START + DX * TWO
+ FV(1) = F1T(LVL)
+ FV(3) = F2T(LVL)
+ FV(5) = F3T(LVL)
+ GV(1) = G1T(LVL)
+ GV(3) = G2T(LVL)
+ GV(5) = G3T(LVL)
+ CONTRB = ESTT(LVL)
+ EXCESS = EPS1 - DLG
+ EPS1 = ERRR(LVL)
+ IF (EXCESS .GT. ZERO) EPS1 = EPS1 + EXCESS
+ GO TO 20
+ 80 PROB = PROB + CONTRB
+ BOUNDG = BOUNDG + CONTRG
+ BOUNDA = BOUNDA + DLG
+ IF (Z4 .LE. ZERO) GO TO 90
+ IF (IFLT .EQ. 0) IFLT = IER
+ IF (IFLT .EQ. 0) IFLT = IFLAG
+ BOUNDA = BOUNDA + BOUNDG
+ IF (BND .LT. BOUNDA) BND = BOUNDA
+ RETURN
+ 90 EPS1 = ERB2 * HALF
+ EXCESS = EPS1 - BND
+ IF (EXCESS .GT. ZERO) EPS1 = EPS1 + EXCESS
+ START = ONE
+ DAX = -ONE
+ GO TO 10
+ END
+ FUNCTION SDIST(Y,N)
+C
+C COMPUTE Y**(N/2 - 1) EXP(-Y) / GAMMA(N/2)
+C
+C (Revised: 1994-01-19)
+C
+ DATA ZERO, HALF, ONE, X23 / 0.0, 0.5, 1.0, -23.0 /
+ DATA SQRTPI / 1.77245385090552 /
+ SDIST = ZERO
+ IF (Y .LE. ZERO) RETURN
+ JJ = N/2 - 1
+ JK = 2 * JJ - N + 2
+ JKP = JJ - JK
+ SDIST = ONE
+ IF (JK .LT. 0) SDIST = SDIST / SQRT(Y) / SQRTPI
+ IF (JKP .EQ. 0) GO TO 20
+ XN = FLOAT(N) * HALF
+ TEST = ALOG(Y) - Y / FLOAT(JKP)
+ IF ( TEST .LT. X23 ) THEN
+ SDIST = ZERO
+ RETURN
+ ENDIF
+ SDIST = ALOG ( SDIST )
+ DO 10 J = 1, JKP
+ XN = XN - ONE
+ SDIST = SDIST + TEST - ALOG(XN)
+ 10 CONTINUE
+ IF ( SDIST .LT. X23 ) THEN
+ SDIST = ZERO
+ ELSE
+ SDIST = EXP( SDIST )
+ ENDIF
+ RETURN
+ 20 SDIST = SDIST * EXP(-Y)
+ RETURN
+ END
+ SUBROUTINE FUN (Z,NDF,H,HL,BPD,ERB2,N,INF,D,F0,G0,IERC
+ * ,HNC,IER)
+ INTEGER NN
+ PARAMETER (NN=50)
+ DIMENSION A(NN),B(NN),H(*),HL(*),BPD(*),INF(*),D(*)
+ DATA ZERO, ONE, TWO, SMALL / 0.0, 1.0, 2.0, 1.0E-08 /
+ F0 = ZERO
+ G0 = ZERO
+ IF (Z .LE. -ONE .OR. Z .GE. ONE) RETURN
+ DF = FLOAT(NDF)
+ ARG = (ONE + Z) / (ONE - Z)
+ TERM = ARG * DF * TWO / (ONE-Z)**2 * SDIST(DF/TWO*ARG*ARG,NDF)
+ IF (TERM .LE. SMALL) RETURN
+ DO 10 I = 1, N
+ A(I) = ARG * H(I) - D(I)
+ B(I) = ARG * HL(I) - D(I)
+ 10 CONTINUE
+ CALL MVNPRD (A,B,BPD,ERB2,N,INF,IERC,HNC,PROB,BND,IFLT)
+ IF (IER .EQ. 0) IER = IFLT
+ G0 = TERM * BND
+ F0 = TERM * PROB
+ RETURN
+ END
+
+C * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+C Charles Dunnett
+C Dept. of Mathematics and Statistics
+C McMaster University
+C Hamilton, Ontario L8S 4K1
+C Canada
+C E-mail: dunnett@mcmaster.ca
+C Tel.: (905) 525-9140 (Ext. 27104)
+C * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ END MODULE DUNNETMOD
diff --git a/src/wafo/source/old/erfcore.f b/src/wafo/source/old/erfcore.f
new file mode 100644
index 0000000..79c705c
--- /dev/null
+++ b/src/wafo/source/old/erfcore.f
@@ -0,0 +1,524 @@
+C $ f2py -m erfcore -h erfcore.pyf erfcore.f
+C f2py erfcore.pyf erfcore.f -c --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71
+C $ f2py --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71 -m erfcore -c erfcore.f
+C
+C--------------------------------------------------------------------
+C
+C DERF subprogram computes approximate values for erf(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, January 8, 1985
+C
+C--------------------------------------------------------------------
+ FUNCTION DERF( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 0
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERF
+C--------------------------------------------------------------------
+C
+C DERFC subprogram computes approximate values for erfc(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, January 8, 1985
+C
+C--------------------------------------------------------------------
+ FUNCTION DERFC( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 1
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERFC
+C------------------------------------------------------------------
+C
+C DERFCX subprogram computes approximate values for exp(x*x) * erfc(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, March 30, 1987
+C
+C------------------------------------------------------------------
+ FUNCTION DERFCX( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 2
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERFCX
+
+ SUBROUTINE CALERF(ARG,RESULT,JINT)
+ IMPLICIT NONE
+C------------------------------------------------------------------
+C
+C CALERF packet evaluates erf(x), erfc(x), and exp(x*x)*erfc(x)
+C for a real argument x. It contains three FUNCTION type
+C subprograms: ERF, ERFC, and ERFCX (or DERF, DERFC, and DERFCX),
+C and one SUBROUTINE type subprogram, CALERF. The calling
+C statements for the primary entries are:
+C
+C Y=ERF(X) (or Y=DERF(X)),
+C
+C Y=ERFC(X) (or Y=DERFC(X)),
+C and
+C Y=ERFCX(X) (or Y=DERFCX(X)).
+C
+C The routine CALERF is intended for internal packet use only,
+C all computations within the packet being concentrated in this
+C routine. The function subprograms invoke CALERF with the
+C statement
+C
+C CALL CALERF(ARG,RESULT,JINT)
+C
+C where the parameter usage is as follows
+C
+C Function Parameters for CALERF
+C call ARG Result JINT
+C
+C ERF(ARG) ANY REAL ARGUMENT ERF(ARG) 0
+C ERFC(ARG) ABS(ARG) .LT. XBIG ERFC(ARG) 1
+C ERFCX(ARG) XNEG .LT. ARG .LT. XMAX ERFCX(ARG) 2
+C
+C The main computation evaluates near-minimax approximations
+C from "Rational Chebyshev approximations for the error function"
+C by W. J. Cody, Math. Comp., 1969, PP. 631-638. This
+C transportable program uses rational functions that theoretically
+C approximate erf(x) and erfc(x) to at least 18 significant
+C decimal digits. The accuracy achieved depends on the arithmetic
+C system, the compiler, the intrinsic functions, and proper
+C selection of the machine-dependent constants.
+C
+C*******************************************************************
+C*******************************************************************
+C
+C Explanation of machine-dependent constants
+C
+C XMIN = the smallest positive floating-point number.
+C XINF = the largest positive finite floating-point number.
+C XNEG = the largest negative argument acceptable to ERFCX;
+C the negative of the solution to the equation
+C 2*exp(x*x) = XINF.
+C XSMALL = argument below which erf(x) may be represented by
+C 2*x/sqrt(pi) and above which x*x will not underflow.
+C A conservative value is the largest machine number X
+C such that 1.0 + X = 1.0 to machine precision.
+C XBIG = largest argument acceptable to ERFC; solution to
+C the equation: W(x) * (1-0.5/x**2) = XMIN, where
+C W(x) = exp(-x*x)/[x*sqrt(pi)].
+C XHUGE = argument above which 1.0 - 1/(2*x*x) = 1.0 to
+C machine precision. A conservative value is
+C 1/[2*sqrt(XSMALL)]
+C XMAX = largest acceptable argument to ERFCX; the minimum
+C of XINF and 1/[sqrt(pi)*XMIN].
+C
+C Approximate values for some important machines are:
+C
+C XMIN XINF XNEG XSMALL
+C
+C C 7600 (S.P.) 3.13E-294 1.26E+322 -27.220 7.11E-15
+C CRAY-1 (S.P.) 4.58E-2467 5.45E+2465 -75.345 7.11E-15
+C IEEE (IBM/XT,
+C SUN, etc.) (S.P.) 1.18E-38 3.40E+38 -9.382 5.96E-8
+C IEEE (IBM/XT,
+C SUN, etc.) (D.P.) 2.23D-308 1.79D+308 -26.628 1.11D-16
+C IBM 195 (D.P.) 5.40D-79 7.23E+75 -13.190 1.39D-17
+C UNIVAC 1108 (D.P.) 2.78D-309 8.98D+307 -26.615 1.73D-18
+C VAX D-Format (D.P.) 2.94D-39 1.70D+38 -9.345 1.39D-17
+C VAX G-Format (D.P.) 5.56D-309 8.98D+307 -26.615 1.11D-16
+C
+C
+C XBIG XHUGE XMAX
+C
+C C 7600 (S.P.) 25.922 8.39E+6 1.80X+293
+C CRAY-1 (S.P.) 75.326 8.39E+6 5.45E+2465
+C IEEE (IBM/XT,
+C SUN, etc.) (S.P.) 9.194 2.90E+3 4.79E+37
+C IEEE (IBM/XT,
+C SUN, etc.) (D.P.) 26.543 6.71D+7 2.53D+307
+C IBM 195 (D.P.) 13.306 1.90D+8 7.23E+75
+C UNIVAC 1108 (D.P.) 26.582 5.37D+8 8.98D+307
+C VAX D-Format (D.P.) 9.269 1.90D+8 1.70D+38
+C VAX G-Format (D.P.) 26.569 6.71D+7 8.98D+307
+C
+C*******************************************************************
+C*******************************************************************
+C
+C Error returns
+C
+C The program returns ERFC = 0 for ARG .GE. XBIG;
+C
+C ERFCX = XINF for ARG .LT. XNEG;
+C and
+C ERFCX = 0 for ARG .GE. XMAX.
+C
+C
+C Intrinsic functions required are:
+C
+C ABS, AINT, EXP
+C
+C
+C Author: W. J. Cody
+C Mathematics and Computer Science Division
+C Argonne National Laboratory
+C Argonne, IL 60439
+C
+C Latest modification: March 19, 1990
+C Updated to F90 by pab 23.03.2003
+C
+C------------------------------------------------------------------
+ DOUBLE PRECISION, INTENT(IN) :: ARG
+ INTEGER, INTENT(IN) :: JINT
+ DOUBLE PRECISION, INTENT(INOUT):: RESULT
+! Local variables
+ INTEGER :: I
+ DOUBLE PRECISION :: DEL,X,XDEN,XNUM,Y,YSQ
+C------------------------------------------------------------------
+C Mathematical constants
+C------------------------------------------------------------------
+ DOUBLE PRECISION, PARAMETER :: ZERO = 0.0D0
+ DOUBLE PRECISION, PARAMETER :: HALF = 0.05D0
+ DOUBLE PRECISION, PARAMETER :: ONE = 1.0D0
+ DOUBLE PRECISION, PARAMETER :: TWO = 2.0D0
+ DOUBLE PRECISION, PARAMETER :: FOUR = 4.0D0
+ DOUBLE PRECISION, PARAMETER :: SIXTEN = 16.0D0
+ DOUBLE PRECISION, PARAMETER :: SQRPI = 5.6418958354775628695D-1
+ DOUBLE PRECISION, PARAMETER :: THRESH = 0.46875D0
+C------------------------------------------------------------------
+C Machine-dependent constants
+C------------------------------------------------------------------
+ DOUBLE PRECISION, PARAMETER :: XNEG = -26.628D0
+ DOUBLE PRECISION, PARAMETER :: XSMALL = 1.11D-16
+ DOUBLE PRECISION, PARAMETER :: XBIG = 26.543D0
+ DOUBLE PRECISION, PARAMETER :: XHUGE = 6.71D7
+ DOUBLE PRECISION, PARAMETER :: XMAX = 2.53D307
+ DOUBLE PRECISION, PARAMETER :: XINF = 1.79D308
+!---------------------------------------------------------------
+! Coefficents to the rational polynomials
+!--------------------------------------------------------------
+ DOUBLE PRECISION, DIMENSION(5) :: A, Q
+ DOUBLE PRECISION, DIMENSION(4) :: B
+ DOUBLE PRECISION, DIMENSION(9) :: C
+ DOUBLE PRECISION, DIMENSION(8) :: D
+ DOUBLE PRECISION, DIMENSION(6) :: P
+C------------------------------------------------------------------
+C Coefficients for approximation to erf in first interval
+C------------------------------------------------------------------
+ PARAMETER (A = (/ 3.16112374387056560D00,
+ & 1.13864154151050156D02,3.77485237685302021D02,
+ & 3.20937758913846947D03, 1.85777706184603153D-1/))
+ PARAMETER ( B = (/2.36012909523441209D01,2.44024637934444173D02,
+ & 1.28261652607737228D03,2.84423683343917062D03/))
+C------------------------------------------------------------------
+C Coefficients for approximation to erfc in second interval
+C------------------------------------------------------------------
+ PARAMETER ( C=(/5.64188496988670089D-1,8.88314979438837594D0,
+ 1 6.61191906371416295D01,2.98635138197400131D02,
+ 2 8.81952221241769090D02,1.71204761263407058D03,
+ 3 2.05107837782607147D03,1.23033935479799725D03,
+ 4 2.15311535474403846D-8/))
+ PARAMETER ( D =(/1.57449261107098347D01,1.17693950891312499D02,
+ 1 5.37181101862009858D02,1.62138957456669019D03,
+ 2 3.29079923573345963D03,4.36261909014324716D03,
+ 3 3.43936767414372164D03,1.23033935480374942D03/))
+C------------------------------------------------------------------
+C Coefficients for approximation to erfc in third interval
+C------------------------------------------------------------------
+ PARAMETER ( P =(/3.05326634961232344D-1,3.60344899949804439D-1,
+ 1 1.25781726111229246D-1,1.60837851487422766D-2,
+ 2 6.58749161529837803D-4,1.63153871373020978D-2/))
+ PARAMETER (Q =(/2.56852019228982242D00,1.87295284992346047D00,
+ 1 5.27905102951428412D-1,6.05183413124413191D-2,
+ 2 2.33520497626869185D-3/))
+C------------------------------------------------------------------
+ X = ARG
+ Y = ABS(X)
+ IF (Y .LE. THRESH) THEN
+C------------------------------------------------------------------
+C Evaluate erf for |X| <= 0.46875
+C------------------------------------------------------------------
+ !YSQ = ZERO
+ IF (Y .GT. XSMALL) THEN
+ YSQ = Y * Y
+ XNUM = A(5)*YSQ
+ XDEN = YSQ
+ DO I = 1, 3
+ XNUM = (XNUM + A(I)) * YSQ
+ XDEN = (XDEN + B(I)) * YSQ
+ END DO
+ RESULT = X * (XNUM + A(4)) / (XDEN + B(4))
+ ELSE
+ RESULT = X * A(4) / B(4)
+ ENDIF
+ IF (JINT .NE. 0) RESULT = ONE - RESULT
+ IF (JINT .EQ. 2) RESULT = EXP(YSQ) * RESULT
+ GO TO 800
+C------------------------------------------------------------------
+C Evaluate erfc for 0.46875 <= |X| <= 4.0
+C------------------------------------------------------------------
+ ELSE IF (Y .LE. FOUR) THEN
+ XNUM = C(9)*Y
+ XDEN = Y
+ DO I = 1, 7
+ XNUM = (XNUM + C(I)) * Y
+ XDEN = (XDEN + D(I)) * Y
+ END DO
+ RESULT = (XNUM + C(8)) / (XDEN + D(8))
+ IF (JINT .NE. 2) THEN
+ YSQ = AINT(Y*SIXTEN)/SIXTEN
+ DEL = (Y-YSQ)*(Y+YSQ)
+ RESULT = EXP(-YSQ*YSQ) * EXP(-DEL) * RESULT
+ END IF
+C------------------------------------------------------------------
+C Evaluate erfc for |X| > 4.0
+C------------------------------------------------------------------
+ ELSE
+ RESULT = ZERO
+ IF (Y .GE. XBIG) THEN
+ IF ((JINT .NE. 2) .OR. (Y .GE. XMAX)) GO TO 300
+ IF (Y .GE. XHUGE) THEN
+ RESULT = SQRPI / Y
+ GO TO 300
+ END IF
+ END IF
+ YSQ = ONE / (Y * Y)
+ XNUM = P(6)*YSQ
+ XDEN = YSQ
+ DO I = 1, 4
+ XNUM = (XNUM + P(I)) * YSQ
+ XDEN = (XDEN + Q(I)) * YSQ
+ ENDDO
+ RESULT = YSQ *(XNUM + P(5)) / (XDEN + Q(5))
+ RESULT = (SQRPI - RESULT) / Y
+ IF (JINT .NE. 2) THEN
+ YSQ = AINT(Y*SIXTEN)/SIXTEN
+ DEL = (Y-YSQ)*(Y+YSQ)
+ RESULT = EXP(-YSQ*YSQ) * EXP(-DEL) * RESULT
+ END IF
+ END IF
+C------------------------------------------------------------------
+C Fix up for negative argument, erf, etc.
+C------------------------------------------------------------------
+ 300 IF (JINT .EQ. 0) THEN
+ RESULT = (HALF - RESULT) + HALF
+ IF (X .LT. ZERO) RESULT = -RESULT
+ ELSE IF (JINT .EQ. 1) THEN
+ IF (X .LT. ZERO) RESULT = TWO - RESULT
+ ELSE
+ IF (X .LT. ZERO) THEN
+ IF (X .LT. XNEG) THEN
+ RESULT = XINF
+ ELSE
+ YSQ = AINT(X*SIXTEN)/SIXTEN
+ DEL = (X-YSQ)*(X+YSQ)
+ Y = EXP(YSQ*YSQ) * EXP(DEL)
+ RESULT = (Y+Y) - RESULT
+ END IF
+ END IF
+ END IF
+ 800 RETURN
+ END SUBROUTINE CALERF
+ FUNCTION FIINV(P) RESULT (VAL)
+ IMPLICIT NONE
+*
+* ALGORITHM AS241 APPL. STATIST. (1988) VOL. 37, NO. 3
+*
+* Produces the normal deviate Z corresponding to a given lower
+* tail area of P.
+* Absolute error less than 1e-13
+* Relative error less than 1e-15 for abs(VAL)>0.1
+*
+* The hash sums below are the sums of the mantissas of the
+* coefficients. They are included for use in checking
+* transcription.
+*
+ DOUBLE PRECISION, INTENT(in) :: P
+ DOUBLE PRECISION :: VAL
+!local variables
+ DOUBLE PRECISION SPLIT1, SPLIT2, CONST1, CONST2, ONE, ZERO, HALF,
+ & A0, A1, A2, A3, A4, A5, A6, A7, B1, B2, B3, B4, B5, B6, B7,
+ & C0, C1, C2, C3, C4, C5, C6, C7, D1, D2, D3, D4, D5, D6, D7,
+ & E0, E1, E2, E3, E4, E5, E6, E7, F1, F2, F3, F4, F5, F6, F7,
+ & Q, R
+ PARAMETER ( SPLIT1 = 0.425D0, SPLIT2 = 5.D0,
+ & CONST1 = 0.180625D0, CONST2 = 1.6D0,
+ & ONE = 1.D0, ZERO = 0.D0, HALF = 0.5D0 )
+*
+* Coefficients for P close to 0.5
+*
+ PARAMETER (
+ * A0 = 3.38713 28727 96366 6080D0,
+ * A1 = 1.33141 66789 17843 7745D+2,
+ * A2 = 1.97159 09503 06551 4427D+3,
+ * A3 = 1.37316 93765 50946 1125D+4,
+ * A4 = 4.59219 53931 54987 1457D+4,
+ * A5 = 6.72657 70927 00870 0853D+4,
+ * A6 = 3.34305 75583 58812 8105D+4,
+ * A7 = 2.50908 09287 30122 6727D+3,
+ * B1 = 4.23133 30701 60091 1252D+1,
+ * B2 = 6.87187 00749 20579 0830D+2,
+ * B3 = 5.39419 60214 24751 1077D+3,
+ * B4 = 2.12137 94301 58659 5867D+4,
+ * B5 = 3.93078 95800 09271 0610D+4,
+ * B6 = 2.87290 85735 72194 2674D+4,
+ * B7 = 5.22649 52788 52854 5610D+3 )
+* HASH SUM AB 55.88319 28806 14901 4439
+*
+* Coefficients for P not close to 0, 0.5 or 1.
+*
+ PARAMETER (
+ * C0 = 1.42343 71107 49683 57734D0,
+ * C1 = 4.63033 78461 56545 29590D0,
+ * C2 = 5.76949 72214 60691 40550D0,
+ * C3 = 3.64784 83247 63204 60504D0,
+ * C4 = 1.27045 82524 52368 38258D0,
+ * C5 = 2.41780 72517 74506 11770D-1,
+ * C6 = 2.27238 44989 26918 45833D-2,
+ * C7 = 7.74545 01427 83414 07640D-4,
+ * D1 = 2.05319 16266 37758 82187D0,
+ * D2 = 1.67638 48301 83803 84940D0,
+ * D3 = 6.89767 33498 51000 04550D-1,
+ * D4 = 1.48103 97642 74800 74590D-1,
+ * D5 = 1.51986 66563 61645 71966D-2,
+ * D6 = 5.47593 80849 95344 94600D-4,
+ * D7 = 1.05075 00716 44416 84324D-9 )
+* HASH SUM CD 49.33206 50330 16102 89036
+*
+* Coefficients for P near 0 or 1.
+*
+ PARAMETER (
+ * E0 = 6.65790 46435 01103 77720D0,
+ * E1 = 5.46378 49111 64114 36990D0,
+ * E2 = 1.78482 65399 17291 33580D0,
+ * E3 = 2.96560 57182 85048 91230D-1,
+ * E4 = 2.65321 89526 57612 30930D-2,
+ * E5 = 1.24266 09473 88078 43860D-3,
+ * E6 = 2.71155 55687 43487 57815D-5,
+ * E7 = 2.01033 43992 92288 13265D-7,
+ * F1 = 5.99832 20655 58879 37690D-1,
+ * F2 = 1.36929 88092 27358 05310D-1,
+ * F3 = 1.48753 61290 85061 48525D-2,
+ * F4 = 7.86869 13114 56132 59100D-4,
+ * F5 = 1.84631 83175 10054 68180D-5,
+ * F6 = 1.42151 17583 16445 88870D-7,
+ * F7 = 2.04426 31033 89939 78564D-15 )
+* HASH SUM EF 47.52583 31754 92896 71629
+*
+ Q = ( P - HALF)
+ IF ( ABS(Q) .LE. SPLIT1 ) THEN ! Central range.
+ R = CONST1 - Q*Q
+ VAL = Q*( ( ( ((((A7*R + A6)*R + A5)*R + A4)*R + A3)
+ * *R + A2 )*R + A1 )*R + A0 )
+ * /( ( ( ((((B7*R + B6)*R + B5)*R + B4)*R + B3)
+ * *R + B2 )*R + B1 )*R + ONE)
+ ELSE ! near the endpoints
+ R = MIN( P, ONE - P )
+ IF (R .GT.ZERO) THEN ! ( 2.d0*R .GT. CFxCutOff) THEN ! R .GT.0.d0
+ R = SQRT( -LOG(R) )
+ IF ( R .LE. SPLIT2 ) THEN
+ R = R - CONST2
+ VAL = ( ( ( ((((C7*R + C6)*R + C5)*R + C4)*R + C3)
+ * *R + C2 )*R + C1 )*R + C0 )
+ * /( ( ( ((((D7*R + D6)*R + D5)*R + D4)*R + D3)
+ * *R + D2 )*R + D1 )*R + ONE )
+ ELSE
+ R = R - SPLIT2
+ VAL = ( ( ( ((((E7*R + E6)*R + E5)*R + E4)*R + E3)
+ * *R + E2 )*R + E1 )*R + E0 )
+ * /( ( ( ((((F7*R + F6)*R + F5)*R + F4)*R + F3)
+ * *R + F2 )*R + F1 )*R + ONE )
+ END IF
+ ELSE
+ VAL = 37.D0 !XMAX 9.d0
+ END IF
+ IF ( Q < ZERO ) VAL = - VAL
+ END IF
+ RETURN
+ END FUNCTION FIINV
+ FUNCTION FI2( Z ) RESULT (VALUE)
+! USE GLOBALDATA, ONLY : XMAX
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(in) :: Z
+ DOUBLE PRECISION :: VALUE
+*
+* Normal distribution probabilities accurate to 1.e-15.
+* relative error less than 1e-8;
+* Z = no. of standard deviations from the mean.
+*
+* Based upon algorithm 5666 for the error function, from:
+* Hart, J.F. et al, 'Computer Approximations', Wiley 1968
+*
+* Programmer: Alan Miller
+*
+* Latest revision - 30 March 1986
+*
+ DOUBLE PRECISION :: P0, P1, P2, P3, P4, P5, P6,
+ * Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7,XMAX,
+ * P, EXPNTL, CUTOFF, ROOTPI, ZABS, Z2
+ PARAMETER(
+ * P0 = 220.20 68679 12376 1D0,
+ * P1 = 221.21 35961 69931 1D0,
+ * P2 = 112.07 92914 97870 9D0,
+ * P3 = 33.912 86607 83830 0D0,
+ * P4 = 6.3739 62203 53165 0D0,
+ * P5 = 0.70038 30644 43688 1D0,
+ * P6 = 0.035262 49659 98910 9D0 )
+ PARAMETER(
+ * Q0 = 440.41 37358 24752 2D0,
+ * Q1 = 793.82 65125 19948 4D0,
+ * Q2 = 637.33 36333 78831 1D0,
+ * Q3 = 296.56 42487 79673 7D0,
+ * Q4 = 86.780 73220 29460 8D0,
+ * Q5 = 16.064 17757 92069 5D0,
+ * Q6 = 1.7556 67163 18264 2D0,
+ * Q7 = 0.088388 34764 83184 4D0 )
+ PARAMETER( ROOTPI = 2.5066 28274 63100 1D0 )
+ PARAMETER( CUTOFF = 7.0710 67811 86547 5D0 )
+ PARAMETER( XMAX = 8.25D0 )
+*
+ ZABS = ABS(Z)
+*
+* |Z| > 37 (or XMAX)
+*
+ IF ( ZABS .GT. XMAX ) THEN
+ P = 0.d0
+ ELSE
+*
+* |Z| <= 37
+*
+ Z2 = ZABS * ZABS
+ EXPNTL = EXP( -Z2 * 0.5D0 )
+*
+* |Z| < CUTOFF = 10/SQRT(2)
+*
+ IF ( ZABS < CUTOFF ) THEN
+ P = EXPNTL*( (((((P6*ZABS + P5)*ZABS + P4)*ZABS + P3)*ZABS
+ * + P2)*ZABS + P1)*ZABS + P0)/(((((((Q7*ZABS + Q6)*ZABS
+ * + Q5)*ZABS + Q4)*ZABS + Q3)*ZABS + Q2)*ZABS + Q1)*ZABS
+ * + Q0 )
+*
+* |Z| >= CUTOFF.
+*
+ ELSE
+ P = EXPNTL/( ZABS + 1.d0/( ZABS + 2.d0/( ZABS + 3.d0/( ZABS
+ * + 4.d0/( ZABS + 0.65D0 ) ) ) ) )/ROOTPI
+ END IF
+ END IF
+ IF ( Z .GT. 0.d0 ) P = 1.d0 - P
+ VALUE = P
+ RETURN
+ END FUNCTION FI2
+
+ FUNCTION FI( Z ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(in) :: Z
+ DOUBLE PRECISION :: VALUE
+! Local variables
+ DOUBLE PRECISION, PARAMETER:: SQ2M1 = 0.70710678118655D0 ! 1/SQRT(2)
+ DOUBLE PRECISION, PARAMETER:: HALF = 0.5D0
+ VALUE = DERFC(-Z*SQ2M1)*HALF
+ RETURN
+ END FUNCTION FI
\ No newline at end of file
diff --git a/src/wafo/source/old/erfcore.pyd b/src/wafo/source/old/erfcore.pyd
new file mode 100644
index 0000000..9b10fb5
Binary files /dev/null and b/src/wafo/source/old/erfcore.pyd differ
diff --git a/src/wafo/source/old/erfcore.pydold b/src/wafo/source/old/erfcore.pydold
new file mode 100644
index 0000000..c946776
Binary files /dev/null and b/src/wafo/source/old/erfcore.pydold differ
diff --git a/src/wafo/source/old/erfcore.pyf b/src/wafo/source/old/erfcore.pyf
new file mode 100644
index 0000000..e84f3cd
--- /dev/null
+++ b/src/wafo/source/old/erfcore.pyf
@@ -0,0 +1,39 @@
+! -*- f90 -*-
+! Note: the context of this file is case sensitive.
+
+python module erfcore ! in
+ interface ! in :erfcore
+ function derf(x) result (value) ! in :erfcore:erfcore.f
+ double precision intent(in) :: x
+ double precision :: value
+ end function derf
+ function derfc(x) result (value) ! in :erfcore:erfcore.f
+ double precision intent(in) :: x
+ double precision :: value
+ end function derfc
+ function derfcx(x) result (value) ! in :erfcore:erfcore.f
+ double precision intent(in) :: x
+ double precision :: value
+ end function derfcx
+ subroutine calerf(arg,result,jint) ! in :erfcore:erfcore.f
+ double precision intent(in) :: arg
+ double precision intent(inout) :: result
+ integer intent(in) :: jint
+ end subroutine calerf
+ function fiinv(p) result (val) ! in :erfcore:erfcore.f
+ double precision intent(in) :: p
+ double precision :: val
+ end function fiinv
+ function fi2(z) result (value) ! in :erfcore:erfcore.f
+ double precision intent(in) :: z
+ double precision :: value
+ end function fi2
+ function fi(z) result (value) ! in :erfcore:erfcore.f
+ double precision intent(in) :: z
+ double precision :: value
+ end function fi
+ end interface
+end python module erfcore
+
+! This file was auto-generated with f2py (version:2_5972).
+! See http://cens.ioc.ee/projects/f2py2e/
diff --git a/src/wafo/source/old/erfcoremod.f b/src/wafo/source/old/erfcoremod.f
new file mode 100644
index 0000000..583be61
--- /dev/null
+++ b/src/wafo/source/old/erfcoremod.f
@@ -0,0 +1,346 @@
+C $ f2py -m erfcoremod -h erfcoremod.pyf erfcoremod.f
+C f2py erfcoremod.pyf erfcoremod.f -c --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71
+C $ f2py --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71 -m erfcoremod -c erfcoremod.f
+
+C gfortran -fPIC -c erfcoremod.f
+C f2py -m erfcoremod -c erfcoremod.o erfcoremod_interface.f
+
+ MODULE ERFCOREMOD
+C IMPLICIT NONE
+
+C INTERFACE CALERF
+C MODULE PROCEDURE CALERF
+C END INTERFACE
+
+C INTERFACE DERF
+C MODULE PROCEDURE DERF
+C END INTERFACE
+
+C INTERFACE DERFC
+C MODULE PROCEDURE DERFC
+C END INTERFACE
+
+C INTERFACE DERFCX
+C MODULE PROCEDURE DERFCX
+c END INTERFACE
+ CONTAINS
+C--------------------------------------------------------------------
+C
+C DERF subprogram computes approximate values for erf(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, January 8, 1985
+C
+C--------------------------------------------------------------------
+ FUNCTION DERF( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 0
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERF
+C--------------------------------------------------------------------
+C
+C DERFC subprogram computes approximate values for erfc(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, January 8, 1985
+C
+C--------------------------------------------------------------------
+ FUNCTION DERFC( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 1
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERFC
+C------------------------------------------------------------------
+C
+C DERFCX subprogram computes approximate values for exp(x*x) * erfc(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, March 30, 1987
+C
+C------------------------------------------------------------------
+ FUNCTION DERFCX( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 2
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERFCX
+
+ SUBROUTINE CALERF(ARG,RESULT,JINT)
+ IMPLICIT NONE
+C------------------------------------------------------------------
+C
+C CALERF packet evaluates erf(x), erfc(x), and exp(x*x)*erfc(x)
+C for a real argument x. It contains three FUNCTION type
+C subprograms: ERF, ERFC, and ERFCX (or DERF, DERFC, and DERFCX),
+C and one SUBROUTINE type subprogram, CALERF. The calling
+C statements for the primary entries are:
+C
+C Y=ERF(X) (or Y=DERF(X)),
+C
+C Y=ERFC(X) (or Y=DERFC(X)),
+C and
+C Y=ERFCX(X) (or Y=DERFCX(X)).
+C
+C The routine CALERF is intended for internal packet use only,
+C all computations within the packet being concentrated in this
+C routine. The function subprograms invoke CALERF with the
+C statement
+C
+C CALL CALERF(ARG,RESULT,JINT)
+C
+C where the parameter usage is as follows
+C
+C Function Parameters for CALERF
+C call ARG Result JINT
+C
+C ERF(ARG) ANY REAL ARGUMENT ERF(ARG) 0
+C ERFC(ARG) ABS(ARG) .LT. XBIG ERFC(ARG) 1
+C ERFCX(ARG) XNEG .LT. ARG .LT. XMAX ERFCX(ARG) 2
+C
+C The main computation evaluates near-minimax approximations
+C from "Rational Chebyshev approximations for the error function"
+C by W. J. Cody, Math. Comp., 1969, PP. 631-638. This
+C transportable program uses rational functions that theoretically
+C approximate erf(x) and erfc(x) to at least 18 significant
+C decimal digits. The accuracy achieved depends on the arithmetic
+C system, the compiler, the intrinsic functions, and proper
+C selection of the machine-dependent constants.
+C
+C*******************************************************************
+C*******************************************************************
+C
+C Explanation of machine-dependent constants
+C
+C XMIN = the smallest positive floating-point number.
+C XINF = the largest positive finite floating-point number.
+C XNEG = the largest negative argument acceptable to ERFCX;
+C the negative of the solution to the equation
+C 2*exp(x*x) = XINF.
+C XSMALL = argument below which erf(x) may be represented by
+C 2*x/sqrt(pi) and above which x*x will not underflow.
+C A conservative value is the largest machine number X
+C such that 1.0 + X = 1.0 to machine precision.
+C XBIG = largest argument acceptable to ERFC; solution to
+C the equation: W(x) * (1-0.5/x**2) = XMIN, where
+C W(x) = exp(-x*x)/[x*sqrt(pi)].
+C XHUGE = argument above which 1.0 - 1/(2*x*x) = 1.0 to
+C machine precision. A conservative value is
+C 1/[2*sqrt(XSMALL)]
+C XMAX = largest acceptable argument to ERFCX; the minimum
+C of XINF and 1/[sqrt(pi)*XMIN].
+C
+C Approximate values for some important machines are:
+C
+C XMIN XINF XNEG XSMALL
+C
+C C 7600 (S.P.) 3.13E-294 1.26E+322 -27.220 7.11E-15
+C CRAY-1 (S.P.) 4.58E-2467 5.45E+2465 -75.345 7.11E-15
+C IEEE (IBM/XT,
+C SUN, etc.) (S.P.) 1.18E-38 3.40E+38 -9.382 5.96E-8
+C IEEE (IBM/XT,
+C SUN, etc.) (D.P.) 2.23D-308 1.79D+308 -26.628 1.11D-16
+C IBM 195 (D.P.) 5.40D-79 7.23E+75 -13.190 1.39D-17
+C UNIVAC 1108 (D.P.) 2.78D-309 8.98D+307 -26.615 1.73D-18
+C VAX D-Format (D.P.) 2.94D-39 1.70D+38 -9.345 1.39D-17
+C VAX G-Format (D.P.) 5.56D-309 8.98D+307 -26.615 1.11D-16
+C
+C
+C XBIG XHUGE XMAX
+C
+C C 7600 (S.P.) 25.922 8.39E+6 1.80X+293
+C CRAY-1 (S.P.) 75.326 8.39E+6 5.45E+2465
+C IEEE (IBM/XT,
+C SUN, etc.) (S.P.) 9.194 2.90E+3 4.79E+37
+C IEEE (IBM/XT,
+C SUN, etc.) (D.P.) 26.543 6.71D+7 2.53D+307
+C IBM 195 (D.P.) 13.306 1.90D+8 7.23E+75
+C UNIVAC 1108 (D.P.) 26.582 5.37D+8 8.98D+307
+C VAX D-Format (D.P.) 9.269 1.90D+8 1.70D+38
+C VAX G-Format (D.P.) 26.569 6.71D+7 8.98D+307
+C
+C*******************************************************************
+C*******************************************************************
+C
+C Error returns
+C
+C The program returns ERFC = 0 for ARG .GE. XBIG;
+C
+C ERFCX = XINF for ARG .LT. XNEG;
+C and
+C ERFCX = 0 for ARG .GE. XMAX.
+C
+C
+C Intrinsic functions required are:
+C
+C ABS, AINT, EXP
+C
+C
+C Author: W. J. Cody
+C Mathematics and Computer Science Division
+C Argonne National Laboratory
+C Argonne, IL 60439
+C
+C Latest modification: March 19, 1990
+C Updated to F90 by pab 23.03.2003
+C
+C------------------------------------------------------------------
+ DOUBLE PRECISION, INTENT(IN) :: ARG
+ INTEGER, INTENT(IN) :: JINT
+ DOUBLE PRECISION, INTENT(INOUT):: RESULT
+! Local variables
+ INTEGER :: I
+ DOUBLE PRECISION :: DEL,X,XDEN,XNUM,Y,YSQ
+C------------------------------------------------------------------
+C Mathematical constants
+C------------------------------------------------------------------
+ DOUBLE PRECISION, PARAMETER :: ZERO = 0.0D0
+ DOUBLE PRECISION, PARAMETER :: HALF = 0.05D0
+ DOUBLE PRECISION, PARAMETER :: ONE = 1.0D0
+ DOUBLE PRECISION, PARAMETER :: TWO = 2.0D0
+ DOUBLE PRECISION, PARAMETER :: FOUR = 4.0D0
+ DOUBLE PRECISION, PARAMETER :: SIXTEN = 16.0D0
+ DOUBLE PRECISION, PARAMETER :: SQRPI = 5.6418958354775628695D-1
+ DOUBLE PRECISION, PARAMETER :: THRESH = 0.46875D0
+C------------------------------------------------------------------
+C Machine-dependent constants
+C------------------------------------------------------------------
+ DOUBLE PRECISION, PARAMETER :: XNEG = -26.628D0
+ DOUBLE PRECISION, PARAMETER :: XSMALL = 1.11D-16
+ DOUBLE PRECISION, PARAMETER :: XBIG = 26.543D0
+ DOUBLE PRECISION, PARAMETER :: XHUGE = 6.71D7
+ DOUBLE PRECISION, PARAMETER :: XMAX = 2.53D307
+ DOUBLE PRECISION, PARAMETER :: XINF = 1.79D308
+!---------------------------------------------------------------
+! Coefficents to the rational polynomials
+!--------------------------------------------------------------
+ DOUBLE PRECISION, DIMENSION(5) :: A, Q
+ DOUBLE PRECISION, DIMENSION(4) :: B
+ DOUBLE PRECISION, DIMENSION(9) :: C
+ DOUBLE PRECISION, DIMENSION(8) :: D
+ DOUBLE PRECISION, DIMENSION(6) :: P
+C------------------------------------------------------------------
+C Coefficients for approximation to erf in first interval
+C------------------------------------------------------------------
+ PARAMETER (A = (/ 3.16112374387056560D00,
+ & 1.13864154151050156D02,3.77485237685302021D02,
+ & 3.20937758913846947D03, 1.85777706184603153D-1/))
+ PARAMETER ( B = (/2.36012909523441209D01,2.44024637934444173D02,
+ & 1.28261652607737228D03,2.84423683343917062D03/))
+C------------------------------------------------------------------
+C Coefficients for approximation to erfc in second interval
+C------------------------------------------------------------------
+ PARAMETER ( C=(/5.64188496988670089D-1,8.88314979438837594D0,
+ 1 6.61191906371416295D01,2.98635138197400131D02,
+ 2 8.81952221241769090D02,1.71204761263407058D03,
+ 3 2.05107837782607147D03,1.23033935479799725D03,
+ 4 2.15311535474403846D-8/))
+ PARAMETER ( D =(/1.57449261107098347D01,1.17693950891312499D02,
+ 1 5.37181101862009858D02,1.62138957456669019D03,
+ 2 3.29079923573345963D03,4.36261909014324716D03,
+ 3 3.43936767414372164D03,1.23033935480374942D03/))
+C------------------------------------------------------------------
+C Coefficients for approximation to erfc in third interval
+C------------------------------------------------------------------
+ PARAMETER ( P =(/3.05326634961232344D-1,3.60344899949804439D-1,
+ 1 1.25781726111229246D-1,1.60837851487422766D-2,
+ 2 6.58749161529837803D-4,1.63153871373020978D-2/))
+ PARAMETER (Q =(/2.56852019228982242D00,1.87295284992346047D00,
+ 1 5.27905102951428412D-1,6.05183413124413191D-2,
+ 2 2.33520497626869185D-3/))
+C------------------------------------------------------------------
+ X = ARG
+ Y = ABS(X)
+ IF (Y .LE. THRESH) THEN
+C------------------------------------------------------------------
+C Evaluate erf for |X| <= 0.46875
+C------------------------------------------------------------------
+ !YSQ = ZERO
+ IF (Y .GT. XSMALL) THEN
+ YSQ = Y * Y
+ XNUM = A(5)*YSQ
+ XDEN = YSQ
+ DO I = 1, 3
+ XNUM = (XNUM + A(I)) * YSQ
+ XDEN = (XDEN + B(I)) * YSQ
+ END DO
+ RESULT = X * (XNUM + A(4)) / (XDEN + B(4))
+ ELSE
+ RESULT = X * A(4) / B(4)
+ ENDIF
+ IF (JINT .NE. 0) RESULT = ONE - RESULT
+ IF (JINT .EQ. 2) RESULT = EXP(YSQ) * RESULT
+ GO TO 800
+C------------------------------------------------------------------
+C Evaluate erfc for 0.46875 <= |X| <= 4.0
+C------------------------------------------------------------------
+ ELSE IF (Y .LE. FOUR) THEN
+ XNUM = C(9)*Y
+ XDEN = Y
+ DO I = 1, 7
+ XNUM = (XNUM + C(I)) * Y
+ XDEN = (XDEN + D(I)) * Y
+ END DO
+ RESULT = (XNUM + C(8)) / (XDEN + D(8))
+ IF (JINT .NE. 2) THEN
+ YSQ = AINT(Y*SIXTEN)/SIXTEN
+ DEL = (Y-YSQ)*(Y+YSQ)
+ RESULT = EXP(-YSQ*YSQ) * EXP(-DEL) * RESULT
+ END IF
+C------------------------------------------------------------------
+C Evaluate erfc for |X| > 4.0
+C------------------------------------------------------------------
+ ELSE
+ RESULT = ZERO
+ IF (Y .GE. XBIG) THEN
+ IF ((JINT .NE. 2) .OR. (Y .GE. XMAX)) GO TO 300
+ IF (Y .GE. XHUGE) THEN
+ RESULT = SQRPI / Y
+ GO TO 300
+ END IF
+ END IF
+ YSQ = ONE / (Y * Y)
+ XNUM = P(6)*YSQ
+ XDEN = YSQ
+ DO I = 1, 4
+ XNUM = (XNUM + P(I)) * YSQ
+ XDEN = (XDEN + Q(I)) * YSQ
+ ENDDO
+ RESULT = YSQ *(XNUM + P(5)) / (XDEN + Q(5))
+ RESULT = (SQRPI - RESULT) / Y
+ IF (JINT .NE. 2) THEN
+ YSQ = AINT(Y*SIXTEN)/SIXTEN
+ DEL = (Y-YSQ)*(Y+YSQ)
+ RESULT = EXP(-YSQ*YSQ) * EXP(-DEL) * RESULT
+ END IF
+ END IF
+C------------------------------------------------------------------
+C Fix up for negative argument, erf, etc.
+C------------------------------------------------------------------
+ 300 IF (JINT .EQ. 0) THEN
+ RESULT = (HALF - RESULT) + HALF
+ IF (X .LT. ZERO) RESULT = -RESULT
+ ELSE IF (JINT .EQ. 1) THEN
+ IF (X .LT. ZERO) RESULT = TWO - RESULT
+ ELSE
+ IF (X .LT. ZERO) THEN
+ IF (X .LT. XNEG) THEN
+ RESULT = XINF
+ ELSE
+ YSQ = AINT(X*SIXTEN)/SIXTEN
+ DEL = (X-YSQ)*(X+YSQ)
+ Y = EXP(YSQ*YSQ) * EXP(DEL)
+ RESULT = (Y+Y) - RESULT
+ END IF
+ END IF
+ END IF
+ 800 RETURN
+ END SUBROUTINE CALERF
+ END MODULE ERFCOREMOD
diff --git a/src/wafo/source/old/erfcoremod.f90 b/src/wafo/source/old/erfcoremod.f90
new file mode 100644
index 0000000..3ecb6d4
--- /dev/null
+++ b/src/wafo/source/old/erfcoremod.f90
@@ -0,0 +1,346 @@
+!C $ f2py -m erf!Coremod -h erf!Coremod.pyf erf!Coremod.f
+!C f2py erf!Coremod.pyf erf!Coremod.f -!C --f!Compiler=gnu95 --!Compiler=mingw32 -lmsv!Cr71
+!C $ f2py --f!Compiler=gnu95 --!Compiler=mingw32 -lmsv!Cr71 -m erf!Coremod -!C erf!Coremod.f
+
+!C gfortran -fPI!C -!C erf!Coremod.f
+!C f2py -m erf!Coremod -DUPPER!CASE_FORTRAN -!C erf!Coremod.o erf!Coremod_interfa!Ce.f
+
+ MODULE ERFCOREMOD
+!C IMPLI!CIT NONE
+
+!C INTERFA!CE !CALERF
+!C MODULE PRO!CEDURE !CALERF
+!C END INTERFA!CE
+
+!C INTERFA!CE DERF
+!C MODULE PRO!CEDURE DERF
+!C END INTERFA!CE
+
+!C INTERFA!CE DERF!C
+!C MODULE PRO!CEDURE DERF!C
+!C END INTERFA!CE
+
+!C INTERFA!CE DERF!CX
+!C MODULE PRO!CEDURE DERF!CX
+!C END INTERFA!CE
+ CONTAINS
+!C--------------------------------------------------------------------
+!C
+!C DERF subprogram !Computes approximate values for erf(x).
+!C (see !Comments heading !CALERF).
+!C
+!C Author/date: W. J. !Cody, January 8, 1985
+!C
+!C--------------------------------------------------------------------
+ FUNCTION DERF( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 0
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERF
+!C--------------------------------------------------------------------
+!C
+!C DERF!C subprogram !Computes approximate values for erf!C(x).
+!C (see !Comments heading !CALERF).
+!C
+!C Author/date: W. J. !Cody, January 8, 1985
+!C
+!C--------------------------------------------------------------------
+ FUNCTION DERFC( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 1
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERFC
+!C------------------------------------------------------------------
+!C
+!C DERFCX subprogram Computes approximate values for exp(x*x) * erfC(x).
+!C (see !Comments heading !CALERF).
+!C
+!C Author/date: W. J. !Cody, Mar!Ch 30, 1987
+!C
+!C------------------------------------------------------------------
+ FUNCTION DERFCX( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 2
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERFCX
+
+ SUBROUTINE CALERF(ARG,RESULT,JINT)
+ IMPLICIT NONE
+!C------------------------------------------------------------------
+!C
+!C !CALERF pa!Cket evaluates erf(x), erf!C(x), and exp(x*x)*erf!C(x)
+!C for a real argument x. It !Contains three FUN!CTION type
+!C subprograms: ERF, ERF!C, and ERF!CX (or DERF, DERF!C, and DERF!CX),
+!C and one SUBROUTINE type subprogram, !CALERF. The !Calling
+!C statements for the primary entries are:
+!C
+!C Y=ERF(X) (or Y=DERF(X)),
+!C
+!C Y=ERF!C(X) (or Y=DERF!C(X)),
+!C and
+!C Y=ERF!CX(X) (or Y=DERF!CX(X)).
+!C
+!C The routine !CALERF is intended for internal pa!Cket use only,
+!C all !Computations within the pa!Cket being !Con!Centrated in this
+!C routine. The fun!Ction subprograms invoke !CALERF with the
+!C statement
+!C
+!C !CALL !CALERF(ARG,RESULT,JINT)
+!C
+!C where the parameter usage is as follows
+!C
+!C Fun!Ction Parameters for !CALERF
+!C !Call ARG Result JINT
+!C
+!C ERF(ARG) ANY REAL ARGUMENT ERF(ARG) 0
+!C ERF!C(ARG) ABS(ARG) .LT. XBIG ERF!C(ARG) 1
+!C ERF!CX(ARG) XNEG .LT. ARG .LT. XMAX ERF!CX(ARG) 2
+!C
+!C The main !Computation evaluates near-minimax approximations
+!C from "Rational !Chebyshev approximations for the error fun!Ction"
+!C by W. J. !Cody, Math. !Comp., 1969, PP. 631-638. This
+!C transportable program uses rational fun!Ctions that theoreti!Cally
+!C approximate erf(x) and erf!C(x) to at least 18 signifi!Cant
+!C de!Cimal digits. The a!C!Cura!Cy a!Chieved depends on the arithmeti!C
+!C system, the !Compiler, the intrinsi!C fun!Ctions, and proper
+!C sele!Ction of the ma!Chine-dependent !Constants.
+!C
+!C*******************************************************************
+!C*******************************************************************
+!C
+!C Explanation of ma!Chine-dependent !Constants
+!C
+!C XMIN = the smallest positive floating-point number.
+!C XINF = the largest positive finite floating-point number.
+!C XNEG = the largest negative argument a!C!Ceptable to ERF!CX;
+!C the negative of the solution to the equation
+!C 2*exp(x*x) = XINF.
+!C XSMALL = argument below whi!Ch erf(x) may be represented by
+!C 2*x/sqrt(pi) and above whi!Ch x*x will not underflow.
+!C A !Conservative value is the largest ma!Chine number X
+!C su!Ch that 1.0 + X = 1.0 to ma!Chine pre!Cision.
+!C XBIG = largest argument a!C!Ceptable to ERF!C; solution to
+!C the equation: W(x) * (1-0.5/x**2) = XMIN, where
+!C W(x) = exp(-x*x)/[x*sqrt(pi)].
+!C XHUGE = argument above whi!Ch 1.0 - 1/(2*x*x) = 1.0 to
+!C ma!Chine pre!Cision. A !Conservative value is
+!C 1/[2*sqrt(XSMALL)]
+!C XMAX = largest a!C!Ceptable argument to ERF!CX; the minimum
+!C of XINF and 1/[sqrt(pi)*XMIN].
+!C
+!C Approximate values for some important ma!Chines are:
+!C
+!C XMIN XINF XNEG XSMALL
+!C
+!C !C 7600 (S.P.) 3.13E-294 1.26E+322 -27.220 7.11E-15
+!C !CRAY-1 (S.P.) 4.58E-2467 5.45E+2465 -75.345 7.11E-15
+!C IEEE (IBM/XT,
+!C SUN, et!C.) (S.P.) 1.18E-38 3.40E+38 -9.382 5.96E-8
+!C IEEE (IBM/XT,
+!C SUN, et!C.) (D.P.) 2.23D-308 1.79D+308 -26.628 1.11D-16
+!C IBM 195 (D.P.) 5.40D-79 7.23E+75 -13.190 1.39D-17
+!C UNIVA!C 1108 (D.P.) 2.78D-309 8.98D+307 -26.615 1.73D-18
+!C VAX D-Format (D.P.) 2.94D-39 1.70D+38 -9.345 1.39D-17
+!C VAX G-Format (D.P.) 5.56D-309 8.98D+307 -26.615 1.11D-16
+!C
+!C
+!C XBIG XHUGE XMAX
+!C
+!C !C 7600 (S.P.) 25.922 8.39E+6 1.80X+293
+!C !CRAY-1 (S.P.) 75.326 8.39E+6 5.45E+2465
+!C IEEE (IBM/XT,
+!C SUN, et!C.) (S.P.) 9.194 2.90E+3 4.79E+37
+!C IEEE (IBM/XT,
+!C SUN, et!C.) (D.P.) 26.543 6.71D+7 2.53D+307
+!C IBM 195 (D.P.) 13.306 1.90D+8 7.23E+75
+!C UNIVA!C 1108 (D.P.) 26.582 5.37D+8 8.98D+307
+!C VAX D-Format (D.P.) 9.269 1.90D+8 1.70D+38
+!C VAX G-Format (D.P.) 26.569 6.71D+7 8.98D+307
+!C
+!C*******************************************************************
+!C*******************************************************************
+!C
+!C Error returns
+!C
+!C The program returns ERF!C = 0 for ARG .GE. XBIG;
+!C
+!C ERF!CX = XINF for ARG .LT. XNEG;
+!C and
+!C ERF!CX = 0 for ARG .GE. XMAX.
+!C
+!C
+!C Intrinsi!C funCtions required are:
+!C
+!C ABS, AINT, EXP
+!C
+!C
+!C Author: W. J. Cody
+!C MathematiCs and Computer SCienCe Division
+!C Argonne National Laboratory
+!C Argonne, IL 60439
+!C
+!C Latest modifiCation: MarCh 19, 1990
+!C Updated to F90 by pab 23.03.2003
+!C
+!C------------------------------------------------------------------
+ DOUBLE PRECISION, INTENT(IN) :: ARG
+ INTEGER, INTENT(IN) :: JINT
+ DOUBLE PRECISION, INTENT(INOUT):: RESULT
+! Lo!Cal variables
+ INTEGER :: I
+ DOUBLE PRECISION :: DEL,X,XDEN,XNUM,Y,YSQ
+!C------------------------------------------------------------------
+!C MathematiCal Constants
+!C------------------------------------------------------------------
+ DOUBLE PRECISION, PARAMETER :: ZERO = 0.0D0
+ DOUBLE PRECISION, PARAMETER :: HALF = 0.05D0
+ DOUBLE PRECISION, PARAMETER :: ONE = 1.0D0
+ DOUBLE PRECISION, PARAMETER :: TWO = 2.0D0
+ DOUBLE PRECISION, PARAMETER :: FOUR = 4.0D0
+ DOUBLE PRECISION, PARAMETER :: SIXTEN = 16.0D0
+ DOUBLE PRECISION, PARAMETER :: SQRPI = 5.6418958354775628695D-1
+ DOUBLE PRECISION, PARAMETER :: THRESH = 0.46875D0
+!C------------------------------------------------------------------
+!C MaChine-dependent Constants
+!C------------------------------------------------------------------
+ DOUBLE PRECISION, PARAMETER :: XNEG = -26.628D0
+ DOUBLE PRECISION, PARAMETER :: XSMALL = 1.11D-16
+ DOUBLE PRECISION, PARAMETER :: XBIG = 26.543D0
+ DOUBLE PRECISION, PARAMETER :: XHUGE = 6.71D7
+ DOUBLE PRECISION, PARAMETER :: XMAX = 2.53D307
+ DOUBLE PRECISION, PARAMETER :: XINF = 1.79D308
+!---------------------------------------------------------------
+! !Coeffi!Cents to the rational polynomials
+!--------------------------------------------------------------
+ DOUBLE PRECISION, DIMENSION(5) :: A, Q
+ DOUBLE PRECISION, DIMENSION(4) :: B
+ DOUBLE PRECISION, DIMENSION(9) :: C
+ DOUBLE PRECISION, DIMENSION(8) :: D
+ DOUBLE PRECISION, DIMENSION(6) :: P
+!C------------------------------------------------------------------
+!C !Coeffi!Cients for approximation to erf in first interval
+!C------------------------------------------------------------------
+ PARAMETER (A = (/ 3.16112374387056560D00,
+ & 1.13864154151050156D02,3.77485237685302021D02,
+ & 3.20937758913846947D03, 1.85777706184603153D-1/))
+ PARAMETER ( B = (/2.36012909523441209D01,2.44024637934444173D02,
+ & 1.28261652607737228D03,2.84423683343917062D03/))
+!C------------------------------------------------------------------
+!C CoeffiCients for approximation to erfC in seCond interval
+!C------------------------------------------------------------------
+ PARAMETER ( C=(/5.64188496988670089D-1,8.88314979438837594D0,
+ 1 6.61191906371416295D01,2.98635138197400131D02,
+ 2 8.81952221241769090D02,1.71204761263407058D03,
+ 3 2.05107837782607147D03,1.23033935479799725D03,
+ 4 2.15311535474403846D-8/))
+ PARAMETER ( D =(/1.57449261107098347D01,1.17693950891312499D02,
+ 1 5.37181101862009858D02,1.62138957456669019D03,
+ 2 3.29079923573345963D03,4.36261909014324716D03,
+ 3 3.43936767414372164D03,1.23033935480374942D03/))
+!C------------------------------------------------------------------
+!C !Coeffi!Cients for approximation to erf!C in third interval
+!C------------------------------------------------------------------
+ PARAMETER ( P =(/3.05326634961232344D-1,3.60344899949804439D-1,
+ 1 1.25781726111229246D-1,1.60837851487422766D-2,
+ 2 6.58749161529837803D-4,1.63153871373020978D-2/))
+ PARAMETER (Q =(/2.56852019228982242D00,1.87295284992346047D00,
+ 1 5.27905102951428412D-1,6.05183413124413191D-2,
+ 2 2.33520497626869185D-3/))
+!C------------------------------------------------------------------
+ X = ARG
+ Y = ABS(X)
+ IF (Y .LE. THRESH) THEN
+!C------------------------------------------------------------------
+!C Evaluate erf for |X| <= 0.46875
+!C------------------------------------------------------------------
+ !YSQ = ZERO
+ IF (Y .GT. XSMALL) THEN
+ YSQ = Y * Y
+ XNUM = A(5)*YSQ
+ XDEN = YSQ
+ DO I = 1, 3
+ XNUM = (XNUM + A(I)) * YSQ
+ XDEN = (XDEN + B(I)) * YSQ
+ END DO
+ RESULT = X * (XNUM + A(4)) / (XDEN + B(4))
+ ELSE
+ RESULT = X * A(4) / B(4)
+ ENDIF
+ IF (JINT .NE. 0) RESULT = ONE - RESULT
+ IF (JINT .EQ. 2) RESULT = EXP(YSQ) * RESULT
+ GO TO 800
+!C------------------------------------------------------------------
+!C Evaluate erf!C for 0.46875 <= |X| <= 4.0
+!C------------------------------------------------------------------
+ ELSE IF (Y .LE. FOUR) THEN
+ XNUM = C(9)*Y
+ XDEN = Y
+ DO I = 1, 7
+ XNUM = (XNUM + C(I)) * Y
+ XDEN = (XDEN + D(I)) * Y
+ END DO
+ RESULT = (XNUM + C(8)) / (XDEN + D(8))
+ IF (JINT .NE. 2) THEN
+ YSQ = AINT(Y*SIXTEN)/SIXTEN
+ DEL = (Y-YSQ)*(Y+YSQ)
+ RESULT = EXP(-YSQ*YSQ) * EXP(-DEL) * RESULT
+ END IF
+!C------------------------------------------------------------------
+!C Evaluate erfC for |X| > 4.0
+!C------------------------------------------------------------------
+ ELSE
+ RESULT = ZERO
+ IF (Y .GE. XBIG) THEN
+ IF ((JINT .NE. 2) .OR. (Y .GE. XMAX)) GO TO 300
+ IF (Y .GE. XHUGE) THEN
+ RESULT = SQRPI / Y
+ GO TO 300
+ END IF
+ END IF
+ YSQ = ONE / (Y * Y)
+ XNUM = P(6)*YSQ
+ XDEN = YSQ
+ DO I = 1, 4
+ XNUM = (XNUM + P(I)) * YSQ
+ XDEN = (XDEN + Q(I)) * YSQ
+ ENDDO
+ RESULT = YSQ *(XNUM + P(5)) / (XDEN + Q(5))
+ RESULT = (SQRPI - RESULT) / Y
+ IF (JINT .NE. 2) THEN
+ YSQ = AINT(Y*SIXTEN)/SIXTEN
+ DEL = (Y-YSQ)*(Y+YSQ)
+ RESULT = EXP(-YSQ*YSQ) * EXP(-DEL) * RESULT
+ END IF
+ END IF
+!C------------------------------------------------------------------
+!C Fix up for negative argument, erf, etC.
+!C------------------------------------------------------------------
+ 300 IF (JINT .EQ. 0) THEN
+ RESULT = (HALF - RESULT) + HALF
+ IF (X .LT. ZERO) RESULT = -RESULT
+ ELSE IF (JINT .EQ. 1) THEN
+ IF (X .LT. ZERO) RESULT = TWO - RESULT
+ ELSE
+ IF (X .LT. ZERO) THEN
+ IF (X .LT. XNEG) THEN
+ RESULT = XINF
+ ELSE
+ YSQ = AINT(X*SIXTEN)/SIXTEN
+ DEL = (X-YSQ)*(X+YSQ)
+ Y = EXP(YSQ*YSQ) * EXP(DEL)
+ RESULT = (Y+Y) - RESULT
+ END IF
+ END IF
+ END IF
+ 800 RETURN
+ END SUBROUTINE CALERF
+ END MODULE ERFCOREMOD
diff --git a/src/wafo/source/old/erfcoremod.mod b/src/wafo/source/old/erfcoremod.mod
new file mode 100644
index 0000000..db2e558
--- /dev/null
+++ b/src/wafo/source/old/erfcoremod.mod
@@ -0,0 +1,48 @@
+GFORTRAN module created from erfcoremod.f on Tue Nov 11 11:30:34 2008
+MD5:00cbd9feeb2c79d7d491982c1dc7f04f -- If you edit this, you'll get what you deserve.
+
+(() () () () () () () () () () () () () () () () () () () () () () () ()
+() () ())
+
+()
+
+()
+
+()
+
+()
+
+(2 'calerf' 'erfcoremod' 'calerf' 1 ((PROCEDURE UNKNOWN-INTENT
+MODULE-PROC DECL UNKNOWN SUBROUTINE) (UNKNOWN 0 0 0 UNKNOWN ()) 3 0 (4 5
+6) () 0 () () 0 0)
+7 'derf' 'erfcoremod' 'derf' 1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC
+DECL UNKNOWN FUNCTION) (REAL 8 0 0 REAL ()) 8 0 (9) () 10 () () 0 0)
+11 'derfc' 'erfcoremod' 'derfc' 1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC
+DECL UNKNOWN FUNCTION) (REAL 8 0 0 REAL ()) 12 0 (13) () 14 () () 0 0)
+15 'derfcx' 'erfcoremod' 'derfcx' 1 ((PROCEDURE UNKNOWN-INTENT
+MODULE-PROC DECL UNKNOWN FUNCTION) (REAL 8 0 0 REAL ()) 16 0 (17) () 18
+() () 0 0)
+19 'erfcoremod' 'erfcoremod' 'erfcoremod' 1 ((MODULE UNKNOWN-INTENT
+UNKNOWN-PROC UNKNOWN UNKNOWN) (UNKNOWN 0 0 0 UNKNOWN ()) 0 0 () () 0 ()
+() 0 0)
+9 'x' '' 'x' 8 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (REAL 8
+0 0 REAL ()) 0 0 () () 0 () () 0 0)
+10 'value' '' 'value' 8 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN
+UNKNOWN RESULT) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+13 'x' '' 'x' 12 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+14 'value' '' 'value' 12 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN
+UNKNOWN RESULT) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+17 'x' '' 'x' 16 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+18 'value' '' 'value' 16 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN
+UNKNOWN RESULT) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+4 'arg' '' 'arg' 3 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+5 'result' '' 'result' 3 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+6 'jint' '' 'jint' 3 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+)
+
+('calerf' 0 2 'derf' 0 7 'derfc' 0 11 'derfcx' 0 15 'erfcoremod' 0 19)
diff --git a/src/wafo/source/old/erfcoremod.pyd b/src/wafo/source/old/erfcoremod.pyd
new file mode 100644
index 0000000..df75051
Binary files /dev/null and b/src/wafo/source/old/erfcoremod.pyd differ
diff --git a/src/wafo/source/old/erfcoremod.pyf b/src/wafo/source/old/erfcoremod.pyf
new file mode 100644
index 0000000..07869ab
--- /dev/null
+++ b/src/wafo/source/old/erfcoremod.pyf
@@ -0,0 +1,29 @@
+! -*- f90 -*-
+! Note: the context of this file is case sensitive.
+
+python module erfcoremod ! in
+ interface ! in :erfcoremod
+ module erfcoremod ! in :erfcoremod:erfcoremod.f90
+ function derf(x) result (value) ! in :erfcoremod:erfcoremod.f90:erfcoremod
+ double precision intent(in) :: x
+ double precision :: value
+ end function derf
+ function derfc(x) result (value) ! in :erfcoremod:erfcoremod.f90:erfcoremod
+ double precision intent(in) :: x
+ double precision :: value
+ end function derfc
+ function derfcx(x) result (value) ! in :erfcoremod:erfcoremod.f90:erfcoremod
+ double precision intent(in) :: x
+ double precision :: value
+ end function derfcx
+ subroutine calerf(arg,result,jint) ! in :erfcoremod:erfcoremod.f90:erfcoremod
+ double precision intent(in) :: arg
+ double precision intent(inout) :: result
+ integer intent(in) :: jint
+ end subroutine calerf
+ end module erfcoremod
+ end interface
+end python module erfcoremod
+
+! This file was auto-generated with f2py (version:2_5972).
+! See http://cens.ioc.ee/projects/f2py2e/
diff --git a/src/wafo/source/old/erfcoremod.pyfold b/src/wafo/source/old/erfcoremod.pyfold
new file mode 100644
index 0000000..02b4929
--- /dev/null
+++ b/src/wafo/source/old/erfcoremod.pyfold
@@ -0,0 +1,27 @@
+! -*- f90 -*-
+! Note: the context of this file is case sensitive.
+
+python module erfcoremod ! in
+ interface ! in :erfcoremod
+ function derf(x) result (value) ! in :erfcoremod:erfcoremod.f
+ double precision intent(in) :: x
+ double precision :: value
+ end function derf
+ function derfc(x) result (value) ! in :erfcoremod:erfcoremod.f
+ double precision intent(in) :: x
+ double precision :: value
+ end function derfc
+ function derfcx(x) result (value) ! in :erfcoremod:erfcoremod.f
+ double precision intent(in) :: x
+ double precision :: value
+ end function derfcx
+ subroutine calerf(arg,result,jint) ! in :erfcoremod:erfcoremod.f
+ double precision intent(in) :: arg
+ double precision intent(inout) :: result
+ integer intent(in) :: jint
+ end subroutine calerf
+ end interface
+end python module erfcoremod
+
+! This file was auto-generated with f2py (version:2_5972).
+! See http://cens.ioc.ee/projects/f2py2e/
diff --git a/src/wafo/source/old/erfcoremod0.f90 b/src/wafo/source/old/erfcoremod0.f90
new file mode 100644
index 0000000..583be61
--- /dev/null
+++ b/src/wafo/source/old/erfcoremod0.f90
@@ -0,0 +1,346 @@
+C $ f2py -m erfcoremod -h erfcoremod.pyf erfcoremod.f
+C f2py erfcoremod.pyf erfcoremod.f -c --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71
+C $ f2py --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71 -m erfcoremod -c erfcoremod.f
+
+C gfortran -fPIC -c erfcoremod.f
+C f2py -m erfcoremod -c erfcoremod.o erfcoremod_interface.f
+
+ MODULE ERFCOREMOD
+C IMPLICIT NONE
+
+C INTERFACE CALERF
+C MODULE PROCEDURE CALERF
+C END INTERFACE
+
+C INTERFACE DERF
+C MODULE PROCEDURE DERF
+C END INTERFACE
+
+C INTERFACE DERFC
+C MODULE PROCEDURE DERFC
+C END INTERFACE
+
+C INTERFACE DERFCX
+C MODULE PROCEDURE DERFCX
+c END INTERFACE
+ CONTAINS
+C--------------------------------------------------------------------
+C
+C DERF subprogram computes approximate values for erf(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, January 8, 1985
+C
+C--------------------------------------------------------------------
+ FUNCTION DERF( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 0
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERF
+C--------------------------------------------------------------------
+C
+C DERFC subprogram computes approximate values for erfc(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, January 8, 1985
+C
+C--------------------------------------------------------------------
+ FUNCTION DERFC( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 1
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERFC
+C------------------------------------------------------------------
+C
+C DERFCX subprogram computes approximate values for exp(x*x) * erfc(x).
+C (see comments heading CALERF).
+C
+C Author/date: W. J. Cody, March 30, 1987
+C
+C------------------------------------------------------------------
+ FUNCTION DERFCX( X ) RESULT (VALUE)
+ IMPLICIT NONE
+ DOUBLE PRECISION, INTENT(IN) :: X
+ DOUBLE PRECISION :: VALUE
+ INTEGER, PARAMETER :: JINT = 2
+ CALL CALERF(X,VALUE,JINT)
+ RETURN
+ END FUNCTION DERFCX
+
+ SUBROUTINE CALERF(ARG,RESULT,JINT)
+ IMPLICIT NONE
+C------------------------------------------------------------------
+C
+C CALERF packet evaluates erf(x), erfc(x), and exp(x*x)*erfc(x)
+C for a real argument x. It contains three FUNCTION type
+C subprograms: ERF, ERFC, and ERFCX (or DERF, DERFC, and DERFCX),
+C and one SUBROUTINE type subprogram, CALERF. The calling
+C statements for the primary entries are:
+C
+C Y=ERF(X) (or Y=DERF(X)),
+C
+C Y=ERFC(X) (or Y=DERFC(X)),
+C and
+C Y=ERFCX(X) (or Y=DERFCX(X)).
+C
+C The routine CALERF is intended for internal packet use only,
+C all computations within the packet being concentrated in this
+C routine. The function subprograms invoke CALERF with the
+C statement
+C
+C CALL CALERF(ARG,RESULT,JINT)
+C
+C where the parameter usage is as follows
+C
+C Function Parameters for CALERF
+C call ARG Result JINT
+C
+C ERF(ARG) ANY REAL ARGUMENT ERF(ARG) 0
+C ERFC(ARG) ABS(ARG) .LT. XBIG ERFC(ARG) 1
+C ERFCX(ARG) XNEG .LT. ARG .LT. XMAX ERFCX(ARG) 2
+C
+C The main computation evaluates near-minimax approximations
+C from "Rational Chebyshev approximations for the error function"
+C by W. J. Cody, Math. Comp., 1969, PP. 631-638. This
+C transportable program uses rational functions that theoretically
+C approximate erf(x) and erfc(x) to at least 18 significant
+C decimal digits. The accuracy achieved depends on the arithmetic
+C system, the compiler, the intrinsic functions, and proper
+C selection of the machine-dependent constants.
+C
+C*******************************************************************
+C*******************************************************************
+C
+C Explanation of machine-dependent constants
+C
+C XMIN = the smallest positive floating-point number.
+C XINF = the largest positive finite floating-point number.
+C XNEG = the largest negative argument acceptable to ERFCX;
+C the negative of the solution to the equation
+C 2*exp(x*x) = XINF.
+C XSMALL = argument below which erf(x) may be represented by
+C 2*x/sqrt(pi) and above which x*x will not underflow.
+C A conservative value is the largest machine number X
+C such that 1.0 + X = 1.0 to machine precision.
+C XBIG = largest argument acceptable to ERFC; solution to
+C the equation: W(x) * (1-0.5/x**2) = XMIN, where
+C W(x) = exp(-x*x)/[x*sqrt(pi)].
+C XHUGE = argument above which 1.0 - 1/(2*x*x) = 1.0 to
+C machine precision. A conservative value is
+C 1/[2*sqrt(XSMALL)]
+C XMAX = largest acceptable argument to ERFCX; the minimum
+C of XINF and 1/[sqrt(pi)*XMIN].
+C
+C Approximate values for some important machines are:
+C
+C XMIN XINF XNEG XSMALL
+C
+C C 7600 (S.P.) 3.13E-294 1.26E+322 -27.220 7.11E-15
+C CRAY-1 (S.P.) 4.58E-2467 5.45E+2465 -75.345 7.11E-15
+C IEEE (IBM/XT,
+C SUN, etc.) (S.P.) 1.18E-38 3.40E+38 -9.382 5.96E-8
+C IEEE (IBM/XT,
+C SUN, etc.) (D.P.) 2.23D-308 1.79D+308 -26.628 1.11D-16
+C IBM 195 (D.P.) 5.40D-79 7.23E+75 -13.190 1.39D-17
+C UNIVAC 1108 (D.P.) 2.78D-309 8.98D+307 -26.615 1.73D-18
+C VAX D-Format (D.P.) 2.94D-39 1.70D+38 -9.345 1.39D-17
+C VAX G-Format (D.P.) 5.56D-309 8.98D+307 -26.615 1.11D-16
+C
+C
+C XBIG XHUGE XMAX
+C
+C C 7600 (S.P.) 25.922 8.39E+6 1.80X+293
+C CRAY-1 (S.P.) 75.326 8.39E+6 5.45E+2465
+C IEEE (IBM/XT,
+C SUN, etc.) (S.P.) 9.194 2.90E+3 4.79E+37
+C IEEE (IBM/XT,
+C SUN, etc.) (D.P.) 26.543 6.71D+7 2.53D+307
+C IBM 195 (D.P.) 13.306 1.90D+8 7.23E+75
+C UNIVAC 1108 (D.P.) 26.582 5.37D+8 8.98D+307
+C VAX D-Format (D.P.) 9.269 1.90D+8 1.70D+38
+C VAX G-Format (D.P.) 26.569 6.71D+7 8.98D+307
+C
+C*******************************************************************
+C*******************************************************************
+C
+C Error returns
+C
+C The program returns ERFC = 0 for ARG .GE. XBIG;
+C
+C ERFCX = XINF for ARG .LT. XNEG;
+C and
+C ERFCX = 0 for ARG .GE. XMAX.
+C
+C
+C Intrinsic functions required are:
+C
+C ABS, AINT, EXP
+C
+C
+C Author: W. J. Cody
+C Mathematics and Computer Science Division
+C Argonne National Laboratory
+C Argonne, IL 60439
+C
+C Latest modification: March 19, 1990
+C Updated to F90 by pab 23.03.2003
+C
+C------------------------------------------------------------------
+ DOUBLE PRECISION, INTENT(IN) :: ARG
+ INTEGER, INTENT(IN) :: JINT
+ DOUBLE PRECISION, INTENT(INOUT):: RESULT
+! Local variables
+ INTEGER :: I
+ DOUBLE PRECISION :: DEL,X,XDEN,XNUM,Y,YSQ
+C------------------------------------------------------------------
+C Mathematical constants
+C------------------------------------------------------------------
+ DOUBLE PRECISION, PARAMETER :: ZERO = 0.0D0
+ DOUBLE PRECISION, PARAMETER :: HALF = 0.05D0
+ DOUBLE PRECISION, PARAMETER :: ONE = 1.0D0
+ DOUBLE PRECISION, PARAMETER :: TWO = 2.0D0
+ DOUBLE PRECISION, PARAMETER :: FOUR = 4.0D0
+ DOUBLE PRECISION, PARAMETER :: SIXTEN = 16.0D0
+ DOUBLE PRECISION, PARAMETER :: SQRPI = 5.6418958354775628695D-1
+ DOUBLE PRECISION, PARAMETER :: THRESH = 0.46875D0
+C------------------------------------------------------------------
+C Machine-dependent constants
+C------------------------------------------------------------------
+ DOUBLE PRECISION, PARAMETER :: XNEG = -26.628D0
+ DOUBLE PRECISION, PARAMETER :: XSMALL = 1.11D-16
+ DOUBLE PRECISION, PARAMETER :: XBIG = 26.543D0
+ DOUBLE PRECISION, PARAMETER :: XHUGE = 6.71D7
+ DOUBLE PRECISION, PARAMETER :: XMAX = 2.53D307
+ DOUBLE PRECISION, PARAMETER :: XINF = 1.79D308
+!---------------------------------------------------------------
+! Coefficents to the rational polynomials
+!--------------------------------------------------------------
+ DOUBLE PRECISION, DIMENSION(5) :: A, Q
+ DOUBLE PRECISION, DIMENSION(4) :: B
+ DOUBLE PRECISION, DIMENSION(9) :: C
+ DOUBLE PRECISION, DIMENSION(8) :: D
+ DOUBLE PRECISION, DIMENSION(6) :: P
+C------------------------------------------------------------------
+C Coefficients for approximation to erf in first interval
+C------------------------------------------------------------------
+ PARAMETER (A = (/ 3.16112374387056560D00,
+ & 1.13864154151050156D02,3.77485237685302021D02,
+ & 3.20937758913846947D03, 1.85777706184603153D-1/))
+ PARAMETER ( B = (/2.36012909523441209D01,2.44024637934444173D02,
+ & 1.28261652607737228D03,2.84423683343917062D03/))
+C------------------------------------------------------------------
+C Coefficients for approximation to erfc in second interval
+C------------------------------------------------------------------
+ PARAMETER ( C=(/5.64188496988670089D-1,8.88314979438837594D0,
+ 1 6.61191906371416295D01,2.98635138197400131D02,
+ 2 8.81952221241769090D02,1.71204761263407058D03,
+ 3 2.05107837782607147D03,1.23033935479799725D03,
+ 4 2.15311535474403846D-8/))
+ PARAMETER ( D =(/1.57449261107098347D01,1.17693950891312499D02,
+ 1 5.37181101862009858D02,1.62138957456669019D03,
+ 2 3.29079923573345963D03,4.36261909014324716D03,
+ 3 3.43936767414372164D03,1.23033935480374942D03/))
+C------------------------------------------------------------------
+C Coefficients for approximation to erfc in third interval
+C------------------------------------------------------------------
+ PARAMETER ( P =(/3.05326634961232344D-1,3.60344899949804439D-1,
+ 1 1.25781726111229246D-1,1.60837851487422766D-2,
+ 2 6.58749161529837803D-4,1.63153871373020978D-2/))
+ PARAMETER (Q =(/2.56852019228982242D00,1.87295284992346047D00,
+ 1 5.27905102951428412D-1,6.05183413124413191D-2,
+ 2 2.33520497626869185D-3/))
+C------------------------------------------------------------------
+ X = ARG
+ Y = ABS(X)
+ IF (Y .LE. THRESH) THEN
+C------------------------------------------------------------------
+C Evaluate erf for |X| <= 0.46875
+C------------------------------------------------------------------
+ !YSQ = ZERO
+ IF (Y .GT. XSMALL) THEN
+ YSQ = Y * Y
+ XNUM = A(5)*YSQ
+ XDEN = YSQ
+ DO I = 1, 3
+ XNUM = (XNUM + A(I)) * YSQ
+ XDEN = (XDEN + B(I)) * YSQ
+ END DO
+ RESULT = X * (XNUM + A(4)) / (XDEN + B(4))
+ ELSE
+ RESULT = X * A(4) / B(4)
+ ENDIF
+ IF (JINT .NE. 0) RESULT = ONE - RESULT
+ IF (JINT .EQ. 2) RESULT = EXP(YSQ) * RESULT
+ GO TO 800
+C------------------------------------------------------------------
+C Evaluate erfc for 0.46875 <= |X| <= 4.0
+C------------------------------------------------------------------
+ ELSE IF (Y .LE. FOUR) THEN
+ XNUM = C(9)*Y
+ XDEN = Y
+ DO I = 1, 7
+ XNUM = (XNUM + C(I)) * Y
+ XDEN = (XDEN + D(I)) * Y
+ END DO
+ RESULT = (XNUM + C(8)) / (XDEN + D(8))
+ IF (JINT .NE. 2) THEN
+ YSQ = AINT(Y*SIXTEN)/SIXTEN
+ DEL = (Y-YSQ)*(Y+YSQ)
+ RESULT = EXP(-YSQ*YSQ) * EXP(-DEL) * RESULT
+ END IF
+C------------------------------------------------------------------
+C Evaluate erfc for |X| > 4.0
+C------------------------------------------------------------------
+ ELSE
+ RESULT = ZERO
+ IF (Y .GE. XBIG) THEN
+ IF ((JINT .NE. 2) .OR. (Y .GE. XMAX)) GO TO 300
+ IF (Y .GE. XHUGE) THEN
+ RESULT = SQRPI / Y
+ GO TO 300
+ END IF
+ END IF
+ YSQ = ONE / (Y * Y)
+ XNUM = P(6)*YSQ
+ XDEN = YSQ
+ DO I = 1, 4
+ XNUM = (XNUM + P(I)) * YSQ
+ XDEN = (XDEN + Q(I)) * YSQ
+ ENDDO
+ RESULT = YSQ *(XNUM + P(5)) / (XDEN + Q(5))
+ RESULT = (SQRPI - RESULT) / Y
+ IF (JINT .NE. 2) THEN
+ YSQ = AINT(Y*SIXTEN)/SIXTEN
+ DEL = (Y-YSQ)*(Y+YSQ)
+ RESULT = EXP(-YSQ*YSQ) * EXP(-DEL) * RESULT
+ END IF
+ END IF
+C------------------------------------------------------------------
+C Fix up for negative argument, erf, etc.
+C------------------------------------------------------------------
+ 300 IF (JINT .EQ. 0) THEN
+ RESULT = (HALF - RESULT) + HALF
+ IF (X .LT. ZERO) RESULT = -RESULT
+ ELSE IF (JINT .EQ. 1) THEN
+ IF (X .LT. ZERO) RESULT = TWO - RESULT
+ ELSE
+ IF (X .LT. ZERO) THEN
+ IF (X .LT. XNEG) THEN
+ RESULT = XINF
+ ELSE
+ YSQ = AINT(X*SIXTEN)/SIXTEN
+ DEL = (X-YSQ)*(X+YSQ)
+ Y = EXP(YSQ*YSQ) * EXP(DEL)
+ RESULT = (Y+Y) - RESULT
+ END IF
+ END IF
+ END IF
+ 800 RETURN
+ END SUBROUTINE CALERF
+ END MODULE ERFCOREMOD
diff --git a/src/wafo/source/old/erfcoremod1.pyf b/src/wafo/source/old/erfcoremod1.pyf
new file mode 100644
index 0000000..02b4929
--- /dev/null
+++ b/src/wafo/source/old/erfcoremod1.pyf
@@ -0,0 +1,27 @@
+! -*- f90 -*-
+! Note: the context of this file is case sensitive.
+
+python module erfcoremod ! in
+ interface ! in :erfcoremod
+ function derf(x) result (value) ! in :erfcoremod:erfcoremod.f
+ double precision intent(in) :: x
+ double precision :: value
+ end function derf
+ function derfc(x) result (value) ! in :erfcoremod:erfcoremod.f
+ double precision intent(in) :: x
+ double precision :: value
+ end function derfc
+ function derfcx(x) result (value) ! in :erfcoremod:erfcoremod.f
+ double precision intent(in) :: x
+ double precision :: value
+ end function derfcx
+ subroutine calerf(arg,result,jint) ! in :erfcoremod:erfcoremod.f
+ double precision intent(in) :: arg
+ double precision intent(inout) :: result
+ integer intent(in) :: jint
+ end subroutine calerf
+ end interface
+end python module erfcoremod
+
+! This file was auto-generated with f2py (version:2_5972).
+! See http://cens.ioc.ee/projects/f2py2e/
diff --git a/src/wafo/source/old/erfcoremod_interface.f90 b/src/wafo/source/old/erfcoremod_interface.f90
new file mode 100644
index 0000000..6c62758
--- /dev/null
+++ b/src/wafo/source/old/erfcoremod_interface.f90
@@ -0,0 +1,11 @@
+
+ module bindings
+ use erfcoremod
+ contains
+ function pyderf(x) result (value) ! in :erfcore:erfcore.f
+ double precision intent(in) :: x
+ double precision :: value
+ value = derf(x)
+ return
+ end function pyderf
+ end module bindings
\ No newline at end of file
diff --git a/src/wafo/source/old/functioninterface.mod b/src/wafo/source/old/functioninterface.mod
new file mode 100644
index 0000000..3183899
--- /dev/null
+++ b/src/wafo/source/old/functioninterface.mod
@@ -0,0 +1,27 @@
+GFORTRAN module created from mvnprodcorrprb.f on Mon Nov 10 15:00:44 2008
+MD5:2bffd45d12c9c1718b19499dd55e4953 -- If you edit this, you'll get what you deserve.
+
+(() () () () () () () () () () () () () () () () () () () () () () () ()
+() () ())
+
+()
+
+()
+
+()
+
+()
+
+(2 'f' 'functioninterface' 'f' 1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC
+BODY UNKNOWN EXTERNAL FUNCTION) (REAL 8 0 0 REAL ()) 3 0 (4) () 5 () ()
+0 0)
+6 'functioninterface' 'functioninterface' 'functioninterface' 1 ((
+MODULE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN) (UNKNOWN 0 0 0
+UNKNOWN ()) 0 0 () () 0 () () 0 0)
+4 'z' '' 'z' 3 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (REAL 8
+0 0 REAL ()) 0 0 () () 0 () () 0 0)
+5 'val' '' 'val' 3 ((VARIABLE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN
+UNKNOWN RESULT) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+)
+
+('f' 0 2 'functioninterface' 0 6)
diff --git a/src/wafo/source/old/integration1dmodule.mod b/src/wafo/source/old/integration1dmodule.mod
new file mode 100644
index 0000000..0e7fda3
--- /dev/null
+++ b/src/wafo/source/old/integration1dmodule.mod
@@ -0,0 +1,241 @@
+GFORTRAN module created from mvnprodcorrprb.f on Mon Nov 10 15:32:07 2008
+MD5:5dd704e6daf3bd44e2297b08a55e52ff -- If you edit this, you'll get what you deserve.
+
+(() () () ()
+() () () () () () () () () () () () () () () () () () () () () () ())
+
+()
+
+(('adaptivesimpson' 'integration1dmodule' 2 3) ('adaptivetrapz'
+'integration1dmodule' 4 5) ('d1mach' 'integration1dmodule' 6) ('dea'
+'integration1dmodule' 7) ('romberg' 'integration1dmodule' 8 9))
+
+()
+
+()
+
+(10 'adaptiveintwithbreaks' 'integration1dmodule' 'adaptiveintwithbreaks'
+1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC DECL UNKNOWN SUBROUTINE
+ALWAYS_EXPLICIT) (UNKNOWN 0 0 0 UNKNOWN ()) 11 0 (12 13 14 15 16 17 18
+19 20) () 0 () () 0 0)
+21 'adaptivesimpson1' 'integration1dmodule' 'adaptivesimpson1' 1 ((
+PROCEDURE UNKNOWN-INTENT MODULE-PROC DECL UNKNOWN SUBROUTINE) (UNKNOWN 0
+0 0 UNKNOWN ()) 22 0 (23 24 25 26 27 28 29) () 0 () () 0 0)
+3 'adaptivesimpson2' 'integration1dmodule' 'adaptivesimpson2' 1 ((
+PROCEDURE UNKNOWN-INTENT MODULE-PROC DECL UNKNOWN SUBROUTINE) (UNKNOWN 0
+0 0 UNKNOWN ()) 30 0 (31 32 33 34 35 36 37) () 0 () () 0 0)
+38 'adaptivesimpson3' 'integration1dmodule' 'adaptivesimpson3' 1 ((
+PROCEDURE UNKNOWN-INTENT MODULE-PROC DECL UNKNOWN SUBROUTINE) (UNKNOWN 0
+0 0 UNKNOWN ()) 39 0 (40 41 42 43 44 45 46) () 0 () () 0 0)
+2 'adaptivesimpsonwithbreaks' 'integration1dmodule'
+'adaptivesimpsonwithbreaks' 1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC
+DECL UNKNOWN SUBROUTINE ALWAYS_EXPLICIT) (UNKNOWN 0 0 0 UNKNOWN ()) 47 0
+(48 49 50 51 52 53 54 55 56) () 0 () () 0 0)
+5 'adaptivetrapz1' 'integration1dmodule' 'adaptivetrapz1' 1 ((PROCEDURE
+UNKNOWN-INTENT MODULE-PROC DECL UNKNOWN SUBROUTINE) (UNKNOWN 0 0 0
+UNKNOWN ()) 57 0 (58 59 60 61 62 63 64) () 0 () () 0 0)
+4 'adaptivetrapzwithbreaks' 'integration1dmodule'
+'adaptivetrapzwithbreaks' 1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC DECL
+UNKNOWN SUBROUTINE ALWAYS_EXPLICIT) (UNKNOWN 0 0 0 UNKNOWN ()) 65 0 (66
+67 68 69 70 71 72 73 74) () 0 () () 0 0)
+6 'd1mach' 'integration1dmodule' 'd1mach' 1 ((PROCEDURE UNKNOWN-INTENT
+MODULE-PROC DECL UNKNOWN FUNCTION GENERIC) (REAL 8 0 0 REAL ()) 75 0 (
+76) () 6 () () 0 0)
+7 'dea' 'integration1dmodule' 'dea' 1 ((PROCEDURE UNKNOWN-INTENT
+MODULE-PROC DECL UNKNOWN SUBROUTINE GENERIC) (UNKNOWN 0 0 0 UNKNOWN ())
+77 0 (78 79 80 81 82 83 84) () 0 () () 0 0)
+85 'dea3' 'integration1dmodule' 'dea3' 1 ((PROCEDURE UNKNOWN-INTENT
+MODULE-PROC DECL UNKNOWN SUBROUTINE) (UNKNOWN 0 0 0 UNKNOWN ()) 86 0 (
+87 88 89 90 91) () 0 () () 0 0)
+92 'integration1dmodule' 'integration1dmodule' 'integration1dmodule' 1 (
+(MODULE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN) (UNKNOWN 0 0 0
+UNKNOWN ()) 0 0 () () 0 () () 0 0)
+9 'romberg1' 'integration1dmodule' 'romberg1' 1 ((PROCEDURE
+UNKNOWN-INTENT MODULE-PROC DECL UNKNOWN SUBROUTINE) (UNKNOWN 0 0 0
+UNKNOWN ()) 93 0 (94 95 96 97 98 99 100 101) () 0 () () 0 0)
+8 'rombergwithbreaks' 'integration1dmodule' 'rombergwithbreaks' 1 ((
+PROCEDURE UNKNOWN-INTENT MODULE-PROC DECL UNKNOWN SUBROUTINE
+ALWAYS_EXPLICIT) (UNKNOWN 0 0 0 UNKNOWN ()) 102 0 (103 104 105 106 107
+108 109 110 111) () 0 () () 0 0)
+76 'i' '' 'i' 75 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+91 'result' '' 'result' 86 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+83 'epstab' '' 'epstab' 77 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SIZE (CONSTANT (
+INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () 0 0)
+84 'ierr' '' 'ierr' 77 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+87 'e0' '' 'e0' 86 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+19 'abserr' '' 'abserr' 11 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+20 'val' '' 'val' 11 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+89 'e2' '' 'e2' 86 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+90 'abserr' '' 'abserr' 86 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+13 'a' '' 'a' 11 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+14 'b' '' 'b' 11 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+15 'n' '' 'n' 11 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+16 'brks' '' 'brks' 11 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SHAPE (CONSTANT
+(INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () 0 0)
+48 'f' '' 'f' 47 ((PROCEDURE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN
+EXTERNAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+67 'a' '' 'a' 65 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+68 'b' '' 'b' 65 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+69 'n' '' 'n' 65 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+70 'brks' '' 'brks' 65 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SHAPE (CONSTANT
+(INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () 0 0)
+71 'epsi' '' 'epsi' 65 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+17 'epsi' '' 'epsi' 11 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+18 'iflg' '' 'iflg' 11 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+12 'f' '' 'f' 11 ((PROCEDURE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN
+EXTERNAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+49 'a' '' 'a' 47 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+50 'b' '' 'b' 47 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+51 'n' '' 'n' 47 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+52 'brks' '' 'brks' 47 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SHAPE (CONSTANT
+(INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () 0 0)
+53 'epsi' '' 'epsi' 47 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+54 'iflg' '' 'iflg' 47 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+55 'abserr' '' 'abserr' 47 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+56 'val' '' 'val' 47 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+23 'f' '' 'f' 22 ((PROCEDURE UNKNOWN-INTENT DUMMY-PROC UNKNOWN UNKNOWN
+EXTERNAL DUMMY FUNCTION) (REAL 8 0 0 REAL ()) 0 0 () () 23 () () 0 0)
+35 'iflg' '' 'iflg' 30 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+31 'f' '' 'f' 30 ((PROCEDURE UNKNOWN-INTENT DUMMY-PROC UNKNOWN UNKNOWN
+EXTERNAL DUMMY FUNCTION) (REAL 8 0 0 REAL ()) 0 0 () () 31 () () 0 0)
+32 'a' '' 'a' 30 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+33 'b' '' 'b' 30 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+34 'epsi' '' 'epsi' 30 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+78 'newflg' '' 'newflg' 77 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (LOGICAL 4 0 0 LOGICAL ()) 0 0 () () 0 () () 0 0)
+79 'svalue' '' 'svalue' 77 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+80 'limexp' '' 'limexp' 77 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+81 'result' '' 'result' 77 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+88 'e1' '' 'e1' 86 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+82 'abserr' '' 'abserr' 77 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+41 'a' '' 'a' 39 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+42 'b' '' 'b' 39 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+43 'epsi' '' 'epsi' 39 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+44 'iflg' '' 'iflg' 39 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+40 'f' '' 'f' 39 ((PROCEDURE UNKNOWN-INTENT DUMMY-PROC UNKNOWN UNKNOWN
+EXTERNAL DUMMY FUNCTION) (REAL 8 0 0 REAL ()) 0 0 () () 40 () () 0 0)
+45 'abserr' '' 'abserr' 39 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+46 'val' '' 'val' 39 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+66 'f' '' 'f' 65 ((PROCEDURE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN
+EXTERNAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+24 'a' '' 'a' 22 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+25 'b' '' 'b' 22 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+26 'epsi' '' 'epsi' 22 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+27 'iflg' '' 'iflg' 22 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+28 'abserr' '' 'abserr' 22 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+29 'val' '' 'val' 22 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+36 'abserr' '' 'abserr' 30 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+37 'val' '' 'val' 30 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+72 'iflg' '' 'iflg' 65 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+73 'abserr' '' 'abserr' 65 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+74 'val' '' 'val' 65 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+58 'f' '' 'f' 57 ((PROCEDURE UNKNOWN-INTENT DUMMY-PROC UNKNOWN UNKNOWN
+EXTERNAL DUMMY FUNCTION) (REAL 8 0 0 REAL ()) 0 0 () () 58 () () 0 0)
+59 'a' '' 'a' 57 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+60 'b' '' 'b' 57 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+61 'epsi' '' 'epsi' 57 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+62 'iflg' '' 'iflg' 57 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+63 'abserr' '' 'abserr' 57 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+64 'val' '' 'val' 57 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+103 'f' '' 'f' 102 ((PROCEDURE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN
+UNKNOWN EXTERNAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+104 'a' '' 'a' 102 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+105 'b' '' 'b' 102 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+106 'n' '' 'n' 102 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+107 'brks' '' 'brks' 102 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SHAPE (CONSTANT
+(INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () 0 0)
+108 'epsi' '' 'epsi' 102 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+109 'iflg' '' 'iflg' 102 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+110 'abserr' '' 'abserr' 102 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+111 'val' '' 'val' 102 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+94 'f' '' 'f' 93 ((PROCEDURE UNKNOWN-INTENT DUMMY-PROC UNKNOWN UNKNOWN
+EXTERNAL DUMMY FUNCTION) (REAL 8 0 0 REAL ()) 0 0 () () 94 () () 0 0)
+95 'a' '' 'a' 93 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+96 'b' '' 'b' 93 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+97 'decdigs' '' 'decdigs' 93 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+98 'abseps' '' 'abseps' 93 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+99 'errflg' '' 'errflg' 93 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () 0 0)
+100 'abserr' '' 'abserr' 93 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+101 'val' '' 'val' 93 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
+(REAL 8 0 0 REAL ()) 0 0 () () 0 () () 0 0)
+)
+
+('adaptiveintwithbreaks' 0 10 'adaptivesimpson1' 0 21 'adaptivesimpson2'
+0 3 'adaptivesimpson3' 0 38 'adaptivesimpsonwithbreaks' 0 2
+'adaptivetrapz1' 0 5 'adaptivetrapzwithbreaks' 0 4 'd1mach' 0 6 'dea' 0
+7 'dea3' 0 85 'integration1dmodule' 0 92 'romberg1' 0 9
+'rombergwithbreaks' 0 8)
diff --git a/wafo/source/rind2007/.cproject b/src/wafo/source/rind2007/.cproject
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/.cproject
rename to src/wafo/source/rind2007/.cproject
diff --git a/wafo/source/rind2007/.project b/src/wafo/source/rind2007/.project
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/.project
rename to src/wafo/source/rind2007/.project
diff --git a/src/wafo/source/rind2007/Debug/DF60.PDB b/src/wafo/source/rind2007/Debug/DF60.PDB
new file mode 100644
index 0000000..fb148f5
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/DF60.PDB differ
diff --git a/src/wafo/source/rind2007/Debug/adaptmod.mod b/src/wafo/source/rind2007/Debug/adaptmod.mod
new file mode 100644
index 0000000..7a25ec1
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/adaptmod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/c1c2mod.mod b/src/wafo/source/rind2007/Debug/c1c2mod.mod
new file mode 100644
index 0000000..f482fb8
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/c1c2mod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/dkbvrcmod.mod b/src/wafo/source/rind2007/Debug/dkbvrcmod.mod
new file mode 100644
index 0000000..729862b
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/dkbvrcmod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/erfcoremod.mod b/src/wafo/source/rind2007/Debug/erfcoremod.mod
new file mode 100644
index 0000000..f5b8c9b
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/erfcoremod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/erfcoremod.obj b/src/wafo/source/rind2007/Debug/erfcoremod.obj
new file mode 100644
index 0000000..892c80e
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/erfcoremod.obj differ
diff --git a/src/wafo/source/rind2007/Debug/fimod.mod b/src/wafo/source/rind2007/Debug/fimod.mod
new file mode 100644
index 0000000..be1c4e8
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/fimod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/fimod.obj b/src/wafo/source/rind2007/Debug/fimod.obj
new file mode 100644
index 0000000..73c6561
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/fimod.obj differ
diff --git a/src/wafo/source/rind2007/Debug/funcmod.mod b/src/wafo/source/rind2007/Debug/funcmod.mod
new file mode 100644
index 0000000..ba662bc
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/funcmod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/globaldata.mod b/src/wafo/source/rind2007/Debug/globaldata.mod
new file mode 100644
index 0000000..99ed174
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/globaldata.mod differ
diff --git a/src/wafo/source/rind2007/Debug/intmodule.obj b/src/wafo/source/rind2007/Debug/intmodule.obj
new file mode 100644
index 0000000..8d1b733
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/intmodule.obj differ
diff --git a/src/wafo/source/rind2007/Debug/jacobmod.mod b/src/wafo/source/rind2007/Debug/jacobmod.mod
new file mode 100644
index 0000000..4413ed8
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/jacobmod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/jacobmod.obj b/src/wafo/source/rind2007/Debug/jacobmod.obj
new file mode 100644
index 0000000..a6f9dca
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/jacobmod.obj differ
diff --git a/src/wafo/source/rind2007/Debug/krbvrcmod.mod b/src/wafo/source/rind2007/Debug/krbvrcmod.mod
new file mode 100644
index 0000000..e7a910c
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/krbvrcmod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/krobovmod.mod b/src/wafo/source/rind2007/Debug/krobovmod.mod
new file mode 100644
index 0000000..77e1c0c
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/krobovmod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/makefile b/src/wafo/source/rind2007/Debug/makefile
new file mode 100644
index 0000000..b6ca9fc
--- /dev/null
+++ b/src/wafo/source/rind2007/Debug/makefile
@@ -0,0 +1,43 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+-include ../makefile.init
+
+RM := rm -rf
+
+# All of the sources participating in the build are defined here
+-include sources.mk
+-include subdir.mk
+-include objects.mk
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(strip $(C_DEPS)),)
+-include $(C_DEPS)
+endif
+endif
+
+-include ../makefile.defs
+
+# Add inputs and outputs from these tool invocations to the build variables
+
+# All Target
+all: test_rind
+
+# Tool invocations
+test_rind: $(OBJS) $(USER_OBJS)
+ @echo 'Building target: $@'
+ @echo 'Invoking: GNU Fortran Linker'
+ gfortran -o"test_rind" $(OBJS) $(USER_OBJS) $(LIBS)
+ @echo 'Finished building target: $@'
+ @echo ' '
+
+# Other Targets
+clean:
+ -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) test_rind
+ -@echo ' '
+
+.PHONY: all clean dependents
+.SECONDARY:
+
+-include ../makefile.targets
diff --git a/src/wafo/source/rind2007/Debug/objects.mk b/src/wafo/source/rind2007/Debug/objects.mk
new file mode 100644
index 0000000..dc028f6
--- /dev/null
+++ b/src/wafo/source/rind2007/Debug/objects.mk
@@ -0,0 +1,7 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+USER_OBJS :=
+
+LIBS :=
diff --git a/src/wafo/source/rind2007/Debug/precisionmod.mod b/src/wafo/source/rind2007/Debug/precisionmod.mod
new file mode 100644
index 0000000..ee24870
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/precisionmod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/quad.mod b/src/wafo/source/rind2007/Debug/quad.mod
new file mode 100644
index 0000000..2ec4f2a
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/quad.mod differ
diff --git a/src/wafo/source/rind2007/Debug/rcrudemod.mod b/src/wafo/source/rind2007/Debug/rcrudemod.mod
new file mode 100644
index 0000000..917c55b
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/rcrudemod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/rind71.obj b/src/wafo/source/rind2007/Debug/rind71.obj
new file mode 100644
index 0000000..177c8eb
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/rind71.obj differ
diff --git a/src/wafo/source/rind2007/Debug/rindmod.mod b/src/wafo/source/rind2007/Debug/rindmod.mod
new file mode 100644
index 0000000..4885230
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/rindmod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/sources.mk b/src/wafo/source/rind2007/Debug/sources.mk
new file mode 100644
index 0000000..32db9ff
--- /dev/null
+++ b/src/wafo/source/rind2007/Debug/sources.mk
@@ -0,0 +1,21 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+O_SRCS :=
+F03_SRCS :=
+C_SRCS :=
+S_SRCS :=
+F_SRCS :=
+OBJ_SRCS :=
+ASM_SRCS :=
+F90_SRCS :=
+F95_SRCS :=
+OBJS :=
+C_DEPS :=
+EXECUTABLES :=
+
+# Every subdirectory with source files must be described here
+SUBDIRS := \
+. \
+
diff --git a/src/wafo/source/rind2007/Debug/ssobolmod.mod b/src/wafo/source/rind2007/Debug/ssobolmod.mod
new file mode 100644
index 0000000..d756f3e
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/ssobolmod.mod differ
diff --git a/src/wafo/source/rind2007/Debug/subdir.mk b/src/wafo/source/rind2007/Debug/subdir.mk
new file mode 100644
index 0000000..bd0fcfc
--- /dev/null
+++ b/src/wafo/source/rind2007/Debug/subdir.mk
@@ -0,0 +1,47 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+F_SRCS += \
+../fimod.f \
+../intmodule.f \
+../jacobmod.f \
+../rindmod2007.f \
+../swapmod.f \
+../test_fimod.f \
+../test_rindmod2007.f
+
+OBJS += \
+./fimod.o \
+./intmodule.o \
+./jacobmod.o \
+./rindmod2007.o \
+./swapmod.o \
+./test_fimod.o \
+./test_rindmod2007.o
+
+
+# Each subdirectory must supply rules for building sources it contributes
+%.o: ../%.f
+ @echo 'Building file: $<'
+ @echo 'Invoking: GNU Fortran Compiler'
+ gfortran -funderscoring -O0 -g -Wall -c -fmessage-length=0 -o"$@" "$<"
+ @echo 'Finished building: $<'
+ @echo ' '
+
+fimod.o: ../fimod.f
+
+intmodule.o: ../intmodule.f
+
+jacobmod.o: ../jacobmod.f
+
+rindmod2007.o: ../rindmod2007.f FIMOD.o RCRUDEMOD.o JACOBMOD.o SWAPMOD.o
+
+swapmod.o: ../swapmod.f
+
+test_fimod.o: ../test_fimod.f FIMOD.o
+
+test_rindmod2007.o: ../test_rindmod2007.f FIMOD.o
+
+
diff --git a/src/wafo/source/rind2007/Debug/test_rind71.exe b/src/wafo/source/rind2007/Debug/test_rind71.exe
new file mode 100644
index 0000000..c796593
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/test_rind71.exe differ
diff --git a/src/wafo/source/rind2007/Debug/test_rind71.ilk b/src/wafo/source/rind2007/Debug/test_rind71.ilk
new file mode 100644
index 0000000..44420eb
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/test_rind71.ilk differ
diff --git a/src/wafo/source/rind2007/Debug/test_rind71.obj b/src/wafo/source/rind2007/Debug/test_rind71.obj
new file mode 100644
index 0000000..68670b1
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/test_rind71.obj differ
diff --git a/src/wafo/source/rind2007/Debug/test_rind71.pdb b/src/wafo/source/rind2007/Debug/test_rind71.pdb
new file mode 100644
index 0000000..9aa5348
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/test_rind71.pdb differ
diff --git a/src/wafo/source/rind2007/Debug/trivariatevar.mod b/src/wafo/source/rind2007/Debug/trivariatevar.mod
new file mode 100644
index 0000000..826a40e
Binary files /dev/null and b/src/wafo/source/rind2007/Debug/trivariatevar.mod differ
diff --git a/wafo/source/rind2007/New File.txt b/src/wafo/source/rind2007/New File.txt
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/New File.txt
rename to src/wafo/source/rind2007/New File.txt
diff --git a/wafo/source/rind2007/adaptmod.mod b/src/wafo/source/rind2007/adaptmod.mod
old mode 100755
new mode 100644
similarity index 94%
rename from wafo/source/rind2007/adaptmod.mod
rename to src/wafo/source/rind2007/adaptmod.mod
index 26608ec..2c907cf
--- a/wafo/source/rind2007/adaptmod.mod
+++ b/src/wafo/source/rind2007/adaptmod.mod
@@ -1,5 +1,5 @@
-GFORTRAN module version '0' created from intmodule.f on Wed Aug 05 06:33:27 2009
-MD5:4d2aeab527515248abfbe40787b2391c -- If you edit this, you'll get what you deserve.
+GFORTRAN module version '0' created from intmodule.f on Fri Aug 07 03:21:27 2009
+MD5:aec1e548e8264e60a27019892ee3cddd -- If you edit this, you'll get what you deserve.
(() () () () () () () () () () () () () () () () () () () () () () () ()
() () ())
@@ -42,10 +42,10 @@ UNKNOWN DUMMY FUNCTION ALWAYS_EXPLICIT) (REAL 8 0 0 REAL ()) 26 0 (27 28)
DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
10 'relreq' '' 'relreq' 4 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
-11 'absest' '' 'absest' 4 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
-DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
12 'finest' '' 'finest' 4 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
+11 'absest' '' 'absest' 4 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
5 'ndim' '' 'ndim' 4 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
6 'mincls' '' 'mincls' 4 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN
diff --git a/wafo/source/rind2007/build_all.py b/src/wafo/source/rind2007/build_all.py
old mode 100755
new mode 100644
similarity index 93%
rename from wafo/source/rind2007/build_all.py
rename to src/wafo/source/rind2007/build_all.py
index 0cf452f..c9004ed
--- a/wafo/source/rind2007/build_all.py
+++ b/src/wafo/source/rind2007/build_all.py
@@ -18,7 +18,7 @@ def compile_all():
os.system(compile1_format % file)
file_objects = format1 % tuple(files)
- os.system('f2py -m rindmod -c %s rind_interface.f --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71' % file_objects)
+ os.system('f2py.py -m rindmod -c %s rind_interface.f --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71' % file_objects)
#compile1_txt = 'gfortran -fPIC -c mvnprd.f'
#compile2_txt = 'f2py -m mvnprdmod -c mvnprd.o mvnprd_interface.f --fcompiler=gnu95 --compiler=mingw32 -lmsvcr71'
#os.system(compile1_txt)
diff --git a/wafo/source/rind2007/c1c2mod.mod b/src/wafo/source/rind2007/c1c2mod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/c1c2mod.mod
rename to src/wafo/source/rind2007/c1c2mod.mod
diff --git a/wafo/source/rind2007/dkbvrcmod.mod b/src/wafo/source/rind2007/dkbvrcmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/dkbvrcmod.mod
rename to src/wafo/source/rind2007/dkbvrcmod.mod
diff --git a/wafo/source/rind2007/erfcoremod.f b/src/wafo/source/rind2007/erfcoremod.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/erfcoremod.f
rename to src/wafo/source/rind2007/erfcoremod.f
diff --git a/wafo/source/rind2007/fimod.f b/src/wafo/source/rind2007/fimod.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/fimod.f
rename to src/wafo/source/rind2007/fimod.f
diff --git a/wafo/source/rind2007/fimod.mod b/src/wafo/source/rind2007/fimod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/fimod.mod
rename to src/wafo/source/rind2007/fimod.mod
diff --git a/wafo/source/rind2007/funcmod.mod b/src/wafo/source/rind2007/funcmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/funcmod.mod
rename to src/wafo/source/rind2007/funcmod.mod
diff --git a/wafo/source/rind2007/globalconst.mod b/src/wafo/source/rind2007/globalconst.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/globalconst.mod
rename to src/wafo/source/rind2007/globalconst.mod
diff --git a/wafo/source/rind2007/globaldata.mod b/src/wafo/source/rind2007/globaldata.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/globaldata.mod
rename to src/wafo/source/rind2007/globaldata.mod
diff --git a/wafo/source/rind2007/intmodule.f b/src/wafo/source/rind2007/intmodule.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/intmodule.f
rename to src/wafo/source/rind2007/intmodule.f
diff --git a/wafo/source/rind2007/jacobmod.f b/src/wafo/source/rind2007/jacobmod.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/jacobmod.f
rename to src/wafo/source/rind2007/jacobmod.f
diff --git a/wafo/source/rind2007/jacobmod.mod b/src/wafo/source/rind2007/jacobmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/jacobmod.mod
rename to src/wafo/source/rind2007/jacobmod.mod
diff --git a/wafo/source/rind2007/krbvrcmod.mod b/src/wafo/source/rind2007/krbvrcmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/krbvrcmod.mod
rename to src/wafo/source/rind2007/krbvrcmod.mod
diff --git a/wafo/source/rind2007/krobovmod.mod b/src/wafo/source/rind2007/krobovmod.mod
old mode 100755
new mode 100644
similarity index 90%
rename from wafo/source/rind2007/krobovmod.mod
rename to src/wafo/source/rind2007/krobovmod.mod
index 2a8be7c..9b3cb2a
--- a/wafo/source/rind2007/krobovmod.mod
+++ b/src/wafo/source/rind2007/krobovmod.mod
@@ -1,5 +1,5 @@
-GFORTRAN module version '0' created from intmodule.f on Wed Aug 05 06:33:27 2009
-MD5:c2bbe88c382c1e5c407f55a156f093e2 -- If you edit this, you'll get what you deserve.
+GFORTRAN module version '0' created from intmodule.f on Fri Aug 07 03:21:28 2009
+MD5:65acff79c0cbb55d31a1ac2a616f396f -- If you edit this, you'll get what you deserve.
(() () () () () () () () () () () () () () () () () () () () () () () ()
() () ())
@@ -34,11 +34,11 @@ DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
5 'minvls' '' 'minvls' 3 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN
DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
+14 'n' '' 'n' 13 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
15 'z' '' 'z' 13 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DIMENSION
DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SHAPE (CONSTANT (INTEGER 4
0 0 INTEGER ()) 0 '1') ()) 0 () () () 0 0)
-14 'n' '' 'n' 13 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
-INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
)
('krobov' 0 2)
diff --git a/wafo/source/rind2007/precisionmod.mod b/src/wafo/source/rind2007/precisionmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/precisionmod.mod
rename to src/wafo/source/rind2007/precisionmod.mod
diff --git a/wafo/source/rind2007/quad.mod b/src/wafo/source/rind2007/quad.mod
old mode 100755
new mode 100644
similarity index 97%
rename from wafo/source/rind2007/quad.mod
rename to src/wafo/source/rind2007/quad.mod
index c0469ec..8dd9f66
--- a/wafo/source/rind2007/quad.mod
+++ b/src/wafo/source/rind2007/quad.mod
@@ -1,5 +1,5 @@
-GFORTRAN module version '0' created from rind71mod.f on Wed Aug 05 05:42:33 2009
-MD5:5fe7f8d121252e680c2bd7d7c177fa9d -- If you edit this, you'll get what you deserve.
+GFORTRAN module version '0' created from rind71mod.f on Fri Feb 26 13:11:06 2010
+MD5:fc4ffe08c60cbfe3a121a63154dd2c49 -- If you edit this, you'll get what you deserve.
(() () () () () () () () () () () () () () () () () () () () ()
() () () () () ())
@@ -205,14 +205,14 @@ REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
29 'n0' '' 'n0' 23 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
+39 'bpout' '' 'bpout' 36 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SHAPE (CONSTANT
+(INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () () 0 0)
37 'n' '' 'n' 36 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
38 'wfout' '' 'wfout' 36 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SHAPE (CONSTANT
(INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () () 0 0)
-39 'bpout' '' 'bpout' 36 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
-DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SHAPE (CONSTANT
-(INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () () 0 0)
40 'xmi' '' 'xmi' 36 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
41 'xma' '' 'xma' 36 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
diff --git a/wafo/source/rind2007/rcrudemod.mod b/src/wafo/source/rind2007/rcrudemod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/rcrudemod.mod
rename to src/wafo/source/rind2007/rcrudemod.mod
diff --git a/wafo/source/rind2007/rind71mod.f b/src/wafo/source/rind2007/rind71mod.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/rind71mod.f
rename to src/wafo/source/rind2007/rind71mod.f
diff --git a/wafo/source/rind2007/rind71mod.mod b/src/wafo/source/rind2007/rind71mod.mod
old mode 100755
new mode 100644
similarity index 94%
rename from wafo/source/rind2007/rind71mod.mod
rename to src/wafo/source/rind2007/rind71mod.mod
index 267e4f4..da190e3
--- a/wafo/source/rind2007/rind71mod.mod
+++ b/src/wafo/source/rind2007/rind71mod.mod
@@ -1,5 +1,5 @@
-GFORTRAN module version '0' created from rind71mod.f on Wed Aug 05 06:26:36 2009
-MD5:4c69b3be4f1e6c8e1aedc15a8c988682 -- If you edit this, you'll get what you deserve.
+GFORTRAN module version '0' created from rind71mod.f on Fri Feb 26 13:11:07 2010
+MD5:f9bcaa9fb7b827472c94d50c70c8a88f -- If you edit this, you'll get what you deserve.
(() () () () () () () () () () () () () () () () () () () () () () ()
() () () ())
@@ -25,16 +25,16 @@ DECL UNKNOWN SUBROUTINE GENERIC ALWAYS_EXPLICIT) (UNKNOWN 0 0 0 UNKNOWN
5 'setdata' 'rind71mod' 'setdata' 1 ((PROCEDURE UNKNOWN-INTENT
MODULE-PROC DECL UNKNOWN SUBROUTINE GENERIC) (UNKNOWN 0 0 0 UNKNOWN ())
19 0 (20 21 22 23 24 25 26 27 28) () 0 () () () 0 0)
+27 'dnint' '' 'dnint' 19 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
+28 'dxsplt' '' 'dxsplt' 19 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
24 'deps2' '' 'deps2' 19 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
25 'dnit' '' 'dnit' 19 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY)
(INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
26 'dxc' '' 'dxc' 19 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
-27 'dnint' '' 'dnint' 19 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
-DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
-28 'dxsplt' '' 'dxsplt' 19 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
-DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
20 'method' '' 'method' 19 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
21 'scale' '' 'scale' 19 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
@@ -52,10 +52,6 @@ INTEGER ()) 0 '1') ()) 0 () () () 0 0)
11 'fxind' '' 'fxind' 10 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SHAPE (CONSTANT
(INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () () 0 0)
-18 'bup' '' 'bup' 10 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
-DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (2 ASSUMED_SHAPE (CONSTANT
-(INTEGER 4 0 0 INTEGER ()) 0 '1') () (CONSTANT (INTEGER 4 0 0 INTEGER ())
-0 '1') ()) 0 () () () 0 0)
12 'big1' '' 'big1' 10 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (2 ASSUMED_SHAPE (CONSTANT
(INTEGER 4 0 0 INTEGER ()) 0 '1') () (CONSTANT (INTEGER 4 0 0 INTEGER ())
@@ -76,6 +72,10 @@ CONSTANT (INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () () 0 0)
DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (2 ASSUMED_SHAPE (CONSTANT
(INTEGER 4 0 0 INTEGER ()) 0 '1') () (CONSTANT (INTEGER 4 0 0 INTEGER ())
0 '1') ()) 0 () () () 0 0)
+18 'bup' '' 'bup' 10 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (2 ASSUMED_SHAPE (CONSTANT
+(INTEGER 4 0 0 INTEGER ()) 0 '1') () (CONSTANT (INTEGER 4 0 0 INTEGER ())
+0 '1') ()) 0 () () () 0 0)
)
('echo' 0 2 'initdata' 0 3 'rind71' 0 4 'setdata' 0 5)
diff --git a/wafo/source/rind2007/rind_interface.f b/src/wafo/source/rind2007/rind_interface.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/rind_interface.f
rename to src/wafo/source/rind2007/rind_interface.f
diff --git a/wafo/source/rind2007/rindmod.f b/src/wafo/source/rind2007/rindmod.f
old mode 100755
new mode 100644
similarity index 99%
rename from wafo/source/rind2007/rindmod.f
rename to src/wafo/source/rind2007/rindmod.f
index 5b4f064..ded7d1d
--- a/wafo/source/rind2007/rindmod.f
+++ b/src/wafo/source/rind2007/rindmod.f
@@ -268,16 +268,16 @@
if (present(nit)) mNit = nit
if (present(xcutOff)) mXcutOff = xCutOff
if (present(Nc1c2)) mNc1c2 = max(Nc1c2,1)
- print *, 'method=', mMethod
- print *, 'xcscale=', mXcScale
- print *, 'abseps=', mAbsEps
- print *, 'releps=', mRelEps
- print *, 'coveps=', mCovEps
- print *, 'maxpts=', mMaxPts
- print *, 'minpts=', mMinPts
- print *, 'nit=', mNit
- print *, 'xcutOff=', mXcutOff
- print *, 'Nc1c2=', mNc1c2
+! print *, 'method=', mMethod
+! print *, 'xcscale=', mXcScale
+! print *, 'abseps=', mAbsEps
+! print *, 'releps=', mRelEps
+! print *, 'coveps=', mCovEps
+! print *, 'maxpts=', mMaxPts
+! print *, 'minpts=', mMinPts
+! print *, 'nit=', mNit
+! print *, 'xcutOff=', mXcutOff
+! print *, 'Nc1c2=', mNc1c2
end subroutine setConstants
subroutine preInit(BIG,Xc,Nt,inform)
diff --git a/wafo/source/rind2007/rindmod.mod b/src/wafo/source/rind2007/rindmod.mod
old mode 100755
new mode 100644
similarity index 95%
rename from wafo/source/rind2007/rindmod.mod
rename to src/wafo/source/rind2007/rindmod.mod
index 8e01f99..8a86c1d
--- a/wafo/source/rind2007/rindmod.mod
+++ b/src/wafo/source/rind2007/rindmod.mod
@@ -1,5 +1,5 @@
-GFORTRAN module version '0' created from rindmod.f on Thu Aug 06 04:34:47 2009
-MD5:5fe8a25b9fbc7181e3829b830ac22e79 -- If you edit this, you'll get what you deserve.
+GFORTRAN module version '0' created from rindmod.f on Fri Feb 26 13:11:05 2010
+MD5:bc2c220667849c09b8a376ad185f37fa -- If you edit this, you'll get what you deserve.
(() () () () () () () () () () () () () () () ()
() () () () () () () () () () ())
@@ -51,6 +51,8 @@ MODULE-PROC DECL UNKNOWN SUBROUTINE GENERIC ALWAYS_EXPLICIT) (UNKNOWN 0
0 0 UNKNOWN ()) 27 0 (28 29 30 31 32 33 34 35 36 37) () 0 () () () 0 0)
31 'releps' '' 'releps' 27 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
OPTIONAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
+32 'coveps' '' 'coveps' 27 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
+OPTIONAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
33 'maxpts' '' 'maxpts' 27 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
OPTIONAL DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
34 'minpts' '' 'minpts' 27 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
@@ -67,8 +69,6 @@ OPTIONAL DUMMY) (INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
OPTIONAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
30 'abseps' '' 'abseps' 27 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
OPTIONAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
-32 'coveps' '' 'coveps' 27 ((VARIABLE IN UNKNOWN-PROC UNKNOWN UNKNOWN
-OPTIONAL DUMMY) (REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
16 'vals' '' 'vals' 15 ((VARIABLE OUT UNKNOWN-PROC UNKNOWN UNKNOWN
DIMENSION DUMMY) (REAL 8 0 0 REAL ()) 0 0 () (1 ASSUMED_SHAPE (CONSTANT
(INTEGER 4 0 0 INTEGER ()) 0 '1') ()) 0 () () () 0 0)
diff --git a/src/wafo/source/rind2007/rindmod.pyd b/src/wafo/source/rind2007/rindmod.pyd
new file mode 100644
index 0000000..d32eded
Binary files /dev/null and b/src/wafo/source/rind2007/rindmod.pyd differ
diff --git a/wafo/source/rind2007/ssobolmod.mod b/src/wafo/source/rind2007/ssobolmod.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/ssobolmod.mod
rename to src/wafo/source/rind2007/ssobolmod.mod
diff --git a/wafo/source/rind2007/swapmod.f b/src/wafo/source/rind2007/swapmod.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/swapmod.f
rename to src/wafo/source/rind2007/swapmod.f
diff --git a/wafo/source/rind2007/swapmod.mod b/src/wafo/source/rind2007/swapmod.mod
old mode 100755
new mode 100644
similarity index 89%
rename from wafo/source/rind2007/swapmod.mod
rename to src/wafo/source/rind2007/swapmod.mod
index 39fae1a..5b5ab46
--- a/wafo/source/rind2007/swapmod.mod
+++ b/src/wafo/source/rind2007/swapmod.mod
@@ -1,5 +1,5 @@
-GFORTRAN module version '0' created from swapmod.f on Wed Aug 05 05:35:52 2009
-MD5:ef4929a633bcda1f578d77241251f8bb -- If you edit this, you'll get what you deserve.
+GFORTRAN module version '0' created from swapmod.f on Fri Feb 26 13:11:03 2010
+MD5:32151853a616dcbd7ed5153d9aeab1c0 -- If you edit this, you'll get what you deserve.
(() () () () () () () () () () () () () () () () () () () () () () () ()
() () ())
@@ -23,6 +23,12 @@ DECL UNKNOWN SUBROUTINE) (UNKNOWN 0 0 0 UNKNOWN ()) 11 0 (12 13) () 0 ()
() () 0 0)
14 'swapmod' 'swapmod' 'swapmod' 1 ((MODULE UNKNOWN-INTENT UNKNOWN-PROC
UNKNOWN UNKNOWN) (UNKNOWN 0 0 0 UNKNOWN ()) 0 0 () () 0 () () () 0 0)
+12 'a' '' 'a' 11 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
+13 'b' '' 'b' 11 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
+9 'a' '' 'a' 8 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
+INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
10 'b' '' 'b' 8 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
6 'a' '' 'a' 5 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
@@ -31,12 +37,6 @@ CHARACTER 1 0 0 CHARACTER ((CONSTANT (INTEGER 4 0 0 INTEGER ()) 0 '1')))
7 'b' '' 'b' 5 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
CHARACTER 1 0 0 CHARACTER ((CONSTANT (INTEGER 4 0 0 INTEGER ()) 0 '1')))
0 0 () () 0 () () () 0 0)
-12 'a' '' 'a' 11 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
-REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
-13 'b' '' 'b' 11 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
-REAL 8 0 0 REAL ()) 0 0 () () 0 () () () 0 0)
-9 'a' '' 'a' 8 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN DUMMY) (
-INTEGER 4 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
)
('swap_c' 0 2 'swap_i' 0 3 'swap_r' 0 4 'swapmod' 0 14)
diff --git a/wafo/source/rind2007/test_fimod.dsp b/src/wafo/source/rind2007/test_fimod.dsp
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_fimod.dsp
rename to src/wafo/source/rind2007/test_fimod.dsp
diff --git a/wafo/source/rind2007/test_fimod.dsw b/src/wafo/source/rind2007/test_fimod.dsw
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_fimod.dsw
rename to src/wafo/source/rind2007/test_fimod.dsw
diff --git a/wafo/source/rind2007/test_fimod.exe b/src/wafo/source/rind2007/test_fimod.exe
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_fimod.exe
rename to src/wafo/source/rind2007/test_fimod.exe
diff --git a/wafo/source/rind2007/test_fimod.f b/src/wafo/source/rind2007/test_fimod.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_fimod.f
rename to src/wafo/source/rind2007/test_fimod.f
diff --git a/wafo/source/rind2007/test_rind71mod.exe b/src/wafo/source/rind2007/test_rind71mod.exe
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_rind71mod.exe
rename to src/wafo/source/rind2007/test_rind71mod.exe
diff --git a/wafo/source/rind2007/test_rind71mod.f b/src/wafo/source/rind2007/test_rind71mod.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_rind71mod.f
rename to src/wafo/source/rind2007/test_rind71mod.f
diff --git a/wafo/source/rind2007/test_rindmod.exe b/src/wafo/source/rind2007/test_rindmod.exe
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_rindmod.exe
rename to src/wafo/source/rind2007/test_rindmod.exe
diff --git a/wafo/source/rind2007/test_rindmod.f b/src/wafo/source/rind2007/test_rindmod.f
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_rindmod.f
rename to src/wafo/source/rind2007/test_rindmod.f
diff --git a/wafo/source/rind2007/test_rindmod2007.exe b/src/wafo/source/rind2007/test_rindmod2007.exe
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_rindmod2007.exe
rename to src/wafo/source/rind2007/test_rindmod2007.exe
diff --git a/wafo/source/rind2007/test_rindmod2007.opt b/src/wafo/source/rind2007/test_rindmod2007.opt
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_rindmod2007.opt
rename to src/wafo/source/rind2007/test_rindmod2007.opt
diff --git a/wafo/source/rind2007/test_rindmod2007.plg b/src/wafo/source/rind2007/test_rindmod2007.plg
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/test_rindmod2007.plg
rename to src/wafo/source/rind2007/test_rindmod2007.plg
diff --git a/wafo/source/rind2007/trivariatevar.mod b/src/wafo/source/rind2007/trivariatevar.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/rind2007/trivariatevar.mod
rename to src/wafo/source/rind2007/trivariatevar.mod
diff --git a/wafo/source/test_f90/hello.f90 b/src/wafo/source/test_f90/hello.f90
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/test_f90/hello.f90
rename to src/wafo/source/test_f90/hello.f90
diff --git a/wafo/source/test_f90/hello.mod b/src/wafo/source/test_f90/hello.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/test_f90/hello.mod
rename to src/wafo/source/test_f90/hello.mod
diff --git a/wafo/source/test_f90/hello.pyd b/src/wafo/source/test_f90/hello.pyd
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/test_f90/hello.pyd
rename to src/wafo/source/test_f90/hello.pyd
diff --git a/wafo/source/test_f90/hello.txt b/src/wafo/source/test_f90/hello.txt
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/test_f90/hello.txt
rename to src/wafo/source/test_f90/hello.txt
diff --git a/wafo/source/test_f90/hello_interface.f90 b/src/wafo/source/test_f90/hello_interface.f90
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/test_f90/hello_interface.f90
rename to src/wafo/source/test_f90/hello_interface.f90
diff --git a/wafo/source/test_f90/mymod.f90 b/src/wafo/source/test_f90/mymod.f90
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/test_f90/mymod.f90
rename to src/wafo/source/test_f90/mymod.f90
diff --git a/wafo/source/test_f90/mymod.pyd b/src/wafo/source/test_f90/mymod.pyd
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/test_f90/mymod.pyd
rename to src/wafo/source/test_f90/mymod.pyd
diff --git a/wafo/source/test_f90/types.f90 b/src/wafo/source/test_f90/types.f90
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/test_f90/types.f90
rename to src/wafo/source/test_f90/types.f90
diff --git a/wafo/source/test_f90/types.mod b/src/wafo/source/test_f90/types.mod
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/source/test_f90/types.mod
rename to src/wafo/source/test_f90/types.mod
diff --git a/wafo/spectrum/__init__.py b/src/wafo/spectrum/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/spectrum/__init__.py
rename to src/wafo/spectrum/__init__.py
diff --git a/wafo/spectrum/core.py b/src/wafo/spectrum/core.py
old mode 100755
new mode 100644
similarity index 96%
rename from wafo/spectrum/core.py
rename to src/wafo/spectrum/core.py
index 8265a35..ef32be8
--- a/wafo/spectrum/core.py
+++ b/src/wafo/spectrum/core.py
@@ -17,10 +17,21 @@ from pylab import stineman_interp
from dispersion_relation import w2k #, k2w
from wafo.wafodata import WafoData, now
from wafo.misc import sub_dict_select, nextpow2, discretize, JITImport
-from wafo.gaussian import Rind
+try:
+ from wafo.gaussian import Rind
+except ImportError:
+
+ Rind = None
+try:
+ from wafo import c_library
+except ImportError:
+ warnings.warn('Compile the c_libraray.pyd again!')
+ c_library = None
+
from wafo.transform import TrData
from wafo.plotbackend import plotbackend
-from wafo import c_library
+
+
# Trick to avoid error due to circular import
_WAFOCOV = JITImport('wafo.covariance')
diff --git a/wafo/spectrum/dispersion_relation.py b/src/wafo/spectrum/dispersion_relation.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/spectrum/dispersion_relation.py
rename to src/wafo/spectrum/dispersion_relation.py
diff --git a/wafo/spectrum/models.py b/src/wafo/spectrum/models.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/spectrum/models.py
rename to src/wafo/spectrum/models.py
diff --git a/src/wafo/test/__init__.py b/src/wafo/test/__init__.py
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/wafo/test/__init__.py
@@ -0,0 +1 @@
+
diff --git a/wafo/transform/__init__.py b/src/wafo/transform/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/transform/__init__.py
rename to src/wafo/transform/__init__.py
diff --git a/wafo/transform/core.py b/src/wafo/transform/core.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/transform/core.py
rename to src/wafo/transform/core.py
diff --git a/wafo/transform/models.py b/src/wafo/transform/models.py
old mode 100755
new mode 100644
similarity index 100%
rename from wafo/transform/models.py
rename to src/wafo/transform/models.py
diff --git a/src/wafo/transform/models.~py b/src/wafo/transform/models.~py
new file mode 100644
index 0000000..1945ba1
--- /dev/null
+++ b/src/wafo/transform/models.~py
@@ -0,0 +1,557 @@
+#-------------------------------------------------------------------------------
+# Name: transform.models
+# Purpose:
+#
+# Author: pab
+#
+# Created: 24.11.2008
+# Copyright: (c) pab 2008
+# Licence:
+#-------------------------------------------------------------------------------
+#!/usr/bin/env python
+
+from scipy.optimize import brentq
+from scipy.integrate import trapz
+from numpy import (sqrt, atleast_1d, abs, imag, sign, where, cos, arccos, ceil,
+ expm1,log1p)
+import numpy as np
+import warnings
+
+__all__=['TrHermite','TrOchi']
+class TrCommon(object):
+ """
+ transformation model, g, from the moments of the process.
+
+ Information about the moments of the process can be obtained by site
+ specific data, laboratory measurements or by resort to theoretical models.
+
+ Assumption
+ ----------
+ The Gaussian process, Y, distributed N(0,1) is related to the
+ non-Gaussian process, X, by Y = g(X).
+
+ Methods
+ -------
+ dist2gauss : int (g(x)-xn)^2 dx where int. limits is given by X. This
+ is a measure of departure from the Gaussian model.
+ dat2gauss : transform non-linear data to Gaussian scale
+ gauss2dat : transform Gaussian data to non-linear scale
+
+ Member variables
+ ----------------
+ mean, sigma, skew, kurt : real, scalar
+ mean, standard-deviation, skewness and kurtosis, respectively, of the
+ non-Gaussian process. Default mean=0, sigma=1, skew=0.16, kurt=3.04.
+ skew=kurt-3=0 for a Gaussian process.
+ """
+ def __init__(self,mean=0.0,var=1.0,skew=0.16,kurt=3.04,sigma=None,*args,**kwds):
+ if sigma is None:
+ sigma = sqrt(var)
+ self.mean = mean
+ self.sigma = sigma
+ self.skew = skew
+ self.kurt = kurt
+
+ def __call__(self,x):
+ return self._dat2gauss(x)
+
+ def dist2gauss(self,x=None,xnmin=-5,xnmax=5,n=513):
+ """ Return a measure of departure from the Gaussian model.
+
+ Parameters
+ ----------
+ x : vector (default sigma*linspace(xnmin,xnmax,n)+mean)
+ xnmin : real, scalar
+ minimum on normalized scale
+ xnmax : real, scalar
+ maximum on normalized scale
+ n : integer, scalar
+ number of evaluation points
+
+
+ Returns
+ -------
+ t0 = real, scalar
+ a measure of departure from the Gaussian model calculated as
+ trapz(xn,(xn-g(x))**2.) where int. limits is given by X.
+ """
+ if x is None:
+ xn = np.linspace(xnmin,xnmax,n)
+ x = self.sigma*xn+self.mean
+ else:
+ xn = (x-self.mean)/self.sigma
+
+ g = self._dat2gauss(x)
+ t0 = trapz(xn,(xn-g)**2.)
+ return t0
+
+ def gauss2dat(self,y):
+ """ Transforms Gaussian data, y, to non-linear scale.
+
+ Parameters
+ ----------
+ y : array-like
+ input vector with Gaussian data values.
+
+ Returns
+ -------
+ x : array-like
+ transformed data to a non-linear scale
+
+
+ See also
+ --------
+ dat2gauss
+ tranproc.
+ """
+ return self._gauss2dat(y)
+ def dat2gauss(self,x):
+ """ Transforms non-linear data, x, to Gaussian scale.
+
+ Parameters
+ ----------
+ x : array-like
+ input vector with non-linear data values.
+
+ Returns
+ -------
+ y : array-like
+ transformed data to a Gaussian scale
+
+ See also
+ --------
+ gauss2dat
+ tranproc.
+ """
+ return self._dat2gauss(x)
+
+class TrHermite(TrCommon):
+ __doc__ = TrCommon.__doc__.replace('','Hermite') + """
+ pardef : scalar, integer
+ 1 Winterstein et. al. (1994) parametrization [1]_ (default)
+ 2 Winterstein (1988) parametrization [2]_
+
+ Description
+ -----------
+ The hermite transformation model is monotonic cubic polynomial, calibrated
+ such that the first 4 moments of the transformed model G(y)=g^-1(y) match
+ the moments of the true process. The model is given as:
+
+ g(x) = xn - c3(xn**2-1) - c4*(xn**3-3*xn)
+
+ for kurt<3 (hardening model) where
+ xn = (x-mean)/sigma
+ c3 = skew/6
+ c4 = (kurt-3)/24.
+
+ or
+ G(y) = mean + K*sigma*[ y + c3(y**2-1) + c4*(y**3-3*y) ]
+
+ for kurt>=3 (softening model) where
+ y = g(x) = G**-1(x)
+ K = 1/sqrt(1+2*c3^2+6*c4^2)
+ If pardef = 1 :
+ c3 = skew/6*(1-0.015*abs(skew)+0.3*skew^2)/(1+0.2*(kurt-3))
+ c4 = 0.1*((1+1.25*(kurt-3))^(1/3)-1)*c41
+ c41 = (1-1.43*skew^2/(kurt-3))^(1-0.1*(kurt)^0.8)
+ If pardef = 2 :
+ c3 = skew/(6*(1+6*c4))
+ c4 = [sqrt(1+1.5*(kurt-3))-1]/18
+
+
+ Example:
+ --------
+ # Simulate a Transformed Gaussian process:
+ Hm0=7;Tp=11;
+ S = jonswap([],[Hm0 Tp]);
+ g=hermitetr*Hm0/4;
+ ys = spec2sdat(S,15000); % Simulated in the Gaussian world
+ xs = gaus2dat(ys,g); % Transformed to the real world
+
+ See also spec2skew, ochitr, lc2tr, dat2tr
+
+ References
+ ----------
+ .. [1] Winterstein, S.R, Ude, T.C. and Kleiven, G. (1994)
+ "Springing and slow drift responses:
+ predicted extremes and fatigue vs. simulation"
+ In Proc. 7th International behaviour of Offshore structures, (BOSS)
+ Vol. 3, pp.1-15
+ .. [2] Winterstein, S.R. (1988)
+ 'Nonlinear vibration models for extremes and fatigue.'
+ J. Engng. Mech., ASCE, Vol 114, No 10, pp 1772-1790
+ """
+ def __init__(self,mean=0.0,var=1.0,skew=0.16,kurt=3.04,sigma=None,pardef=0):
+ if sigma==None:
+ sigma = sqrt(var)
+ self.sigma = sigma
+ self.skew = skew
+ self.kurt = kurt
+ self.mean = mean
+ self.pardef = pardef
+ self._c3 = None
+ self._c4 = None
+ self._forward = None
+ self._backward = None
+ self._x_limit = None
+ self.set_poly()
+
+ def _poly_par_from_stats(self):
+ skew = self.skew
+ ga2 = self.kurt-3.0
+ if ga2<=0:
+ self._c4 = ga2/24.
+ self._c3 = skew/6.
+ elif self.pardef==2:
+ #% Winterstein 1988 parametrization
+ if skew**2>8*(ga2+3.)/9.:
+ warnings.warn('Kurtosis too low compared to the skewness')
+
+ self._c4 = (sqrt(1.+1.5*ga2)-1.)/18.;
+ self._c3 = skew/(6.*(1+6.*c4))
+ else:
+ # Winterstein et. al. 1994 parametrization intended to
+ # apply for the range: 0 <= ga2 < 12 and 0<= skew^2 < 2*ga2/3
+ if skew**2>2*(ga2)/3:
+ warnings.warn('Kurtosis too low compared to the skewness')
+
+ if (ga2 < 0) or (12 < ga2):
+ warnings.warn('Kurtosis must be between 0 and 12')
+
+ self._c3 = skew/6*(1-0.015*abs(skew)+0.3*skew**2)/(1+0.2*ga2);
+ if ga2==0.:
+ self._c4=0.0;
+ else:
+ c41= (1.-1.43*skew**2./ga2)**(1.-0.1*(ga2+3.)**0.8);
+ self._c4 = 0.1*((1.+1.25*ga2)**(1./3.)-1.)*c41;
+
+ if not np.isfinite(self._c3) or not np.isfinite(self._c4):
+ raise ValueError('Unable to calculate the polynomial')
+ def set_poly(self):
+
+ if self._c3 is None:
+ self._poly_par_from_stats()
+ eps = np.finfo(float).eps
+ c3 = self._c3
+ c4 = self._c4
+ ma = self.mean
+ sa = self.sigma
+ if abs(c4)0:
+ # Compute where it is possible to invert the polynomial
+ if self.kurt<3.:
+ self._x_limit = r;
+ else:
+ self._x_limit = sa*p(r)+ma
+
+ txt1 = 'The polynomial is not a strictly increasing function.';
+ txt2 = 'The derivative of g(x) is infinite at x = %g' % self._x_limit
+ warnings.warn('%s \n %s ' % (txt1,txt2))
+ return
+ def check_forward(self,x):
+ if not (self._x_limit is None):
+ x00 = self._x_limit
+ txt2 = 'for the given interval x = [%g, %g]' % (x[0],x[-1])
+
+ if any(np.logical_and(x[0]<= x00, x00 <= x[-1])):
+ cdef = 1;
+ else:
+ cdef = sum( np.logical_xor(x00 <= x[0] , x00 <= x[-1]));
+
+ if np.mod(cdef,2):
+ errtxt = 'Unable to invert the polynomial \n %s' % txt2
+ raise ValueError(errtxt)
+ np.disp('However, successfully inverted the polynomial\n %s' % txt2)
+
+
+ def _dat2gauss(self,x):
+ x = np.atleast_1d(x)
+ self.check_forward(x)
+
+ xn = (x-self.mean)/self.sigma
+
+ if self._forward is None:
+ #% Inverting the polynomial
+ #%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ return self._poly_inv(self._backward,xn)
+ else:
+ return self._forward(xn)
+
+ def _gauss2dat(self,y):
+ y = np.atleast_1d(y)
+ #self.check_forward(y)
+
+ if self._backward is None:
+ #% Inverting the polynomial
+ #%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ xn = self._poly_inv(self._forward,y)
+ else:
+ xn = self._backward(y)
+ return self.sigma*xn + self.mean
+ def _poly_inv(self,p,xn):
+
+ if p.order<2:
+ return xn
+ elif p.order==2:
+ # Quadratic: Solve a*u**2+b*u+c = xn
+ coefs = p.coeffs
+ a = coefs[0]
+ b = coefs[1]
+ c = coefs[2]-xn
+ t = 0.5*(b+sign(b)*sqrt(b**2-4*a*c))
+ #so1 = t/a # largest solution
+ so2 = -c/t # smallest solution
+ return so2
+ elif p.order==3:
+ # Solve
+ # K*(c4*u^3+c3*u^2+(1-3*c4)*u-c3) = xn = (x-ma)/sa
+ # -c4*xn^3-c3*xn^2+(1+3*c4)*xn+c3 = u
+ coefs = p.coeffs[1::]/p.coeffs[0]
+ a = coefs[0]
+ b = coefs[1]
+ c = coefs[2]-xn/p.coeffs[0]
+
+ x0 = a/3.
+ #% substitue xn = z-x0 and divide by c4 => z^3 + 3*p1*z+2*q0 = 0
+ p1 = b/3-x0**2
+ #p1 = (b-a**2/3)/3
+
+
+ #q0 = (c + x0*(2.*x0/3.-b))/2.
+ #q0 = x0**3 -a*b/6 +c/2
+ q0 = x0*(x0**2-b/2)+c/2
+## # z^3+3*p1*z+2*q0=0
+
+## c3 = self._c3
+## c4 = self._c4
+## b1 = 1./(3.*c4);
+## #x0 = c3*b1 ;
+## #% substitue u = z-x0 and divide by c4 => z^3 + 3*c*z+2*q0 = 0
+## #p1 = b1-1.-x0**2.
+## Km1 = np.sqrt(1.+2.*c3**2+6*c4**2);
+## q0 = x0**3-1.5*b1*(x0+xn*Km1)
+ #q0 = x0**3-1.5*b1*(x0+xn)
+ if not (self._x_limit is None): # % Three real roots
+ d = sqrt(-p1);
+ theta1 = arccos(-q0/d**3)/3;
+ th2 = np.r_[0, -2*pi/3, 2*pi/3];
+ x1 = abs(2*d*cos(theta1[ceil(len(xn)/2)] + th2)-x0);
+ ix = x1.argmin() #; % choose the smallest solution
+ return 2.*d*cos(theta1 + th2[ix])-x0
+ else: # %Only one real root exist
+ q1 = sqrt((q0)**2+p1**3);
+ #% Find the real root of the monic polynomial
+ A0 = (q1-q0)**(1./3.);
+ B0 = -(q1+q0)**(1./3.);
+ return A0+B0-x0; #% real root
+ #%% The other complex roots are given by
+ #%x= -(A0+B0)/2+(A0-B0)*sqrt(3)/2-x0;
+ #%x=-(A0+B0)/2+(A0-B0)*sqrt(-3)/2-x0;
+
+
+class TrOchi(TrCommon):
+ __doc__ = TrCommon.__doc__.replace('','Ochi') + """
+
+ Description
+ -----------
+ The Ochi transformation model is a monotonic exponential function,
+ calibrated such that the first 3 moments of the transformed model
+ G(y)=g^-1(y) match the moments of the true process. However, the
+ skewness is limited by ABS(SKEW)<2.82. According to Ochi it is
+ appropriate for a process with very strong non-linear characteristics.
+ The model is given as:
+ g(x) = ((1-exp(-gamma*(x-mean)/sigma))/gamma-mean2)/sigma2
+ where
+ gamma = 1.28*a for x>=mean
+ 3*a otherwise
+ mean,
+ sigma = standard deviation and mean, respectively, of the process.
+ mean2,
+ sigma2 = normalizing parameters in the transformed world, i.e., to
+ make the gaussian process in the transformed world is N(0,1).
+
+ The unknown parameters a, mean2 and sigma2 are found by solving the
+ following non-linear equations:
+
+ a*(sigma2^2+mean2^2)+mean2 = 0
+ sigma2^2-2*a^2*sigma2^4 = 1
+ 2*a*sigma2^4*(3-8*a^2*sigma2^2) = skew
+
+ Note
+ ----
+ Transformation, g, does not have continous derivatives of 2'nd order or higher.
+
+ Example
+ -------
+ #Simulate a Transformed Gaussian process:
+ Hm0=7;Tp=11;
+ S = jonswap([],[Hm0 Tp]); [sk ku ma]=spec2skew(S);
+ g = ochitr([],[Hm0/4,sk,ma]); g2=[g(:,1), g(:,2)*Hm0/4];
+ ys = spec2sdat(S,15000); % Simulated in the Gaussian world
+ xs = gaus2dat(ys,g2); % Transformed to the real world
+
+ See also
+ --------
+ spec2skew, hermitetr, lc2tr, dat2tr
+
+ References
+ ----------
+ Ochi, M.K. and Ahn, K. (1994)
+ 'Non-Gaussian probability distribution of coastal waves.'
+ In Proc. 24th Conf. Coastal Engng, Vol. 1, pp 482-496
+
+ Michel K. Ochi (1998),
+ "OCEAN WAVES, The stochastic approach",
+ OCEAN TECHNOLOGY series 6, Cambridge, pp 255-275.
+ """
+
+ def __init__(self,mean=0.0,var=1.0,skew=0.16,sigma=None):
+ if sigma is None:
+ sigma = sqrt(var)
+ self.mean = mean
+ self.sigma = sigma
+ self.skew = skew
+ self.phat = None
+ if abs(self.skew)>2.82842712474619:
+ raise ValueError('Skewness must be less than 2.82842')
+
+
+ def _par_from_stats(self):
+ skew = self.skew
+ ma = self.mean
+ sig1 = self.sigma
+
+ if skew==0:
+ self.phat = [0, 0, sig1, ma,1, 0];
+ return
+
+ #% Solve the equations to obtain the gamma parameters:
+ #%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #% a*(sig2^2+ma2^2)+ma2 = 0
+ #% sig2^2-2*a^2*sig2^4 = E(y^2) % =1
+ #% 2*a*sig2^4*(3-8*a^2*sig2^2) = E(y^3) % = skew
+
+ #% Let x = [a sig2^2 ]
+ #% Set up the 2D non-linear equations for a and sig2^2:
+ #g1='[x(2)-2.*x(1).^2.*x(2).^2-P1, 2.*x(1).*x(2).^2.*(3-8.*x(1).^2.*x(2))-P2 ]';
+ #% Or solve the following 1D non-linear equation for sig2^2:
+ g2 = lambda x: -sqrt(abs(x-1)*2)*(3.*x-4*abs(x-1))+abs(skew)
+
+
+ a1 = 1. #; % Start interval where sig2^2 is located.
+ a2 = 2.
+
+ sig22 = brentq(g2,a1,a2) #% smallest solution for sig22
+ a = sign(skew)*sqrt(abs(sig22-1)/2/sig22**2);
+
+ sig2 = sqrt(sig22);
+
+ #% Solve the following 2nd order equation to obtain ma2
+ #% a*(sig2^2+ma2^2)+ma2 = 0
+ my2 = (-1.-sqrt(1.-4.*a**2*sig22))/a; #% Largest mean
+ ma2 = a*sig22/my2 ; #% choose the smallest mean
+
+ gam_a = 1.28*a
+ gam_b = 3*a
+ # this is valid for processes with very strong
+ # nonlinear characteristics
+ self.phat = [gam_a, gam_b, sig1, ma, sig2, ma2];
+
+ return
+
+
+
+ def _dat2gauss(self,x):
+
+ if self.phat is None:
+ self._par_from_stats()
+
+ ga =self.phat[0];
+ gb = self.phat[1]
+ sigma = self.phat[2]
+ ma = self.phat[3]
+ sigma2 = self.phat[4]
+ ma2 = self.phat[5]
+
+
+
+
+ igp,=where(ma<=x);
+ igm,=where(x