1999-03-01  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* diagonalize.F: Removed Jacobi stuff.
	Checkout version from 28-Feb to get the code :-)
	(tql2): Optimized eigenvalue/-vector sorting ( using BLAS ).

	* svdfit.F (svbksb): Use BLAS-1 ddot.
	(svdvar): Use ** instead of explicit multiplication.

1999-02-26  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* derivatives.F (decalr): Square instead of explicit multiplication.

	* utility.F (vecsto): Use dcopy.

1999-02-25  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* utility.F (properr): Use dcopy instead of veccpy.
	(veccpy): Removed.

1999-02-13  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* utility.F (derapp): Took out this routine - it's not used at all.
	(ensto):  Took out this routine - it's not used at all, since we call
	BLAS-1 dcopy from arnical immediately now.

	* arnical.F (arnical): Call BLAS-1 dcopy immediately instead of ensto
	( two occurences ).

	* utility.F (chevec): Don't need the tmpvec any more, it was only used
	in cxchan. We use dswap from BLAS-1 instead of that grumpy cxchan now.
	(cxchan): Removed. Use BLAS-1 dswap instead.
	(matmat): Removed. Isn't used at all. Use BLAS-3 dgemm if you need the
 	functionality.
	(matsum): Use Kahan's method. If you want to calculate the sum to any
 	accuracy at all, you shouldn't just sum up elements. Their values
 	differ way to much.
	Make this a function returning the sum ( was a subroutine ).
	(properr): Change to use function matsum instead of subroutine.
	(delabs): Use BLAS-1 daxpy instead of manual loops.
	(ensto): Use BLAS-1 dcopy instead of manual loop.

	* Makefile.am (optimize-alpha), (optimize-pentium): Add $(BLASLIB) and
 	$(FLIBS) to libraries.

1999-02-12  Arnim Westphal  <westphal@uni-duesseldorf.de>
	
	* arnical.F, arni.F, inputOutput.F, parameterIO.F:
	The iterative process of fitting parameters to a set of assigned
	transitions is now automized. An integer parameter olitmx meaning
	the maximum number of complete iteration cycles ( i.e. transitions
	calculation + fit ) is appended to the old input file. In case of
	missing, the default value is 1 ( no automatic iteration ). The
	calculation stops when
	- olitmx iterations are done, or
	- a maximum relative change in parameter value below tol2
	  ( currently 1e-12 ) is reached, or
	- the last result is nonsense ( puzzled magnitudes of rigid rotor
	  constants ).

	Bug fixed concerning the fit to microwave data. If
	- idelta == 1  ( using Delta constants ),
	- all Delta values == 0,
	- all fit flags of excited state == 0, and
	- nuzero and corresponding fit flag == 0,
	the flag fitMW is set to 1, meaning that the task is interpreted as
	a simulation/fit of a microwave spectrum. Eigenvalues, eigenvectors
	and derivatives of the excited state are equated to those of the
	ground state ( no redundant recalculation ).

	Output of fitting results formatted in a convenient way.

1999-02-06  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* Makefile.am (libarni_a_METASOURCES): Use automoc. This also allows to
	use the dist target outside the srcdir. So we remove the dist-hook.
	(noinst_PROGRAMS): Generate a cumulated object file instead of a
 	library - speeds up the build process ! We do this by using an explicit
 	link line.
	(ETAGS_ARGS): Added.

1999-02-05  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* Makefile.am (krot_arnirot_LDADD): Put FASTMATHLIBS in front of FLIBS,
	since the FORTRAN intrisics library is static anyhow.

1999-02-03  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* build: Replaced all '#include <arni.h>' by '#include "arni.h"' to
 	allow to compile/build outside the source tree.

1999-01-19  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* Makefile.am (krot_arnirot_LDADD): Add FLIBS and FASTMATHLIBS to
 	krot_arnirot_LDADD.

1999-01-18  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* arnical.F (arnical): Moved several debugging outputs to use of the
 	ARNIROT_DEBUG macros.

	* arni.h: Added ARNIROT_DEBUG_VERBOSE macros.

1999-01-03  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* general: Removed all cvs Id entries and replaced them approbiatly.

