#!/bin/csh
#
# run the Boost-invariant BlastWave code with several parametersets
#
#

# NtermsQuantum is the number of terms in the quantum expansion of the boltzmann function
set NtermsQuantum = 2
set pTmin = 0.0
set pTmax = 2.0
set pTstep = 0.05


#  we will run 43 cases...
set Ncases = 43
# here are the default ("nominal") values
set Tnom      = 0.1
set rho0nom   = 0.9
set rho2nom   = 0.05
set Rynom     = 13.0
set Rxnom     = 11.0
set asnom     = 0.0001
set tau0nom   = 9.0
set deltaunom = 2.0
#
# now set all 43 cases to nominal...
set T      = $Tnom
set rho0   = $rho0nom
set rho2   = $rho2nom
set Ry     = $Rynom
set Rx     = $Rxnom
set as     = $asnom
set tau0   = $tau0nom
set deltau = $deltaunom
#
@ i = 2
while( $i <= $Ncases )
    set T      = ( $T      $Tnom     )
    set rho0   = ( $rho0   $rho0nom  )
    set rho2   = ( $rho2   $rho2nom  )
    set Ry     = ( $Ry     $Rynom    )
    set Rx     = ( $Rx     $Rxnom    )
    set as     = ( $as     $asnom    )
    set tau0   = ( $tau0   $tau0nom  )
    set deltau = ( $deltau $deltaunom)
    @ i++
end
#
# and now define how the parameters should vary in each case...
# first 11 cases are actually for azimuthally isotropic sources...
@ i = 1
while ( $i <= 11 )
    set Rx[$i] = 12.0416
    set Ry[$i] = 12.0416
    set rho2[$i] = 0
    @ i++
end
#
# case 1 is "default central" so no values need to be changed
set T[2] = 0.08
set T[3] = 0.12
set T[4] = 0.16

set rho0[5] = 0.7
set rho0[6] = 1.1

set rho0[7] = 0.845 as[7] = 0.1
set rho0[8] = 0.732 as[8] = 0.2
set rho0[9] = 0.612 as[9] = 0.3

set rho2[10] = 0.15
set rho2[11] = 0.15 Ry[11] = 1.5 Rx[11] = 1

# case 12 is "default peripheral" so no values need to be changed
set T[13] = 0.08
set T[14] = 0.12
set T[15] = 0.16

set rho0[16] = 0.7 Ry[16] = 12.0416 Rx[16] = 12.0416
set Ry[17] = 12.0416 Rx[17] = 12.0416
set rho0[18] = 1.1 Ry[18] = 12.0416 Rx[18] = 12.0416

set rho0[19] = 0.7
set rho0[20] = 1.1

set rho2[21] = 0.02 Ry[21] = 12.0416 Rx[21] = 12.0416
set rho2[22] = 0.1  Ry[22] = 12.0416 Rx[22] = 12.0416

set rho2[23] = 0
set rho2[24] = 0.02
set rho2[25] = 0.1

set rho2[26] = 0  Rx[26] = 1  Ry[26] = 1.05
set rho2[27] = 0  Rx[27] = 1  Ry[27] = 1.1
set rho2[28] = 0  Rx[28] = 1  Ry[28] = 1.15

set as[29] = 0.1   rho0[29] = 0.845   rho2[29] = 0.047   Ry[29] = 12.21   Rx[29] = 10.33
set as[30] = 0.3   rho0[30] = 0.612   rho2[30] = 0.034   Ry[30] =  8.84   Rx[30] =  7.48

set rho2[31] = 0  Ry[31] = 13.784  Rx[31] = 10

set Ry[32] = 12.0416 Rx[32] = 12.0416  rho2[32] = -0.02
set Ry[33] = 12.0416 Rx[33] = 12.0416  rho2[33] = 0.02

set rho2[34] = -0.05
set rho2[35] = -0.02
set rho2[36] =  0.02

set Ry[37] = 9.75  Rx[37] = 8.25
set Ry[38] = 19.5  Rx[38] = 16.55

set tau0[39] = 5
set tau0[40] = 15

set deltau[41] = 0
set deltau[42] = 8

set T[43] = 0.7

#------------------------------------------------------------------------
#
# The following bit just prints the parameter values to a file and the screen
#/bin/rm AllParameterSets.txt
#touch AllParameterSets.txt
@ i = 1
while( $i <= $Ncases )
#   echo    $i $T[$i] $rho0[$i] $rho2[$i] $Ry[$i] $Rx[$i] $tau0[$i] $deltau[$i] $as[$i] | awk '{ printf("%d    %4.2f    %4.2f     %4.2f     %6.3f   %6.3f   %4.1f   %4.1f     %4.1f\n",$1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> AllParameterSets.txt
   echo    $i $T[$i] $rho0[$i] $rho2[$i] $Ry[$i] $Rx[$i] $tau0[$i] $deltau[$i] $as[$i] | awk '{ printf("%d    %4.2f    %4.2f     %4.2f     %6.3f   %6.3f   %4.1f   %4.1f     %4.1f\n",$1,$2,$3,$4,$5,$6,$7,$8,$9)}'
    @ i++
end
#------------------------------------------------------------------------
#
# OK now do the calculations
###@ i = 1
@ i = 33
while( $i <= $Ncases )
    echo Working on Case $i of $Ncases
    /bin/rm input.inp
    cat > input.inp <<EOF
$Ry[$i]
$Rx[$i]
$T[$i]
$rho0[$i]
$rho2[$i]
$tau0[$i]
$as[$i]
$deltau[$i]
$NtermsQuantum
0
$pTmin $pTmax $pTstep
EOF
    ~lisa/MikesCommonPrograms/bin/BoostInvariantBlastWave.exe < input.inp
    mkdir Calc$i
    mv *BW Calc$i
    mv input.inp Calc$i
    mv define_title.kumac Calc$i
    @ i++
end
#


exit
#
