% Copyright 2024 SPC-EPFL
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
%     http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
% -----------------------------------------------------------------------

This folder contains two set of test files for the option NIDEAL=10.

Running CHEASE with the files contained in the subfolder 'input' will generate the outputs hamada.flnm.dat and neoart.flnm.dat with flnm = splus or tcv.snd1 the name of the test case. These outputs should be identical to the ones in the subfolder 'output_ref'.

As CHEASE is rather sensitive to the type of compiler and compilation options, a diff between the reference and newly generated files will be mostly useless. Instead, the routine 'chease_diff.m' in the 'matlab' subfolder can be used to make a diff of the files to a given accuracy. It can also be used to produce plots (remove the 'return' statement in the script).

The reference files were produced with CHEASE_90_9_3 on 9 June 2010.

If you suspect a problem with the option NIDEAL=10, please contact me: Yann Camenen, yann.camenen@univ-amu.fr

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
To run the tests:

export CHEASE_ROOT='your_chease_root_folder'  #this is the directory in which you have src-f90, WK, etc
export TEST_FILE='splus'    #can also be tcv.snd1
export NIDEAL10=$CHEASE_ROOT'/WK/TESTCASES/NIDEAL10'

cp $CHEASE_ROOT'/src-f90/chease' $NIDEAL10'/tmp/'
cp $NIDEAL10'/input/i.'$TEST_FILE $NIDEAL10'/tmp/chease_namelist'
cp $NIDEAL10'/input/EXPEQ.'$TEST_FILE $NIDEAL10'/tmp/EXPEQ'

cd $NIDEAL10'/tmp'
./chease



To compare to reference outputs (in matlab)

mv $NIDEAL10'/tmp/hamada.dat' $NIDEAL10'/tmp/hamada.'$TEST_FILE'.dat'
mv $NIDEAL10'/tmp/neoart.dat' $NIDEAL10'/tmp/neoart.'$TEST_FILE'.dat'
cd $CHEASE_ROOT'/matlab'
matlab

>> [H1,H2,Hdiff,N1,N2,Ndiff]=chease_diff(1e-4,'splus','../output_ref/','splus','../tmp/');

% remove the return command in chease_diff to do comparative plots


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

01.02.2012 - run test cases for r680
splus -> ok with th=1e-2,  except for fm4,fm5 and fm6 due to values close to zero
tcv.snd1 -> ok with th=1e-3

16.04.2012 - run test cases for r716
splus, tcv.snd1 -> broken, at least sign(psi) is wrong