1998-12-22  Arnim Westphal  <westphal@uni-duesseldorf.de>

        * general: Introduced program status flag stflag forcing the
        calculation to terminate in some cases of emergency.
        The real*8 factor fsrcor has been implemented to correct the
        assumed etalon FSR: FSR(exact) = fsrcor * FSR(assumed). Its value
        and the corresponding fitting switch are appended to the old input
        file, the number of model parameters now being 2*ARNIROT_NPAR + 2.
        If the value of fsrcor is to be fitted for, the problem is no longer
        a linear one, and it is solved by means of a Levenberg-Marquardt
        algorithm (not completely tested yet!).
        Did some reformatting of the source code (insertion of blanks into
        function calls etc.) for a better readability.

        * arnical.F: Removed some redundant matrix zeroing and added other
        explicit initializations due to program malfunction (zero values of
        linear rotational parameters or off-diagonal rot.const. tensor
        elements changed to non-zero and caused complex diagonalization).
        New flag flinht indicates the presence of hamiltonian terms which
        are linear in Jy and require a complex diagonalization.

        * derivatives.F (nrrde, j4, j2jz2, jz4, sdjde, sdkde): The values of
        the quartic Watson (A reduced) hamiltonian parameters DJ, DJK, DK,
        dJ, and dK can now be fitted for, yet restricted on REAL
        hamiltonians.

        * diagonalize.F (rotdip): Simplified diagonalization procedure for
        real hamiltonian matrices. Factorized Wang-transformed matrices are
        tridiagonal by nature and can be passed to tql2 without calling
        tred2 before. The necessary work place for submatrices, their
        eigenvalues and eigenvectors, is now kept local within this
        subroutine and removed from arnical. The subroutine interface is
        completed by parameter Jmxout for the output of submatrices
        (-DDEBUG_VERBOSE).

        * hamiltonian.F: Some subroutines that are exclusively needed for
        the calculation of derivatives have been moved to derivative.F

        * mrqfit.F: This implementation of the Levenberg-Marquardt algorithm
        ( from Numerical Recipes ) has been added to fit for an uncorrect
        etalon FSR (v.s.). The interface of subroutine gaussj is changed
        compared to the original NR code since the compiler complained about
        getting passed vector da(np) as one-dimensional matrix b(np,1).
        Subroutine covsrt is currently not used in accordance to the close
        packing of the covariance matrix for the linear SVD fit (covariances
        of the n varied parameters are put into the n first rows and
        columns).

1998-12-02  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* arnical.F (arnical): Started to document the interface, esp. add
	descriptions of all parameters (not completely done yet).

	* arnirot.h (class Arnirot): Added this message signal to send user
	information to the main window.

1998-10-19  Arnim Westphal  <westphal@uni-duesseldorf.de>

        * pqrBranch.F: Added new loop for the three types of transitions
        (a,b,c). Allowed combinations of states are directly addressed,
        selection rules don't need to be proved any longer.

1998-10-09  Arnim Westphal  <westphal@uni-duesseldorf.de>

        * parameterIO.F (lstars, lbars, ldash): These subroutines have been
        removed; separation lines ( in long output ) are now stored in
        character variables with the same name as the correspondent routine,
        created in setup.

1998-10-05  Arnim Westphal  <westphal@uni-duesseldorf.de>

        * general: source code is completely free from global common blocks.
        Following variables renamed:
        old name   new name   meaning
        branch     cBran      letter defining DeltaJ
        cdelta     (removed)
        delcon     cDRotC     symbols of Delta rotational constants
        rchare     cRotCe     symbols of rot. constants excited state
        rcharg     cRotCg     dto. ground state
        stacha     cState     strings defining state ('ground'/'excited')
        swacha     cEuler     names of Euler angles (for axis switching)

        * pqrBranch.F (pqr2): former subroutines pbran, qbran, rbran are
        condensed to pqr2, which is nearly the same as pqr, except for the
        loops over J and DeltaJ. These two values are additional parameters
        of pqr2 instead.
        (pqr), (pqr2): The if-clause taking care of DeltaK limitation has
        been replaced by a modified range of ies (tau') loop; hope it won't
        cause too much overhead!

        * parameterIO.F (transf): small bugfixes concerning order of
        transition dipole components.

1998-09-29  Arnim Westphal  <westphal@uni-duesseldorf.de>

        * general: new modular structure of the program; input -->
        calculation (arnical) --> output. These modules are called by the
        new main program arnimain. No shared 'common' variables, except
        between arnical and its subordinate routines.

        * parameterIO.F: contains no common blocks any longer. Old routines
        parinp and dattra renamed into paraIO and transf.

        * inputOutput.F: combines the new modules input and output (v.s.).

        * pBranch.F, qBranchF, rBranch.F: all routines/functions of these
        modules are put into pqrBranch.F, which further contains subroutine
        pqr comprising nearly all transition calculations ( the old extern J
        loop has been taken inside pqr ). Moderate code duplication to
        distinguish between real and complex eigenvectors, additional flag
        fcompl in subroutine call. Special cases R( 0 ) and P,Q( Jmxcal )
        are conventionally treated by [p-r]bran. pqr has its own routines
        cosze2, conma2, cosou2, trmou2, lsfou2 and intou2 working with
        3D cosine matrices ( third dimension is DeltaJ ).

        * quantumNumbers.F, vectorOffset.F: The two routines of these small
        modules have been moved into utility.F.

        * derivatives.F: dercal renamed into decalc for general derivative
        calculation including imaginary eigenvector components. The two last
        routine parameters ( real,imag ) were not independent, so they are
        combined to one ( re0im1, actually retaining the value of imag ).
        For 'simple' calculations ( real eigenvectors ) subroutine decalr is
        added, called only by rrde which has got the same additional flag as
        pqr (v.s.).

1998-09-24  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* arnirot.cc (Arnirot): Parsing of simulation results is working.
	Signal done is emitted correctly.

1998-09-23  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* utility.F (arnirot): Several small changes to enhance performance.
	Also renamed indices to col/row in the functions I worked on.

	* sup.cc (warn_): Added FORTRAN support function to print message to
 	stderr.
	(error_): This is similar, but exits the program with an error code
	after printing the message.

	* Makefile.am (optimize-alpha): 
	* Makefile.am (optimize-pentium): Added these targets to generate highly
	optimized arnirot executables for my alpha and pentium boxes.

	* pBranch.F (pbran): Change calculation of Boltzmann factor again, so
	the calculaiton is not split by an if.
	Also we do not check for temp2 == 0, only for weight == 0, because
 	otherwise ( weight != 0, temp2 == 0 ) it is a bug somewhere else.

	* .cvsignore: Add krot-arnirot-opt

1998-09-23  Arnim Westphal  <westphal@uni-duesseldorf.de>

	* pBranch.F (pbran):
	* qBranch.F (qbran):
	* rBranch.F (rbran): Put the additional Boltzman term for a
 	two-temperature model into an if clause. The old one line code gave
 	floating exception for higher J's.

1998-09-22  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* arnirot.cc (Arnirot): Startup/parameter passing of arnirot is working.
	Now parsing of arnirot output needs to be done.

	* arni.F (arnirot): Open stderr on the very beginning and close it at
	the end.

	* InputFile: Fixed format. ( transform transition moment vector shall
 	be an integer.)

1998-09-21  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* svdfit.F (svdvar): Removed old ( commented ) code because it is slower
	in any case ( since v is not symmetric ).

	* arni.F (arnirot): Reordered loops for initialization of v.

1998-09-21  Arnim Westphal  <westphal@uni-duesseldorf.de>

	* arni.F (arnirot): polg and polor renamed into polcal and polori, both
	stored in common block hybrid to prevent back calculation before writing
	new input file. Subroutine call to linout is put at the very end of the
	program because ( fitted ) parameters must be output first.
	
	* diagonalize.F (tql2): Changed semantic of ierr. Its value must be set
	to zero outside of this routine, and is incremented in case of an error.

	* general: Introduced switch shorti ( from SHORT Input ) which is 1 for
 	new IO format, else 0. Storage in common block IOform. Every regular
	message to be sent to stdout is suppressed if shorti = 1.
	Did some reorganization on common blocks.
 	
	* outputLines.F (linout): Rearranged parameters in subroutine call.
	Changed format of 'classical' lines output, leaving out some unimportant
	information.
	(symkhc): No longer needed, hence removed.

	* parameterIO.F (parinp): Read/write variable irpvar renamed to r0b1w2 
	( 0: read only; 1: both read and write [old format]; 2: write only [new
 	format] ).
	(dattra): Flags ifgs and ifes are renamed to fitgs and fites,
	respectively, and are only local variables in this subroutine. They are
	merged to the global fitting switch fitges ( formerly ifges ).
	(rwlin1): Added for reading ( and writing ) the first line of the input
	file.
	(rwflag): Added this routine to read/write an integer flag variable ( 1 
	for all values except zero ) in old IO format.
	(rw....): Changed semantic of ierr. This is set to zero in subroutine
 	dattra and incremented by one each time an error occurs.

	* readAssigned (expthe): Added check if experimental lines have been
	read at all to prevent segmentation fault on entering sort.

1998-09-18  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* hamiltonian.F (watson): Some optimizations.

1998-09-17  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* pBranch.F (select): Merged that whole function into one line ( well,
 	there are a few continuation syms in that line ). There are no explicit
	conditionals or loops anymore. Since it is somewhat messy, I kept it a
 	seperate function, and hope the compiler doesn't put the arguments on
 	the stack.
	(cosout), (trmout), (intout), (lsfout): Put each of this functions
 	bodies into #ifdef DEBUG_VERBOSE, what is the conditional they are used
	with, too. So we reduce code size ( and thus probably speed ).

	* derivatives.F (dercal): Some minor reordering. Renamed some variables
	to get rid of the attic FORTRAN type specifier within names.

	* utility.F (trwang): Added this subroutine for wang factorization.
 	Changed all calls from MAIN to use this routine instead of the general
 	thrmat, since we are much faster; I would say _more_ then ten times as
 	fast ! This is achieved by using the infos we do have on the matrices:
	- trans has elements on the diagonal and counter-diagonal only
	- mat is pentadiagonal
	For matrix dimensions < 5, we actually still call thrmat ourselfs, since
	it would impose some more ifs that are just hitting performance, and
 	these small matrices aren't a problem anyway.
	The elements in the corners of the matrices are handled seperatly by
	manually unrolled loops to not have ifs inside the loops.
	(bkwang): Did similar stuff for matmat.
	These two gave a _very_ great performance boost !

1998-09-16  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* utility.F (wang): Completely rewritten, much easier and a lot faster.

	* rotateHamiltonian.F (rotham): removed prod
	* arni.F (arnirot): removed promat
 	These are no longer needed, due to the interface changes of matmat and
 	thrmat.
	Also changed the calls to matmat / thrmat accordingly.

	* utility.F (matmat), (thrmat):
 	Took intermediate matrices out of declaration and made it "static"
 	local variables ( using common /scratch/ :-)
 	Speed optimizations like loop reordering for unit stride memory access.

	* general: New common block named scratch. This is supposed to be used
	for local matrices, don'T assume anything before you use it !
	
	* derivatives.F (dercal): Speed optimizations. Moved if out of loops,
	merged the iord == 0 calcualtions into less statements/calculations for
	real part, skipped it altogether for imaginary part.

	* diagReal.F (jacobi): 
	* utility.F (thrmat): This is the most important function for gprof !
	* svdfit.F (svdvar):
 	Some more loop interchanges for better memory access patterns.

	* arni.h: Added new debug macros ARNIROT_DEBUG_FIT, these are defined
	depending on DEBUG_FIT_OUTPUT. Added more ARNIROT_DEBUG macros ( to
 	include more parameter ).

1998-09-15  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* arnirot.cc (send): Really write "1" or "0" for the boolean values,
	we use ( cond ? 1: 0 ) for that.
	(send): Check for success of writeStdin, inform the user and quit
 	calculation otherwise.

	* Makefile.am: Don't define the path to KDEDIR/bin since we can get it
 	at runtime ( v.i. ).

	* arnirot.cc (Arnirot): Use kde_bindir() to get path to krot-arnirot.

1998-09-14  Arnim Westphal <westphal@uni-duesseldorf.de>

	* general: source code documentation and indention revised

	* general: names of variables changed
        old name   new name   meaning
	at         atmp       cf. arni.F
	eigv??     evec??     eigenvectors gs/es real/imaginary
	ener?      eval?      eigenvalues  gs/es
	iacpar     nparft     number of parameters to be fit
	ibfit      ifitpt     cf. arni.F
	idmx       dmham      max. dimension of hamiltonian matrix
	( idmxr )  dmfwng     max. dimension of hamiltonian submatrix
	ioff       iept       cf. arni.F
	iszvec     dmevec     max. dimension of eigenvector storage vector
	jaszsq     dmeval     max. dimension of eigenvalue storage vector
	jc         J          current J
	jcalma     Jmxcal     max. J in calculation
	jlim       Jmax       max. J (limiting array memory)
	jmoutp     Jmxout     max. J for detailed output
	klim/kord  dKmax      max. Delta K for calc. of transitions
	maline     maxnli     max. number of lines
	numlin     ntheli     number of theoretical lines
	prod1,
	trvec      promat     product matrix (trash)
	xint       intens     line intensity

	-Common blocks arrene and arrvec are renamed into evals and evecs.
	-Common block IO parameters are separated by their type (character,
	integer or real variables).

	* general: names of subroutines changed
	old name   new name   meaning
	cexch(o)              ( removed, since not used )
	iexch(o)              ( dto. )
	dcosd      cosdeg     cosine of argument in degrees (also sindeg)
	inerdef    ideferr    inertial defect, kappa and their uncertainties
	miexc(o)   imcpy(o)   integer number matrix copy (and order)
	mrexc(o)   rmcpy(o)   real number matrix copy (and order)
	pxderi     jxde       Jx derivatives (dto. jyde, jzde)
	pxfil      jx         Jx matrix elements (dto. jy, jz)
	pxpx       jx2        Jx**2 matrix elements (dto. jy2, jz2)
	pypxde     jyjxde     JyJx+JxJy derivatives (dto. jzjxde, jzjyde)
	pypxfi     jyjx       JyJx+JxJy matrix elements (dto. jzjx, jzjy)
	qnpack     qnpac1     pack quantum numbers (qnpac2 for subbranches)
	rexch(o)   rvcpy(o)   real number vector copy (and order)
	rrderi     rrde       rigid rotor derivatives
	vecload    veccpy     copy vector1 into vector2
	vectvec    vecvec     column vector * row vector = matrix

	* general: unused variables deleted
	name                  removed from subroutine(s)
	idebug, jasz          (all)
	itpar, npars, nrot    arnirot
	npars                 linout
	nums                  ?bran

	* arni.F:
	-Switches for fitting gs and es parameters (ifgs, ifes) are combined
	to ifges, which is 1 if at least one switch is non-zero, else 0.
	This was necessary because both ground and excited state derivatives
	have to be calculated to perform a proper fit. One switch should be
	enough!
	-modified hamiltonian diagonalization (cf. diagReal.F)
	-Redundant code within fitting section deleted.
	-Input file with updated parameter values (new.com) is created using
	compiler flag -DDEBUG_NEW_INPUT.

	* diagReal.F: New subroutine rotdip factorizes and diagonalizes the
	hamiltonian matrix in Wang basis, called automatically for
	non-switched rigid rotor caculations. Check if Wang hamiltonian can
	still be factorized when using Watson terms! Incorrectly sorted
	eigenvectors, resulting from numerically degenerate eigenvalues and
	formerly corrected by subroutine chevec, can't occur any longer!

	* outputLines.F: Allows you to create an additional lines output
	sorted by subbranches (-DDEBUG_SUBBRANCH_OUTPUT).

	* rotateHamiltonian.F: Completed by trigonometric functions sindeg
	and cosdeg from module trig.F (that has been removed now).

	* sort.F:
	-Variable nacols replaced by nparg and npare, the number of
	rotational model parameters actually used (determined in arnirot)
	-subroutines for vector/matrix copying renamed/removed.

	* svdfit.F: additional SVD information provided by -DDEBUG_FIT_OUTPUT.

	* writeMatrix.F: comprises former modules writeEigenvectors.F and
	writeHamiltonian.F with subroutines wrivec, wrimat.

1998-09-03  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* svdfit.F (svbksb): Loop interchange to speed up the code.

1998-09-02  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* svdfit.F (svdvar): Loop interchange to speed up the code.

1998-09-02  Arnim Westphal <westphal@uni-duesseldorf.de>

	* InputFile: Converted this to short input format. This is a
 	description of the machine generated input format to krot-arnirot.
	This format is used when atof( of the first line ) returns -1 ! Also a
	special output format is used then. This will be described in OutputFile
	what needs to be written.
	In any other case the old verbose input/output formats are used.

1998-08-31  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* arnirot.h (class Arnirot): Add send to write parameters to arnirots
 	stdin. This looks like a quick hack, so enhance it, if you can.

	* arni.F (arnirot): Use debug macros to provide that information.

	* arni.h: Added this file to provide debug macros for FORTRAN code.
	Please use these macros, put in more if you need them, but don't
 	hardcode debug output into the program, since the user doesn't need
	it, it just slows down the program.

1998-08-29  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* Makefile.am: All set up to generate a standalone calculation program
	plus a library containing a stub to fork and start the program, write
 	all parameter to its stdin and read its output.
	(FFLAGS): Define in here
	(krot_arnirot_LDADD): Add -lm to libs. These shouldnt be needed, but
 	it is with egcs-1.0.3.

1998-08-28  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* Makefile.am (CXXFLAGS): Add BINDIR definition to CXXFLAGS, so we know
	where to find arnirot.

	* arnirot.h (class Arnirot): Started this class to call the external
	programm arnirot and do communication with it.

	* general: Made this package part of krot.
	
1998-07-28  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* Makefile: Add -O3 to FFLAGS to get higher optimization
	(most important automatic inlining).
	Use libffm and libfm (highly optimized math libraries).

1998-07-28  Jochen Kpper  <jochen@uni-duesseldorf.de>

	* arnirot.F (yogirot): Initialization of icome, icomg to zero.

	* readAssigned.F (expthe): Initialization of itheor to zero.

	* svdfit.F (svdcmp): Added initialization of l and nm to zero.

