diff --git a/.gitmodules b/.gitmodules index f4bff585a..7456ce6f5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "lib/NAFFlib"] path = lib/NAFFlib url = https://github.com/SixTrack/NAFFlib +[submodule "lib/DISTlib"] + path = lib/DISTlib + url = https://github.com/SixTrack/DISTlib.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b962b3946..f18033648 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,7 +75,8 @@ option(TILT "Allow elements to be tilted (by error)" ON) option(CRLIBM "Use correctly rounded libmath instead of system libmath" ON) option(SIXDA "Build differential algebra version (NOT dynamic aperture!)" ON) option(STF "Single Track File: Write all tracks for postprocessing to fort.90 instead of 32 separate files fort.59 to fort.90. Required for >64 particles" ON) -option(NAFF "Link to external NAFFlib for FMA." ON) +option(NAFF "Link to external NAFFlib for FMA" ON) +option(DISTLIB "Link to external DISTlib for the beam distribution" ON) option(HASHLIB "Build the md5 hash library" ON) option(ZLIB "Build and link zlib. Needed for BOINC and ZIPF block" ON) @@ -277,7 +278,7 @@ set(SIXTRACK_BINARY_NAME_DA "SixDA_${NUM_VERSION}${GIT_BUILD}_${SIXTRACK_FEAT_DA ################################################################################################### list(APPEND PREPRO_FLAGS_TOOLS TILT BOINC BEAMGAS STF MERLINSCATTER G4COLLIMATION FLUKA CR PYTHIA NAFF) -list(APPEND PREPRO_FLAGS_LIB CRLIBM ROUND_NEAR ROUND_UP ROUND_DOWN ROUND_ZERO CERNLIB HDF5 FIO LIBARCHIVE ROOT HASHLIB ZLIB) +list(APPEND PREPRO_FLAGS_LIB CRLIBM ROUND_NEAR ROUND_UP ROUND_DOWN ROUND_ZERO CERNLIB HDF5 FIO LIBARCHIVE ROOT HASHLIB ZLIB DISTLIB) list(APPEND PREPRO_FLAGS_COMPILE GFORTRAN IFORT NAGFOR WIN32 DEBUG MEMUSAGE) ################################################################################################### @@ -908,8 +909,7 @@ if(${CMAKE_C_COMPILER_ID} MATCHES "Intel") endif() -#AppleClang -#Copied from GNU for now +# AppleClang if(${CMAKE_C_COMPILER_ID} MATCHES "AppleClang") if(${CMAKE_SYSTEM_PROCESSOR} MATCHES aarch64 ) @@ -968,7 +968,7 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g") if(LTO) -# set(CMAKE_CXX_LINK_EXECUTABLE "") + # set(CMAKE_CXX_LINK_EXECUTABLE "") set(CMAKE_Fortran_CXX_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto -Wl,-flto") endif(LTO) @@ -1231,6 +1231,44 @@ if(MERLINSCATTER) endif(64BIT) endif() +# Build DISTlib +if(DISTLIB) + if(NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/DISTlib/source/distinterface.c) + if(GIT_FOUND) + message(STATUS "Checking out DISTlib submodule") + execute_process( + COMMAND ${GIT_EXECUTABLE} submodule update --init lib/DISTlib + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE GIT_SUBMOD_RESULT + ERROR_QUIET + ) + if(NOT GIT_SUBMOD_RESULT EQUAL "0") + message(FATAL_ERROR "git submodule update --init lib/DISTlib failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") + endif() + else() + message(FATAL_ERROR "The git submodules DISTlib is not available. Please download it into lib/DISTlib") + endif() + endif() + + file(GLOB DIST_SOURCES ${CMAKE_SOURCE_DIR}/lib/DISTlib/source/*.c) + add_library(distlib STATIC ${DIST_SOURCES}) + target_include_directories(distlib PRIVATE ${CMAKE_SOURCE_DIR}/lib/DISTlib/source) + if(CRLIBM) + target_include_directories(distlib PRIVATE ${CMAKE_SOURCE_DIR}/source/crlibm) + target_include_directories(distlib PRIVATE ${CMAKE_SOURCE_DIR}/source/roundctl) + target_compile_options(distlib PRIVATE -DCRLIBM) + target_link_libraries(distlib crlibm roundctl) + endif() + + if(32BIT) + set_target_properties(distlib PROPERTIES LINK_FLAGS "-m32") + endif(32BIT) + if(64BIT) + set_target_properties(distlib PROPERTIES LINK_FLAGS "-m64") + endif(64BIT) + +endif(DISTLIB) + # Build NAFFlib if(NAFF) if(NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/NAFFlib/NAFFlib/interface/naff_sixtrack_interface.c) @@ -1484,6 +1522,10 @@ if(NAFF) target_link_libraries(SixTrackCore naff) endif(NAFF) +if(DISTLIB) + target_link_libraries(SixTrackCore distlib) +endif(DISTLIB) + #if we are using root, link to all the root libraries if(ROOT) target_link_libraries(SixTrackCore root_output) diff --git a/lib/DISTlib b/lib/DISTlib new file mode 160000 index 000000000..a0bf08f7d --- /dev/null +++ b/lib/DISTlib @@ -0,0 +1 @@ +Subproject commit a0bf08f7d81b7b2494d6046b9ad95df040b0bee1 diff --git a/lib/dist/demo/CMakeLists.txt b/lib/dist/demo/CMakeLists.txt deleted file mode 100644 index 0ab2fd733..000000000 --- a/lib/dist/demo/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.5) - -project(hello) -enable_language(Fortran) - -if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") - set(dialect "-ffree-form -std=f2008 -fimplicit-none") - set(bounds "-fbounds-check") -endif() - -set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${bounds}") -set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${dialect}") - -# -# Compile. -# -file(GLOB_RECURSE sources ../source/*.c ../source/*.h ../demo/*.f90) -add_executable(prog ${sources}) \ No newline at end of file diff --git a/lib/dist/demo/buildDemo.sh b/lib/dist/demo/buildDemo.sh deleted file mode 100755 index 9a6371ab5..000000000 --- a/lib/dist/demo/buildDemo.sh +++ /dev/null @@ -1,4 +0,0 @@ -mkdir -p buildDemo -cd buildDemo -cmake ../ -make \ No newline at end of file diff --git a/lib/dist/demo/data/tasm.txt b/lib/dist/demo/data/tasm.txt deleted file mode 100644 index 94eeea27b..000000000 --- a/lib/dist/demo/data/tasm.txt +++ /dev/null @@ -1 +0,0 @@ -5.730893019E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 3.320177742E-01 1.744928751E-01 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 2.976150736E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 -1.705736557E-01 3.360044865E-01 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 1.189182400E+01 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 0.000000000E+00 -1.046989058E-10 8.409138916E-02 diff --git a/lib/dist/demo/demodist.f90 b/lib/dist/demo/demodist.f90 deleted file mode 100644 index 31db1452f..000000000 --- a/lib/dist/demo/demodist.f90 +++ /dev/null @@ -1,103 +0,0 @@ - -subroutine readMatrixFromFile(matrix) - ! opening the file for reading - use, intrinsic :: iso_fortran_env - real(kind=real64), dimension(36) :: reada - real(kind=real64), dimension(6, 6) :: matrix - open (2, file = '../data/tasm.txt', status = 'old') - - - read(2,*) reada - matrix=RESHAPE(reada, shape(matrix) ) - close(2) - -end subroutine readMatrixFromFile - -program demodist - use, intrinsic :: iso_fortran_env - implicit none - - integer i ; - real(kind=real64), dimension(6) :: coordinates - real(kind=real64), dimension(2500,6) :: distribution1 - real(kind=real64), dimension(10002) :: x,xp,y, yp, sigma, delta - real(kind=real64) momentum, mass, one, e1,e2, e3, dp, betx1, zero, pia2, six - real(kind=real64), dimension(6, 6) :: identity, results, testm, tas - real(kind=real64) dim - - call readMatrixFromFile(tas) - dim = 6 - e1 = 1.0d0 - e2 = 2.0d0 - e3 = 0.03d0 - dp = 0.0001d0 - pia2 = 2.00d0*3.1415 - zero = 0.0d0 - momentum = 4000.0 - mass = 938.0 - one =1d0 - six = 6.000d0 - - - - - ! Initialize 3 distributions with dimenstion 6 - - call initializedistribution(3, 6) - ! Set the tas matrix - call settasmatrix(tas) - ! Set the emittance - call setemittance12(e1,e2) - - call setdeltap(dp) - ! Set mass and momentum - call setmassmom(mass, momentum) - - ! Set the parameters to generate the distribution - !1. (1=x, 2=x', 3=y 4=y', 5=ds 6=dp) - !2. Start value of scan - !3. End value of scan - !4. Number of points - !5. type of spacing 0 - constant, 3 - linear spacing - call setparameter(1,zero,six,100,3); - call setparameter(2,zero,zero,1,0); - call setparameter(3,zero,six,100,3); - call setparameter(4,zero,zero,1,0); - call setparameter(5,zero,zero,1,0); - call setparameter(6,zero,zero,1,0); - - !Print the settings mainly for debugging - call printdistsettings() - !Get the filled vectors - call getcoordvectors(x,xp,y, yp, sigma, delta) - - - - !Distribution 2: a matched distribution - - ! Change the distribution to 1 - call setdistribution(1) - call settasmatrix(tas) - call setemittance12(e1,e2) - call setemittance3(e3) - call setmassmom(mass, momentum) - - call setparameter(1,one,one,1,0); - call setparameter(2,zero,pia2,50,3); - call setparameter(3,one,one,1,0); - call setparameter(4,zero,pia2,50,3); - call setparameter(5,one,one,1,0); - call setparameter(6,zero,pia2,100,3); - - - do i = 0, 240!000 - call getcoord(coordinates,i) - - print *, coordinates - enddo - -!e1 from fort.10 1.999999999648927940E+00 -!e2 from fort.10 9.999999998426114534E-01 - - end program demodist - diff --git a/lib/dist/source/distr.c b/lib/dist/source/distr.c deleted file mode 100644 index 5ec571178..000000000 --- a/lib/dist/source/distr.c +++ /dev/null @@ -1,302 +0,0 @@ -#include -#include -#include -#include -#include "helper.h" -#include "distr.h" - - -struct distparam* dist; -struct distparam* diststart; -int dim; -int distn=0; - -void action2canonical_(double acangl[6], double cancord[6]){ - double acoord[6]; - acoord[0]= sqrt((dist->emitt->e1)*acangl[0])*cos(acangl[1]); - acoord[1]=-sqrt((dist->emitt->e1)*acangl[0])*sin(acangl[1]); - acoord[2]= sqrt((dist->emitt->e2)*acangl[2])*cos(acangl[3]); - acoord[3]=-sqrt((dist->emitt->e2)*acangl[2])*sin(acangl[3]); - acoord[4]= sqrt((dist->emitt->e3)*acangl[4])*cos(acangl[5]); - acoord[5]=-sqrt((dist->emitt->e3)*acangl[4]/1000)*sin(acangl[5]); - - //This is the multiplication with the tas matrix - mtrx_vector_mult_pointer(dim,dim, dist->tas, acoord,cancord); -} -void setdistribution_(int *ndist){ - dist = diststart + *ndist; -} -/* -Returns the total number of particles that will be created for the distribution. -*/ -int getnumberdist_(){ - double length = 1; - for(int j =0; jcoord[j]->length; - } - return length; -} - -void setemittance12_(double *e1, double *e2){ - dist->emitt->e1=*e1; - dist->emitt->e2=*e2; - -} - -void setemittance3_(double *e3){ - dist->emitt->e3=*e3; -} - -void calcualteinverse(){ - double invtas[6][6]; - double result[dim][dim]; - for(int i =0; i< dim; i++){ - for(int j =0; j< dim; j++){ - invtas[i][j] = dist->tas[i][j]; - } - } - - cofactor(invtas, 6); - for(int i =0; i< dim; i++){ - for(int j =0; j< dim; j++){ - dist->invtas[i][j]= invtas[i][j]; - } - } - -} - -void addclosedorbit_(double *clo){ - for(int i=0; iclosedorbit[i] = clo[i]; - } - -} - -void setdeltap_(double *dp){ - convertdp2emittance(*dp); -} - -//This emittance is oversimplified but gives a good approximation. -void convertdp2emittance(double dp){ - calcualteinverse(); - dist->emitt->e3 = pow(1000*dp*dist->invtas[5][5],2); - -} - -/* -Initalizes the distributinos -*/ -void initializedistribution_(int *numberOfDist, int *dimension){ - dist = (struct distparam*)malloc((*numberOfDist)*sizeof(struct distparam)); - dim = *dimension; - - for(int i = 0; i <*numberOfDist; i++) - { - struct parameters para_tmp; - (dist + i)->coord = (struct parameters**)malloc(dim*sizeof(struct parameters*)); - (dist + i)->emitt = (struct emittances*)malloc(sizeof(struct emittances)); - (dist + i)->tas = (double**)malloc(dim*sizeof(double*)); - (dist + i)->invtas = (double**)malloc(dim*sizeof(double*)); - (dist + i)->closedorbit = (double*)malloc(dim*sizeof(double)); - (dist + i)->isDistrcalculated = 0; - - for(int k=0; ktas[k] =(double*)malloc(dim*sizeof(double)); - (dist + i)->invtas[k] =(double*)malloc(dim*sizeof(double)); - } - - (dist + i)->mass = 0; - (dist + i)->momentum = 0; - (dist + i)->emitt->e1 = 0; - (dist + i)->emitt->e2 = 0; - (dist + i)->emitt->e3 = 0; - (dist + i)->coordtype =-1; - - for(int j=0; jcoord[j] = (struct parameters*)malloc(sizeof(struct parameters)); - (dist +i)->coord[j]->start=0; - (dist +i)->coord[j]->stop=0; - (dist +i)->coord[j]->length=1; - (dist +i)->coord[j]->type=0; - (dist +i)->closedorbit[j]=0; - } - } - diststart=dist; -} - -void printdistsettings_(int *ndist){ - printf("Printing info about distribution: \n"); - printf("Distribution type (input), 1=normalized coordinates %d \n", dist->coordtype ); - printf("Mass: %f \n", dist ->mass); - printf("Momentum: %f \n", dist ->momentum); - printf("Emttiance, e1, e2, e3: %f, %f, %f \n", dist->emitt->e1, dist->emitt->e2, dist->emitt->e3); - for(int j=0; jcoord[j]->start); - printf("stop: %f \n", (dist)->coord[j]->stop); - printf("length: %d \n", (dist)->coord[j]->length); - printf("type: %d \n", (dist)->coord[j]->type); - printf("######################### \n"); - } - -} - -void settasmatrix_(double tas[6][6]){ - for(int i =0; i< dim; i++){ - for(int j =0; j< dim; j++){ - dist->tas[i][j] = tas[i][j]; - } - } -} - -void getcoordvectors_(double *x, double *xp, double *y, double *yp, double *sigma, double *delta){ - int distlen = getnumberdist_(); - if(dist->isDistrcalculated==0){ - dist2sixcoord_(); - } - for(int i=0; idistout[i][0]; - xp[i] = dist->distout[i][1]; - y[i] = dist->distout[i][2]; - yp[i] = dist->distout[i][3]; - sigma[i] = dist->distout[i][4]; - delta[i] = dist->distout[i][5]; - } - -} -void dist2sixcoord_(){ - int counter = 0; - double tc[6]; - double tmp[6]; - dist->distout = (double**)malloc(getnumberdist_()*sizeof(double*)); - for(int i =0; i< dist->coord[0]->length; i++){ - for(int j =0; j< dist->coord[1]->length; j++){ - for(int k =0; k< dist->coord[2]->length; k++){ - for(int l =0; l< dist->coord[3]->length; l++){ - for(int m =0; m< dist->coord[4]->length; m++){ - for(int n =0; n< dist->coord[5]->length; n++){ - dist->distout[counter] = (double*)malloc(dim*sizeof(double)); - tc[0]=dist->coord[0]->values[i]+dist->closedorbit[0]; - tc[1]=dist->coord[1]->values[j]+dist->closedorbit[1]; - tc[2]=dist->coord[2]->values[k]+dist->closedorbit[2]; - tc[3]=dist->coord[3]->values[l]+dist->closedorbit[3]; - tc[4]=dist->coord[4]->values[m]+dist->closedorbit[4]; - tc[5]=dist->coord[5]->values[n]+dist->closedorbit[5]; - action2sixinternal_(tc, tmp); - for(int p=0; pdistout[counter][p] = tmp[p]; - } - - counter++; - - } - } - } - } - } - } - dist->isDistrcalculated=1; -} - -void getcoord_(double *coordinate, int *initial ){ - - if(dist->isDistrcalculated==0){ - dist2sixcoord_(); - - } - if(*initial >= getnumberdist_()){ - printf("Not generated, total inital coordinates generated is %f:",getnumberdist_() ); - for(int i=0; idistout[*initial][i]; - } -} - -void setmassmom_(double *mass, double *momentum){ - (dist)-> mass = *mass; - (dist)-> momentum = *momentum; -} - -void setparameter_(int *index, double *start, double *stop, int *length, int *type){ - - dist->coord[*index-1]->start = *start; - dist->coord[*index-1]->stop = *stop; - dist->coord[*index-1]->length = *length; - dist->coord[*index-1]->type = *type; - if(*type ==0){ //Constant value - dist->coord[*index-1]->values = (double*)malloc(sizeof(double)); - dist->coord[*index-1]->values = start; - } - - if(*type > 0){ //Allocate space for the array - dist->coord[*index-1]->values = (double*)malloc((*length)*sizeof(double)); - memcpy(dist->coord[*index-1]->values , start, sizeof(double)); - - } - if(*type==1){ //Linearly spaced intervalls - createLinearSpaced(*length, *start, *stop,dist->coord[*index-1]->values); - } - if(*type==2){ //Exponentially spaced - createLinearSpaced(*length, *start, *stop,dist->coord[*index-1]->values); - for(int i=0;i <*length; i++){ - - dist->coord[*index-1]->values[i] = exp(dist->coord[*index-1]->values[i]); - } - } - if(*type==3){ //Spaced with ^2 - createLinearSpaced(*length, *start, *stop,dist->coord[*index-1]->values); - for(int i=0;i <*length; i++){ - dist->coord[*index-1]->values[i] = pow(dist->coord[*index-1]->values[i],2); - - } - - } - -} - -void createtas0coupling_(double betax, double alfax, double betay, double alfay){ - - for (int i = 0; i < 6; i++) - { - for (int k = 0; k < 6; k++) - { - dist->tas [i][k] = 0; - - } - } - - dist->tas[0][0] = sqrt(betax); - dist->tas[2][2] = sqrt(betay); - dist->tas[1][2] =-alfax/sqrt(betax); - dist->tas[4][3] =-alfay/sqrt(betay); - -} - -void action2sixinternal_(double tc[6], double *results){ - double cancord[6]; - if(checkdist) - { - action2canonical_(tc, cancord); - canonical2six_(cancord, &dist->momentum, &dist->mass, results); - } -} - -int checkdist(){ - double eps =1e-16; - if(dist->momentum < eps && dist->momentum < eps ){ - printf("Momentum and mass needs to be set"); - return 0; - } - if(dist->tas[0][0] < eps){ - printf("Tas matrix need to be set"); - return 0; - } - return 1; - -} \ No newline at end of file diff --git a/lib/dist/source/distr.h b/lib/dist/source/distr.h deleted file mode 100644 index 8bcb34944..000000000 --- a/lib/dist/source/distr.h +++ /dev/null @@ -1,46 +0,0 @@ -struct distparam -{ - struct parameters** coord; - struct emittances* emitt; - double mass; - double momentum; - double **tas; - double **invtas; - double *closedorbit; - int coordtype; // This tells which type of coordinates the input is given. // 1-Normalized - double **distout; - int isDistrcalculated; -}; - -struct parameters -{ - double start; - double stop; - int length; - int type; //This gives the type of distribution, constant, linear, gaussian, - double * values; -}; - -struct emittances{ - double e1, e2, e3; -}; - - -void action2canonical_(double tc[6], double cancord[6]); -void setdistribution_(int *ndist); -int getnumberdist_(); -void setemittance12_(double *e1, double *e2); -void setemittance3_(double *e3); -void initializedistribution_(int *numberOfDist, int *dimension); -void printdistsettings_(int *ndist); -void addclosedorbit_(double *clo); -void settasmatrix_(double tas[6][6]); -void dist2sixcoord_(); -void setmassmom_(double *mass, double *momentum); -void setparameter_(int *index, double *start, double *stop, int *length, int *type); -void setdeltap_(double *dp); -void convertdp2emittance(double dp); -void setemittance3_(double *e3); -void createTasWithNoCoupling(double betax, double alfax, double betay, double alfay, double tas[6][6]); -void action2sixinternal_(double tc[6], double results[6]); -int checkdist(); \ No newline at end of file diff --git a/lib/dist/source/helper.c b/lib/dist/source/helper.c deleted file mode 100644 index 590c93d21..000000000 --- a/lib/dist/source/helper.c +++ /dev/null @@ -1,257 +0,0 @@ -#include -#include -#include -#include -#include "helper.h" -void six2canonical_(double * coord, double *ref_momentum, double *mass, double *canonical){ - - double deltap = *(coord+5); - double beta0 = *ref_momentum/momentum2energy(*ref_momentum, *mass); - double beta = (*ref_momentum+deltap)/momentum2energy((*ref_momentum)+deltap, *mass); - double rv = beta0/beta; - - *(canonical+0) = *(coord+0); - *(canonical+1) = *(coord+1)*(1+deltap); - *(canonical+2) = *(coord+2); - *(canonical+3) = *(coord+3)*(1+deltap); - *(canonical+4) = *(coord+4)/rv; - *(canonical+5) = *(coord+5); - -} - -void -canonical2six_(double *canonical, double *ref_momentum, double *mass, double *coord){ - - double deltap = *(canonical+5); - double beta0 = *ref_momentum/momentum2energy(*ref_momentum, *mass); - double beta = (*ref_momentum+deltap)/momentum2energy((*ref_momentum)+deltap, *mass); - double rv = beta0/beta; - *(coord+0) = *(canonical+0); - *(coord+1) = *(canonical+1)/(1+deltap); - *(coord+2) = *(canonical+2); - *(coord+3) = *(canonical+3)/(1+deltap); - *(coord+4) = *(canonical+4)*rv; - *(coord+5) = *(canonical+5); -} -double rationalApproximation(double t) -{ - // Abramowitz and Stegun formula 26.2.23. - // The absolute value of the error should be less than 4.5 e-4. - double c[] = {2.515517, 0.802853, 0.010328}; - double d[] = {1.432788, 0.189269, 0.001308}; - return t - ((c[2]*t + c[1])*t + c[0]) / - (((d[2]*t + d[1])*t + d[0])*t + 1.0); -} - -double normalcdfinv_(double p) -{ - printf("printing %f", p); - if (p <= 0.0 || p >= 1.0) - { - return 0; - } - - // See article above for explanation of this section. - if (p < 0.5) - { - // F^-1(p) = - G^-1(p) - return -rationalApproximation( sqrt(-2.0*log(p)) ); - } - else - { - // F^-1(p) = G^-1(1-p) - return rationalApproximation( sqrt(-2.0*log(1-p)) ); - } -} - -void createLinearSpaced(int length, double start, double stop, double *eqspaced ){ - - double distance = (stop-start)/length; - for(int i; i * Tracking variables" flush(crlog) read(cr_pntUnit(nPoint),iostat=ioStat) crnumlcr,crnuml,crsixrecs,crbinrec,cril,cr_time,crnapxo, & - crnapx,cre0,crbetrel,crbrho,crnucmda + crnapx,cre0,crbeta0,crbrho,crnucmda if(ioStat /= 0) cycle write(crlog,"(a)") "CR_CHECK> * Particle arrays" @@ -634,7 +634,7 @@ subroutine crpoint write(crlog,"(a)") "CR_POINT> * Tracking variables" flush(crlog) end if - write(cr_pntUnit(nPoint),err=100) crnumlcr,numl,sixrecs,binrec,il,time3,napxo,napx,e0,betrel,brho,nucmda + write(cr_pntUnit(nPoint),err=100) crnumlcr,numl,sixrecs,binrec,il,time3,napxo,napx,e0,beta0,brho,nucmda if(st_debug) then write(crlog,"(a)") "CR_POINT> * Particle arrays" @@ -781,7 +781,7 @@ subroutine crstart napx = crnapx e0 = cre0 e0f = sqrt(e0**2-nucm0**2) - betrel = crbetrel + beta0 = crbeta0 brho = crbrho nucmda = crnucmda diff --git a/source/collimation.f90 b/source/collimation.f90 index 6e8e36b23..092c59720 100644 --- a/source/collimation.f90 +++ b/source/collimation.f90 @@ -1861,7 +1861,7 @@ subroutine collimate_start yv2(1:napx) = c1e3 * yv2(1:napx) + torbyp(1) end if - call part_updatePartEnergy(1) + call part_updatePartEnergy(1,.false.) do i=1,napx do ieff=1,numeff diff --git a/source/common_modules.f90 b/source/common_modules.f90 index bd8c45ca2..21da258bd 100644 --- a/source/common_modules.f90 +++ b/source/common_modules.f90 @@ -325,8 +325,7 @@ module mod_common real(kind=fPrec), save :: emitx = zero ! Horisontal emittance real(kind=fPrec), save :: emity = zero ! Vertical emittance real(kind=fPrec), save :: emitz = zero ! Longitudinal emittance - real(kind=fPrec), save :: gammar = one ! Gamma factor - real(kind=fPrec), save :: betrel = zero ! Relativistic beta of beam + real(kind=fPrec), save :: gammar = one ! Inverse Lorentz factor real(kind=fPrec), save :: brho = zero ! magnetic rigitidy of beam [Tm] integer, save :: ibb6d = 0 ! 6D beam-beam switch integer, save :: nbeam = 0 ! Beam-beam elements flag @@ -353,6 +352,8 @@ module mod_common real(kind=fPrec), save :: e0f = zero ! Reference momentum [MeV/c] real(kind=fPrec), save :: nucm0 = pmap ! Reference mass [MeV/c^2] real(kind=fPrec), save :: nucmda = pmap ! Reference mass [MeV/c^2] (DA) + real(kind=fPrec), save :: gamma0 = one ! Reference beam Lorentz factor + real(kind=fPrec), save :: beta0 = zero ! Reference beam relativistic beta integer(kind=int16), save :: aa0 = 1 ! Reference nucleon number integer(kind=int16), save :: zz0 = 1 ! Reference charge multiplicity integer(kind=int16), save :: qq0 = 1 ! Reference charge diff --git a/source/dynk.f90 b/source/dynk.f90 index 2c9fcc97b..e16660d7b 100644 --- a/source/dynk.f90 +++ b/source/dynk.f90 @@ -2072,7 +2072,7 @@ recursive real(kind=fPrec) function dynk_computeFUN(funNum, turn) result(retval) call recuut(tmpseed1,tmpseed2) call recuin(dynk_iData(dynk_funcs(funNum,3)+3),dynk_iData(dynk_funcs(funNum,3)+4)) ! Run generator for 1 value with current mcut - call ranecu(ranecu_rvec,1,dynk_iData(dynk_funcs(funNum,3)+2)) + call ranecu(ranecu_rvec, 1, 1, real(dynk_iData(dynk_funcs(funNum,3)+2),kind=fPrec)) ! Save our current seeds and load old seeds call recuut(dynk_iData(dynk_funcs(funNum,3)+3),dynk_iData(dynk_funcs(funNum,3)+4)) call recuin(tmpseed1,tmpseed2) @@ -2083,8 +2083,8 @@ recursive real(kind=fPrec) function dynk_computeFUN(funNum, turn) result(retval) ! Save old seeds and load our current seeds call recuut(tmpseed1,tmpseed2) call recuin(dynk_iData(dynk_funcs(funNum,3)+2),dynk_iData(dynk_funcs(funNum,3)+3)) - ! Run generator for 1 value with mcut=-1 - call ranecu( ranecu_rvec, 1, -1 ) + ! Run generator for 1 value in uniform mode + call ranecu(ranecu_rvec, 1, 0) ! Save our current seeds and load old seeds call recuut(dynk_iData(dynk_funcs(funNum,3)+2),dynk_iData(dynk_funcs(funNum,3)+3)) call recuin(tmpseed1,tmpseed2) @@ -2094,14 +2094,14 @@ recursive real(kind=fPrec) function dynk_computeFUN(funNum, turn) result(retval) ! Save old seeds and load our current seeds call recuut(tmpseed1,tmpseed2) call recuin(dynk_iData(dynk_funcs(funNum,3)+2),dynk_iData(dynk_funcs(funNum,3)+3)) - ! Run generator for 1 value with mcut=-1 - call ranecu( ranecu_rvec, 1, -1 ) + ! Run generator for 1 value in uniform mode + call ranecu(ranecu_rvec, 1, 0) ! Save our current seeds and load old seeds call recuut(dynk_iData(dynk_funcs(funNum,3)+2),dynk_iData(dynk_funcs(funNum,3)+3)) call recuin(tmpseed1,tmpseed2) ! routine for switching element (orginially the electron lens) ON or OFF ! when random value is less than P, set ON, else OFF - if (ranecu_rvec(1) .lt. dynk_fData(dynk_funcs(funNum,4))) then + if(ranecu_rvec(1) .lt. dynk_fData(dynk_funcs(funNum,4))) then retval = 1.0 else retval = 0.0 diff --git a/source/elens.f90 b/source/elens.f90 index aa8155bc4..0b17c20cb 100644 --- a/source/elens.f90 +++ b/source/elens.f90 @@ -452,7 +452,7 @@ subroutine eLensTheta(j) use mathlib_bouncer use numerical_constants, only : zero, one, two, pi, c1e3, c1m3, c1m6 use physical_constants, only: clight, pmae, eps0 - use mod_common, only : e0, betrel, brho, bez, kz, zz0 + use mod_common, only : e0, beta0, brho, bez, kz, zz0 use mod_settings, only : st_quiet implicit none @@ -471,9 +471,9 @@ subroutine eLensTheta(j) elens_theta_r2(j) = ((elens_len(j)*abs(elens_I(j)))/ & ((((two*pi)*((eps0*clight)*clight))*brho)*(elens_r2(j)*c1m3)))*c1e3 if(elens_I(j) < zero) then - elens_theta_r2(j) = elens_theta_r2(j)*(one/(elens_beta_e(j)*betrel)+one) + elens_theta_r2(j) = elens_theta_r2(j)*(one/(elens_beta_e(j)*beta0)+one) else - elens_theta_r2(j) = elens_theta_r2(j)*(one/(elens_beta_e(j)*betrel)-one) + elens_theta_r2(j) = elens_theta_r2(j)*(one/(elens_beta_e(j)*beta0)-one) end if if ( elens_type(j)>=2 ) elens_theta_r2(j) = elens_theta_r2(j) * elens_geo_norm(j) diff --git a/source/include/kickelens.f90 b/source/include/kickelens.f90 index 93b7609e7..7d938820e 100644 --- a/source/include/kickelens.f90 +++ b/source/include/kickelens.f90 @@ -46,9 +46,9 @@ frrelens = (((elens_theta_r2(ielens(ix))*elens_r2(ielens(ix)))/rrelens)*frrelens)*moidpsv(j) if(elens_lThetaR2(ielens(ix))) then if(elens_I(ielens(ix)) < zero) then - frrelens = frrelens*((rvv(j)+elens_beta_e(ielens(ix))*betrel)/(one+elens_beta_e(ielens(ix))*betrel)) + frrelens = frrelens*((rvv(j)+elens_beta_e(ielens(ix))*beta0)/(one+elens_beta_e(ielens(ix))*beta0)) else - frrelens = frrelens*((rvv(j)-elens_beta_e(ielens(ix))*betrel)/(one-elens_beta_e(ielens(ix))*betrel)) + frrelens = frrelens*((rvv(j)-elens_beta_e(ielens(ix))*beta0)/(one-elens_beta_e(ielens(ix))*beta0)) end if endif yv1(j)=yv1(j)-(frrelens*xelens)/rrelens diff --git a/source/main_cr.f90 b/source/main_cr.f90 index 4d198920d..8a2ac4639 100644 --- a/source/main_cr.f90 +++ b/source/main_cr.f90 @@ -973,18 +973,14 @@ program maincr end do rat0 = rat + call part_setParticleID ! Must be set before reading DIST if(dist_enable) then ! DIST Block - call dist_readDist - call dist_finaliseDist - call part_applyClosedOrbit - if(dist_echo) then - call dist_echoDist - end if + call dist_generateDist elseif(rdfort13) then ! Restart from fort.13 call readFort13 - call part_updatePartEnergy(1) + call part_updatePartEnergy(1,.false.) else ! Generated from INIT Distribution Block do ia=1,napx,2 @@ -1252,7 +1248,6 @@ program maincr ! START OF TRACKING ! ---------------------------------------------------------------------------- ! write(lout,10200) - call part_setParticleID if(st_iStateWrite) then if(st_iStateText) then diff --git a/source/mod_dist.f90 b/source/mod_dist.f90 index 7db97bcaa..3ecd05bbe 100644 --- a/source/mod_dist.f90 +++ b/source/mod_dist.f90 @@ -1,256 +1,1971 @@ ! ================================================================================================ ! +! +! Beam Distribution Block +! ~~~~~~~~~~~~~~~~~~~~~~~~~ +! ! A. Mereghetti and D. Sinuela Pastor, for the FLUKA Team ! V.K. Berglyd Olsen, BE-ABP-HSS -! Last modified: 2018-10-30 -! Read a beam distribution -! -! Format of the input file: -! id: unique identifier of the particle (integer) -! gen: parent ID (integer) -! weight: statistical weight of the particle (double: >0.0) -! x, y, s: particle position [m] -! xp, yp, zp: particle direction (tangents) [] -! aa, zz: mass and atomic number -! m: rest mass [GeV/c2] -! pc: particle momentum [GeV/c] -! dt: time delay with respect to the reference particle [s] +! Updated: 2019-07-12 ! -! aa,zz and m are now taken into account for hisix! +! This module was completely rewritten to support DISTlib in July 2019 ! -! NOTA BENE: -! - id, gen and weight are assigned by the fluka_mod_init subroutine; -! - z and zp are actually useless (but we never know); -! - in case the file contains less particle than napx, napx is re-assigned +! ================================================================================================ ! +module mod_dist + + use crcoall + use floatPrecision + use parpro, only : mFileName + use numerical_constants, only : zero, one + + implicit none + + logical, public, save :: dist_enable = .false. ! DIST input block given + logical, private, save :: dist_echo = .false. ! Echo the read distribution? + logical, private, save :: dist_hasFormat = .false. ! Whether the FORMAT keyword exists in block or not + logical, private, save :: dist_libRead = .false. ! Read file with dist library instead of internal reader + logical, private, save :: dist_distLib = .false. ! DISTlib is needed to generate the distribution requested + logical, private, save :: dist_distLibNorm = .true. ! DISTlib is used to convert normalised coordinates + character(len=mFileName), private, save :: dist_distFile = " " ! File name for reading the distribution + character(len=mFileName), private, save :: dist_echoFile = " " ! File name for echoing the distribution + + integer, allocatable, private, save :: dist_colFormat(:) ! The column types in the FORMAT + real(kind=fPrec), allocatable, private, save :: dist_colScale(:) ! Scaling factor for the columns + integer, private, save :: dist_nColumns = 0 ! The number of columns in the FORMAT + + character(len=:), allocatable, private, save :: dist_partLine(:) ! PARTICLE definitions in the block + integer, private, save :: dist_nParticle = 0 ! Number of PARTICLE keywords in block + + integer, private, save :: dist_numPart = 0 ! Number of actual particles generated or read + integer, private, save :: dist_seedOne = -1 ! Random seeds + integer, private, save :: dist_seedTwo = -1 ! Random seeds + + type, private :: dist_fillType + character(len=:), allocatable :: fillName + integer :: fillTarget = 0 + integer :: fillMethod = 0 + integer, allocatable :: iParams(:) + real(kind=fPrec), allocatable :: fParams(:) + end type dist_fillType + + type(dist_fillType), allocatable, private, save :: dist_fillList(:) + integer, private, save :: dist_nFill = 0 + + ! Fill Methods + ! =============== + integer, parameter :: dist_fillNONE = 0 ! No fill + integer, parameter :: dist_fillINT = 1 ! Fixed integer value + integer, parameter :: dist_fillFLOAT = 2 ! Fixed float value + integer, parameter :: dist_fillGAUSS = 3 ! Gaussian distribution + integer, parameter :: dist_fillUNIFORM = 4 ! Uniform distribution + integer, parameter :: dist_fillLINEAR = 5 ! Linear fill + integer, parameter :: dist_fillCOUNT = 6 ! Integer range + + ! Normalisation Methods + ! ======================= + integer, parameter :: dist_normNONE = 0 ! No normalisation + integer, parameter :: dist_normSIXTRACK = 1 ! Use SixTrack tas matrix + integer, parameter :: dist_normINPUT = 2 ! Use matrix in DIST block + integer, parameter :: dist_normTWISS = 3 ! Use twiss in DIST block + + integer, private, save :: dist_normMethod = dist_normSIXTRACK ! Flag for source of normalisation matrix + integer, private, save :: dist_tMatRow = 0 ! How many T-matrix rows we've read + real(kind=fPrec), private, save :: dist_tMat(6,6) = zero ! T-matrix to use for normalisation + real(kind=fPrec), private, save :: dist_twBeta(2) = one ! Twiss beta + real(kind=fPrec), private, save :: dist_twAlpha(2) = zero ! Twiss alpha + real(kind=fPrec), private, save :: dist_bDisp(4) = zero ! Dispersion + real(kind=fPrec), private, save :: dist_beamEmit(3) = zero ! Beam emittance + integer, private, save :: dist_emit3Unit = 0 ! Flag for converting longitudinal emittance + + ! Column Formats + ! ================ + integer, parameter :: dist_fmtNONE = 0 ! Column ignored + integer, parameter :: dist_fmtPartID = 1 ! Paricle ID + integer, parameter :: dist_fmtParentID = 2 ! Particle parent ID (for secondary particles, otherwise equal particle ID) + + ! Physical Coordinates + integer, parameter :: dist_fmtX = 11 ! Horizontal position + integer, parameter :: dist_fmtY = 12 ! Vertical positiom + integer, parameter :: dist_fmtXP = 13 ! Horizontal momentum ratio Px/|P| + integer, parameter :: dist_fmtYP = 14 ! Vertical momentum ratio Py/|P| + integer, parameter :: dist_fmtPX = 15 ! Horizontal momentum + integer, parameter :: dist_fmtPY = 16 ! Vertical momentum + integer, parameter :: dist_fmtPXP0 = 17 ! Horizontal momentum Px/P0 + integer, parameter :: dist_fmtPYP0 = 18 ! Vertical momentum Py/P0 + integer, parameter :: dist_fmtZETA = 19 ! Longitudinal relative position (canonical) + integer, parameter :: dist_fmtSIGMA = 20 ! Longitudinal relative position + integer, parameter :: dist_fmtDT = 21 ! Time delay + integer, parameter :: dist_fmtE = 22 ! Particle energy + integer, parameter :: dist_fmtP = 23 ! Particle momentum + integer, parameter :: dist_fmtDEE0 = 24 ! Relative particle energy (to reference particle) + integer, parameter :: dist_fmtDPP0 = 25 ! Relative particle momentum (to reference particle) + integer, parameter :: dist_fmtPT = 26 ! Delta energy over reference momentum (Pt) + integer, parameter :: dist_fmtPSIGMA = 27 ! Delta energy over reference momentum, but without beta0 + + ! Normalised Coordinates + integer, parameter :: dist_fmtXN = 41 ! Normalised horizontal position + integer, parameter :: dist_fmtYN = 42 ! Normalised vertical position + integer, parameter :: dist_fmtZN = 43 ! Normalised longitudinal position + integer, parameter :: dist_fmtPXN = 44 ! Normalised horizontal momentum + integer, parameter :: dist_fmtPYN = 45 ! Normalised vertical momentum + integer, parameter :: dist_fmtPZN = 46 ! Normalised longitudinal momentum + + integer, parameter :: dist_fmtJX = 51 ! Horizontal action + integer, parameter :: dist_fmtJY = 52 ! Vertical action + integer, parameter :: dist_fmtJZ = 53 ! Longitudinal action + integer, parameter :: dist_fmtPhiX = 54 ! Horizontal action angle + integer, parameter :: dist_fmtPhiY = 55 ! Vertical action angle + integer, parameter :: dist_fmtPhiZ = 56 ! Longitudinal action angle + + ! Ion Columns + integer, parameter :: dist_fmtMASS = 61 ! Particle mass + integer, parameter :: dist_fmtCHARGE = 62 ! Particle Charge + integer, parameter :: dist_fmtIonA = 63 ! Ion atomic mass + integer, parameter :: dist_fmtIonZ = 64 ! Ion atomic number + integer, parameter :: dist_fmtPDGID = 65 ! Particle PDG ID + + ! Spin + integer, parameter :: dist_fmtSPINX = 71 ! Spin vector x component + integer, parameter :: dist_fmtSPINY = 72 ! Spin vector y component + integer, parameter :: dist_fmtSPINZ = 73 ! Spin vector z component + + ! Flags for columns we've set that we need to track for later checks + logical, private, save :: dist_readMass = .false. + logical, private, save :: dist_readIonZ = .false. + logical, private, save :: dist_readIonA = .false. + logical, private, save :: dist_readCharge = .false. + logical, private, save :: dist_readPDGID = .false. + logical, private, save :: dist_readPartID = .false. + logical, private, save :: dist_readParentID = .false. + + ! Temporary particle arrays + real(kind=fPrec), allocatable, private, save :: dist_partCol1(:) ! Ends up in array xv1 + real(kind=fPrec), allocatable, private, save :: dist_partCol2(:) ! Ends up in array yv1 + real(kind=fPrec), allocatable, private, save :: dist_partCol3(:) ! Ends up in array xv2 + real(kind=fPrec), allocatable, private, save :: dist_partCol4(:) ! Ends up in array yv2 + real(kind=fPrec), allocatable, private, save :: dist_partCol5(:) ! Ends up in array sigmv + real(kind=fPrec), allocatable, private, save :: dist_partCol6(:) ! Ends up in array dpsv, evj, and ejfv + integer, private, save :: dist_partFmt(6) = dist_fmtNONE ! The format used for each column + +#ifdef DISTLIB + + ! Coordiante Types + ! Keep in sync with lib/DISTlib/distinterface.c + integer, parameter :: dist_coordTypeAction = 0 + integer, parameter :: dist_coordTypeNormal = 1 + integer, parameter :: dist_coordTypePhysical = 2 + integer, parameter :: dist_coordTypeMixed = 3 + + ! C interface + interface + + subroutine distlib_init(numDist) bind(C, name="initializedistribution") + use, intrinsic :: iso_c_binding + integer(kind=C_INT), value, intent(in) :: numDist + end subroutine distlib_init + + subroutine distlib_readFile(fileName, strLen) bind(C, name="readfile_f") + use, intrinsic :: iso_c_binding + character(kind=C_CHAR,len=1), intent(in) :: fileName + integer(kind=C_INT), value, intent(in) :: strLen + end subroutine distlib_readFile + + subroutine distlib_setEnergyMass(energy0, mass0) bind(C, name="sete0andmass0") + use, intrinsic :: iso_c_binding + real(kind=C_DOUBLE), value, intent(in) :: energy0 + real(kind=C_DOUBLE), value, intent(in) :: mass0 + end subroutine distlib_setEnergyMass + + subroutine distlib_setEmittance12(emit1, emit2) bind(C, name="setemitt12") + use, intrinsic :: iso_c_binding + real(kind=C_DOUBLE), value, intent(in) :: emit1 + real(kind=C_DOUBLE), value, intent(in) :: emit2 + end subroutine distlib_setEmittance12 + + subroutine distlib_setEmittance3(emit3) bind(C, name="setemitt3") + use, intrinsic :: iso_c_binding + real(kind=C_DOUBLE), value, intent(in) :: emit3 + end subroutine distlib_setEmittance3 + + subroutine distlib_setTwiss(betaX, alphaX, betaY, alphaY) bind(C, name="settwisstas") + use, intrinsic :: iso_c_binding + real(kind=C_DOUBLE), value, intent(in) :: betaX + real(kind=C_DOUBLE), value, intent(in) :: alphaX + real(kind=C_DOUBLE), value, intent(in) :: betaY + real(kind=C_DOUBLE), value, intent(in) :: alphaY + end subroutine distlib_setTwiss + + subroutine distlib_setDispersion(dX, dPx, dY, dPy) bind(C, name="setdisptas") + use, intrinsic :: iso_c_binding + real(kind=C_DOUBLE), value, intent(in) :: dX + real(kind=C_DOUBLE), value, intent(in) :: dPx + real(kind=C_DOUBLE), value, intent(in) :: dY + real(kind=C_DOUBLE), value, intent(in) :: dPy + end subroutine distlib_setDispersion + + subroutine distlib_setTasMatrix(flatTas) bind(C, name="settasmatrix") + use, intrinsic :: iso_c_binding + real(kind=C_DOUBLE), intent(in) :: flatTas(36) + end subroutine distlib_setTasMatrix + + subroutine distlib_setCoords(arr1, arr2, arr3, arr4, arr5, arr6, arrLen, cType) bind(C, name="setcoords") + use, intrinsic :: iso_c_binding + real(kind=C_DOUBLE), intent(in) :: arr1(*) + real(kind=C_DOUBLE), intent(in) :: arr2(*) + real(kind=C_DOUBLE), intent(in) :: arr3(*) + real(kind=C_DOUBLE), intent(in) :: arr4(*) + real(kind=C_DOUBLE), intent(in) :: arr5(*) + real(kind=C_DOUBLE), intent(in) :: arr6(*) + integer(kind=C_INT), value, intent(in) :: arrLen + integer(kind=C_INT), value, intent(in) :: cType + end subroutine distlib_setCoords + + subroutine distlib_getCoords(arr1, arr2, arr3, arr4, arr5, arr6, arrLen) bind(C, name="get6trackcoord") + use, intrinsic :: iso_c_binding + real(kind=C_DOUBLE), intent(inout) :: arr1(*) + real(kind=C_DOUBLE), intent(inout) :: arr2(*) + real(kind=C_DOUBLE), intent(inout) :: arr3(*) + real(kind=C_DOUBLE), intent(inout) :: arr4(*) + real(kind=C_DOUBLE), intent(inout) :: arr5(*) + real(kind=C_DOUBLE), intent(inout) :: arr6(*) + integer(kind=C_INT), intent(inout) :: arrLen + end subroutine distlib_getCoords + + end interface +#endif + +contains + +! ================================================================================================ ! +! Master Module Subrotuine +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-08 +! Updated: 2019-07-09 +! Called from main_cr if dist_enable is true. This should handle everything needed. +! ================================================================================================ ! +subroutine dist_generateDist + + use crcoall + use mod_alloc + use mod_common + use mod_particles + use mod_common_main + use physical_constants + use numerical_constants + + integer i, distLibPart + real(kind=fPrec) flatTas(36) + + call alloc(dist_partCol1, napx, zero, "dist_partCol1") + call alloc(dist_partCol2, napx, zero, "dist_partCol2") + call alloc(dist_partCol3, napx, zero, "dist_partCol3") + call alloc(dist_partCol4, napx, zero, "dist_partCol4") + call alloc(dist_partCol5, napx, zero, "dist_partCol5") + call alloc(dist_partCol6, napx, zero, "dist_partCol6") + + ! If the T matrix hasn't been set from input, we set it here + if(dist_normMethod == dist_normSIXTRACK) then + dist_tMat(1:6,1:6) = tas(1:6,1:6) + dist_tMat(1:5,6) = dist_tMat(1:5,6)*c1m3 + dist_tMat(6,1:5) = dist_tMat(6,1:5)*c1e3 + end if + if(dist_normMethod == dist_normINPUT .and. dist_tMatRow /= 6) then + write(lerr,"(a,i0,a)") "DIST> ERROR The T-matrix must be 6 rows, but only ",dist_tMatRow," rows were given" + call prror + end if + + ! Scale longitudinal emittance + select case(dist_emit3Unit) + case(1) ! Micrometre + dist_beamEmit(3) = dist_beamEmit(3)*c1m6 + case(2) ! eV s + dist_beamEmit(3) = dist_beamEmit(3)*((clight*beta0)/((four*pi)*e0)) + end select + write(lout,"(a,1pe13.6,a)") "DIST> EMITTANCE X = ",dist_beamEmit(1)," m" + write(lout,"(a,1pe13.6,a)") "DIST> EMITTANCE Y = ",dist_beamEmit(2)," m" + write(lout,"(a,1pe13.6,a)") "DIST> EMITTANCE Z = ",dist_beamEmit(3)," m" + +#ifdef DISTLIB + if(dist_distLib) then + call distlib_init(1) + call distlib_setEnergyMass(e0, nucm0) + call distlib_setEmittance12(dist_beamEmit(1), dist_beamEmit(2)) + call distlib_setEmittance3(dist_beamEmit(3)) + select case(dist_normMethod) + case(dist_normSIXTRACK, dist_normINPUT) + do i=1,6 + write(lout,"(a,i0,a,6(1x,1pe13.6))") "DIST> TMATRIX(",i,",1:6) =",dist_tMat(i,1:6) + end do + flatTas = pack(transpose(dist_tMat),.true.) + call distlib_setTasMatrix(flatTas) + case(dist_normTWISS) + call distlib_setTwiss(dist_twBeta(1), dist_twAlpha(1), dist_twBeta(2), dist_twAlpha(2)) + call distlib_setDispersion(dist_bDisp(1), dist_bDisp(2), dist_bDisp(3), dist_bDisp(4)) + write(lout,"(a,2(1x,1pe13.6))") "DIST> BETA X/Y =",dist_twBeta + write(lout,"(a,2(1x,1pe13.6))") "DIST> ALPHA X/Y =",dist_twAlpha + end select + end if +#endif + + if(dist_nParticle > 0) then + ! Particles are read from DIST block in fort.3 + call dist_parseParticles + elseif(dist_distFile /= " ") then + if(dist_libRead) then + ! Particles are read entirely in DISTlib +#ifdef DISTLIB + call distlib_readFile(trim(dist_distFile), len_trim(dist_distFile)) +#endif + else + call dist_readDist + end if + end if + call dist_doFills ! Do fills, and if requested, overwrite what is read from file + call dist_postprParticles ! Copy 6D temp arrays to their correct ones, or send to DISTlib + +#ifdef DISTLIB + if(dist_distLib) then + ! Our final coordinates are taken from DISTlib + ! The 6D temp arrays were sent to DISTlib in dist_postprParticles + distLibPart = napx + call distlib_getCoords( & + dist_partCol1, dist_partCol2, dist_partCol3, & + dist_partCol4, dist_partCol5, dist_partCol6, & + distLibPart & + ) + if(distLibPart == napx) then + xv1(1:napx) = dist_partCol1(1:napx) + yv1(1:napx) = dist_partCol2(1:napx) + xv2(1:napx) = dist_partCol3(1:napx) + yv2(1:napx) = dist_partCol4(1:napx) + sigmv(1:napx) = dist_partCol5(1:napx) + dpsv(1:napx) = dist_partCol6(1:napx) + call part_updatePartEnergy(3,.false.) + else + write(lerr,"(2(a,i0))") "DIST> ERROR DISTlib returned ",distLibPart," particles, while SixTrack expected ",napx + call prror + end if + end if +#endif + + if(dist_numPart > 0) then + call dist_finaliseDist + call part_applyClosedOrbit + if(dist_echo) then + call dist_echoDist + end if + end if + + call dealloc(dist_partCol1, "dist_partCol1") + call dealloc(dist_partCol2, "dist_partCol2") + call dealloc(dist_partCol3, "dist_partCol3") + call dealloc(dist_partCol4, "dist_partCol4") + call dealloc(dist_partCol5, "dist_partCol5") + call dealloc(dist_partCol6, "dist_partCol6") + +end subroutine dist_generateDist + +! ================================================================================================ ! +! A. Mereghetti and D. Sinuela Pastor, for the FLUKA Team +! V.K. Berglyd Olsen, BE-ABP-HSS +! Updated: 2019-07-09 +! ================================================================================================ ! +subroutine dist_parseInputLine(inLine, iLine, iErr) + + use parpro + use mod_alloc + use mod_units + use mod_ranecu + use string_tools + use numerical_constants + + character(len=*), intent(in) :: inLine + integer, intent(inout) :: iLine + logical, intent(inout) :: iErr + + character(len=:), allocatable :: lnSplit(:) + real(kind=fPrec) fmtFac + integer nSplit, i, fmtID, fmtCol, tmpOne, tmpTwo + logical spErr, cErr, isValid + + call chr_split(inLine, lnSplit, nSplit, spErr) + if(spErr) then + write(lerr,"(a)") "DIST> ERROR Failed to parse input line." + iErr = .true. + return + end if + if(nSplit == 0) return + + cErr = .false. + + select case(lnSplit(1)) + + case("FORMAT") + if(nSplit < 2) then + write(lerr,"(a,i0)") "DIST> ERROR FORMAT takes at least 1 argument, got ",nSplit-1 + write(lerr,"(a)") "DIST> FORMAT [list of columns]" + iErr = .true. + return + end if + do i=2,nSplit + call dist_parseColumn(lnSplit(i),cErr,fmtID,fmtFac,fmtCol,isValid) + if(isValid) then + call dist_appendFormat(fmtID,fmtFac,fmtCol) + if(cErr) then + iErr = .true. + return + end if + else + call dist_setMultiColFormat(lnSplit(i), isValid) + if(isValid .eqv. .false.) then + write(lerr,"(a)") "DIST> ERROR Unknown column format '"//trim(lnSplit(i))//"'" + iErr = .true. + return + end if + end if + end do + dist_hasFormat = .true. + + case("READ") + if(nSplit /= 2 .and. nSplit /= 3) then + write(lerr,"(a,i0)") "DIST> ERROR READ takes 1 or 2 arguments, got ",nSplit-1 + write(lerr,"(a)") "DIST> READ filename [LIBDIST]" + iErr = .true. + return + end if + dist_distFile = trim(lnSplit(2)) + if(nSplit > 2) call chr_cast(lnSplit(3), dist_libRead, cErr) + if(dist_libRead) then + dist_distLib = .true. + end if + + case("PARTICLE") + if(dist_hasFormat .eqv. .false.) then + write(lerr,"(a,i0)") "DIST> ERROR PARTICLE keyword requires a FORMAT to be defined first" + iErr = .true. + return + end if + if(nSplit /= dist_nColumns + 1) then + write(lerr,"(a)") "DIST> ERROR PARTICLE values must match the number of definitions in FORMAT" + write(lerr,"(2(a,i0))") "DIST> Got ",nsplit-1," values, but FORMAT defines ",dist_nColumns + iErr = .true. + return + end if + dist_nParticle = dist_nParticle + 1 + call alloc(dist_partLine, mInputLn, dist_nParticle, " ", "dist_partLine") + dist_partLine(dist_nParticle) = trim(inLine) + + case("ECHO") + if(nSplit >= 2) then + dist_echoFile = trim(lnSplit(2)) + else + dist_echoFile = "echo_distribution.dat" + end if + dist_echo = .true. + + case("EMIT","EMITTANCE") + if(nSplit /= 3) then + write(lerr,"(a,i0)") "DIST> ERROR EMITTANCE takes 2 arguments, got ",nSplit-1 + write(lerr,"(a)") "DIST> EMITTANCE emit1[mm mrad] emit2[mm mrad]" + iErr = .true. + return + end if + call chr_cast(lnSplit(2), dist_beamEmit(1), cErr) + call chr_cast(lnSplit(3), dist_beamEmit(2), cErr) + dist_beamEmit(1) = dist_beamEmit(1) * c1m6 + dist_beamEmit(2) = dist_beamEmit(2) * c1m6 + + case("LONGEMIT") + if(nSplit /= 3) then + write(lerr,"(a,i0)") "DIST> ERROR LONGEMIT takes 2 arguments, got ",nSplit-1 + write(lerr,"(a)") "DIST> LONGEMIT emit3 unit[eVs|um]" + iErr = .true. + return + end if + call chr_cast(lnSplit(2), dist_beamEmit(3), cErr) + select case(chr_toLower(lnSplit(3))) + case("um","µm") + dist_emit3Unit = 1 + case("evs") + dist_emit3Unit = 2 + case default + write(lerr,"(a)") "DIST> ERROR Unknown or unsupported unit '"//trim(lnSplit(3))//"' for LONGEMIT" + iErr = .true. + return + end select + + case("TWISS") + if(nSplit /= 5) then + write(lerr,"(a,i0)") "DIST> ERROR TWISS takes 4 arguments, got ",nSplit-1 + write(lerr,"(a)") "DIST> TWISS betaX[m] alphaX[1] betaY[m] alphaY[1]" + iErr = .true. + return + end if + call chr_cast(lnSplit(2), dist_twBeta(1), cErr) + call chr_cast(lnSplit(3), dist_twAlpha(1), cErr) + call chr_cast(lnSplit(4), dist_twBeta(2), cErr) + call chr_cast(lnSplit(5), dist_twAlpha(2), cErr) + dist_normMethod = dist_normTWISS + + case("DISPERSION") + if(nSplit /= 5) then + write(lerr,"(a,i0)") "DIST> ERROR DISPERSION takes 4 arguments, got ",nSplit-1 + write(lerr,"(a)") "DIST> DISPERSION dx dpx dy dpy" + iErr = .true. + return + end if + call chr_cast(lnSplit(2), dist_bDisp(1), cErr) + call chr_cast(lnSplit(3), dist_bDisp(2), cErr) + call chr_cast(lnSplit(4), dist_bDisp(3), cErr) + call chr_cast(lnSplit(5), dist_bDisp(4), cErr) + + case("FILL") + if(nSplit < 3) then + write(lerr,"(a,i0)") "DIST> ERROR FILL takes at least 3 argument, got ",nSplit-1 + iErr = .true. + return + end if + call dist_parseFill(lnSplit, nSplit, cErr) + + case("SEED") + if(nSplit /= 2) then + write(lerr,"(a,i0)") "DIST> ERROR SEED takes 1 argument, got ",nSplit-1 + iErr = .true. + return + end if + call chr_cast(lnSplit(2), dist_seedOne, cErr) + call recuut(tmpOne, tmpTwo) + call recuinit(dist_seedOne) + call recuut(dist_seedOne, dist_seedTwo) + call recuin(tmpOne, tmpTwo) + + case("TMATRIX") + if(nSplit /= 7) then + write(lerr,"(a,i0)") "DIST> ERROR TMATRIX takes 6 arguments, got ",nSplit-1 + iErr = .true. + return + end if + dist_tMatRow = dist_tMatRow + 1 + if(dist_tMatRow > 6) then + write(lerr,"(a)") "DIST> ERROR Only 6 rows for the TMATRIX can be given" + iErr = .true. + return + end if + do i=1,6 + call chr_cast(lnSplit(i+1), dist_tMat(dist_tMatRow,i), cErr) + end do + dist_normMethod = dist_normINPUT + + case default + write(lerr,"(a)") "DIST> ERROR Unknown keyword '"//trim(lnSplit(1))//"'." + iErr = .true. + return + + end select + + if(cErr) then + iErr = .true. + return + end if + +end subroutine dist_parseInputLine + +! ================================================================================================ ! +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-30 +! Updated: 2019-07-30 +! ================================================================================================ ! +subroutine dist_parseFill(lnSplit, nSplit, iErr) + + use crcoall + use mod_alloc + use string_tools + use numerical_constants + + character(len=:), allocatable, intent(in) :: lnSplit(:) + integer, intent(in) :: nSplit + logical, intent(inout) :: iErr + + type(dist_fillType), allocatable :: tmpFill(:) + real(kind=fPrec), allocatable :: fParams(:) + integer, allocatable :: iParams(:) + + real(kind=fPrec) fmtFac + integer fmtCol, fillMethod, fillTarget, firstPart, lastPart + logical fErr, cErr, isValid + + fErr = .false. + cErr = .false. + + if(allocated(dist_fillList)) then + allocate(tmpFill(dist_nFill+1)) + tmpFill(1:dist_nFill) = dist_fillList(1:dist_nFill) + call move_alloc(tmpFill, dist_fillList) + dist_nFill = dist_nFill + 1 + else + allocate(dist_fillList(1)) + dist_nFill = 1 + end if + + call dist_parseColumn(lnSplit(2), fErr, fillTarget, fmtFac, fmtCol, isValid) + if(fmtCol > 0) then + if(dist_partFmt(fmtCol) == 0) then + dist_partFmt(fmtCol) = fillTarget + end if + if(dist_partFmt(fmtCol) /= fillTarget) then + call dist_multFormatError(fmtCol) + iErr = .true. + return + end if + end if + + select case(chr_toUpper(lnSplit(3))) + + case("NONE") + + allocate(fParams(1)) + allocate(iParams(2)) + + fillMethod = dist_fillNONE + fParams(1) = zero + iParams(1) = 1 + iParams(2) = -1 + + case("INT") + if(nSplit /= 4 .and. nSplit /= 6) then + write(lerr,"(a,i0)") "DIST> ERROR FILL format INT expected 1 or 3 arguments, got ",nSplit-3 + write(lerr,"(a)") "DIST> FILL column INT value [first last]" + iErr = .true. + return + end if + + allocate(fParams(1)) + allocate(iParams(3)) + + fillMethod = dist_fillINT + fParams(1) = zero + iParams(1) = 1 + iParams(2) = -1 + iParams(3) = 0 + + if(nSplit > 3) call chr_cast(lnSplit(4), iParams(3), cErr) + if(nSplit > 4) call chr_cast(lnSplit(5), iParams(1), cErr) + if(nSplit > 5) call chr_cast(lnSplit(6), iParams(2), cErr) + + case("FLOAT") + if(nSplit /= 4 .and. nSplit /= 6) then + write(lerr,"(a,i0)") "DIST> ERROR FILL format FLOAT expected 1 or 3 arguments, got ",nSplit-3 + write(lerr,"(a)") "DIST> FILL column FLOAT value [first last]" + iErr = .true. + return + end if + + allocate(fParams(1)) + allocate(iParams(2)) + + fillMethod = dist_fillFLOAT + fParams(1) = zero + iParams(1) = 1 + iParams(2) = -1 + + if(nSplit > 3) call chr_cast(lnSplit(4), fParams(1), cErr) + if(nSplit > 4) call chr_cast(lnSplit(5), iParams(1), cErr) + if(nSplit > 5) call chr_cast(lnSplit(6), iParams(2), cErr) + + case("GAUSS") + if(nSplit /= 5 .and. nSplit /= 6 .and. nSplit /= 8) then + write(lerr,"(a,i0)") "DIST> ERROR FILL format GAUSS expected 2, 3 or 5 arguments, got ",nSplit-3 + write(lerr,"(a)") "DIST> FILL column GAUSS sigma mu [cut] [first last]" + iErr = .true. + return + end if + + allocate(fParams(3)) + allocate(iParams(2)) + + fillMethod = dist_fillGAUSS + fParams(1) = one + fParams(2) = zero + fParams(3) = zero + iParams(1) = 1 + iParams(2) = -1 + + if(nSplit > 3) call chr_cast(lnSplit(4), fParams(1), cErr) + if(nSplit > 4) call chr_cast(lnSplit(5), fParams(2), cErr) + if(nSplit > 5) call chr_cast(lnSplit(6), fParams(3), cErr) + if(nSplit > 6) call chr_cast(lnSplit(7), iParams(1), cErr) + if(nSplit > 7) call chr_cast(lnSplit(8), iParams(2), cErr) + + case("UNIFORM") + if(nSplit /= 5 .and. nSplit /= 7) then + write(lerr,"(a,i0)") "DIST> ERROR FILL format UNIFORM expected 2 or 4 arguments, got ",nSplit-3 + write(lerr,"(a)") "DIST> FILL column UNIFORM lower upper [first last]" + iErr = .true. + return + end if + + allocate(fParams(2)) + allocate(iParams(2)) + + fillMethod = dist_fillUNIFORM + fParams(1) = zero + fParams(2) = one + iParams(1) = 1 + iParams(2) = -1 + + if(nSplit > 3) call chr_cast(lnSplit(4), fParams(1), cErr) + if(nSplit > 4) call chr_cast(lnSplit(5), fParams(2), cErr) + if(nSplit > 5) call chr_cast(lnSplit(6), iParams(1), cErr) + if(nSplit > 6) call chr_cast(lnSplit(7), iParams(2), cErr) + + case("LINEAR") + if(nSplit /= 5 .and. nSplit /= 7) then + write(lerr,"(a,i0)") "DIST> ERROR FILL format LINEAR expected 2 or 4 arguments, got ",nSplit-3 + write(lerr,"(a)") "DIST> FILL column LINEAR lower upper [first last]" + iErr = .true. + return + end if + + allocate(fParams(2)) + allocate(iParams(2)) + + fillMethod = dist_fillLINEAR + fParams(1) = zero + fParams(2) = one + iParams(1) = 1 + iParams(2) = -1 + + if(nSplit > 3) call chr_cast(lnSplit(4), fParams(1), cErr) + if(nSplit > 4) call chr_cast(lnSplit(5), fParams(2), cErr) + if(nSplit > 5) call chr_cast(lnSplit(6), iParams(1), cErr) + if(nSplit > 6) call chr_cast(lnSplit(7), iParams(2), cErr) + + case("COUNT") + if(nSplit /= 5 .and. nSplit /= 7) then + write(lerr,"(a,i0)") "DIST> ERROR FILL format COUNT expected 2 or 4 arguments, got ",nSplit-3 + write(lerr,"(a)") "DIST> FILL column COUNT start step [first last]" + iErr = .true. + return + end if + + allocate(fParams(1)) + allocate(iParams(4)) + + fillMethod = dist_fillCOUNT + fParams(1) = zero + iParams(1) = 1 + iParams(2) = -1 + iParams(3) = 1 + iParams(4) = 1 + + if(nSplit > 3) call chr_cast(lnSplit(4), iParams(3), cErr) + if(nSplit > 4) call chr_cast(lnSplit(5), iParams(4), cErr) + if(nSplit > 5) call chr_cast(lnSplit(6), iParams(1), cErr) + if(nSplit > 6) call chr_cast(lnSplit(7), iParams(2), cErr) + + case default + write(lerr,"(a)") "DIST> ERROR Unknown FILL method '"//trim(lnSplit(3))//"'" + iErr = .true. + return + + end select + + if(iParams(1) < 1) then + write(lerr,"(a)") "DIST> ERROR First particle cannot be smaller than 1" + iErr = .true. + return + end if + if(iParams(2) /= -1 .and. iParams(1) > iParams(2)) then + write(lerr,"(a)") "DIST> ERROR First particle to fill cannot be after last particle" + iErr = .true. + return + end if + + dist_fillList(dist_nFill)%fillName = trim(lnSplit(2)) + dist_fillList(dist_nFill)%fillTarget = fillTarget + dist_fillList(dist_nFill)%fillMethod = fillMethod + dist_fillList(dist_nFill)%iParams = iParams + dist_fillList(dist_nFill)%fParams = fParams + +end subroutine dist_parseFill + +! ================================================================================================ ! +! Parse File Column Formats +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-05 +! Updated: 2019-07-10 ! +! This routine splits the unit from the format description and adds the format and the scaling +! factor to the list of format columns for later file parsing. +! ================================================================================================ ! +subroutine dist_parseColumn(fmtName, fErr, fmtID, fmtFac, fmtCol, isValid) + + use crcoall + use string_tools + use numerical_constants + + character(len=*), intent(in) :: fmtName + logical, intent(out) :: fErr + integer, intent(out) :: fmtID + real(kind=fPrec), intent(out) :: fmtFac + integer, intent(out) :: fmtCol + logical, intent(out) :: isValid + + character(len=20) fmtBase + character(len=10) fmtUnit + real(kind=fPrec) uFac + integer c, unitPos, fmtLen + + fErr = .false. + fmtID = dist_fmtNONE + fmtFac = one + fmtCol = 0 + isValid = .true. + + fmtLen = len_trim(fmtName) + if(fmtLen < 1) then + write(lerr,"(a)") "DIST> ERROR Unknown column format '"//trim(fmtName)//"'" + fErr = .true. + end if + + unitPos = -1 + do c=1,fmtLen + if(fmtName(c:c) == "[") then + unitPos = c + exit + end if + end do + + if(unitPos > 1 .and. fmtLen > unitPos+1) then + fmtBase = trim(fmtName(1:unitPos-1)) + fmtUnit = trim(fmtName(unitPos:fmtLen)) + else + fmtBase = trim(fmtName) + fmtUnit = "[1]" + end if + + select case(chr_toUpper(fmtBase)) + + case("OFF","SKIP") + fmtID = dist_fmtNONE + case("ID") + fmtID = dist_fmtPartID + case("PARENT") + fmtID = dist_fmtParentID + + case("X") + call dist_unitScale(fmtName, fmtUnit, 1, fmtFac, fErr) + fmtID = dist_fmtX + fmtCol = 1 + case("Y") + call dist_unitScale(fmtName, fmtUnit, 1, fmtFac, fErr) + fmtID = dist_fmtY + fmtCol = 3 + + case("XP") + fmtID = dist_fmtXP + fmtCol = 2 + case("YP") + fmtID = dist_fmtYP + fmtCol = 4 + + case("PX") + call dist_unitScale(fmtName, fmtUnit, 3, fmtFac, fErr) + fmtID = dist_fmtPX + fmtCol = 2 + case("PY") + call dist_unitScale(fmtName, fmtUnit, 3, fmtFac, fErr) + fmtID = dist_fmtPY + fmtCol = 4 + + case("PX/P0","PXP0") + fmtID = dist_fmtPX + fmtCol = 2 + case("PY/P0","PYP0") + fmtID = dist_fmtPY + fmtCol = 4 + + case("SIGMA") + call dist_unitScale(fmtName, fmtUnit, 1, fmtFac, fErr) + fmtID = dist_fmtSIGMA + fmtCol = 5 + case("ZETA") + call dist_unitScale(fmtName, fmtUnit, 1, fmtFac, fErr) + fmtID = dist_fmtZETA + fmtCol = 5 + case("DT") + call dist_unitScale(fmtName, fmtUnit, 4, fmtFac, fErr) + fmtID = dist_fmtDT + fmtCol = 5 + + case("E") + call dist_unitScale(fmtName, fmtUnit, 3, fmtFac, fErr) + fmtID = dist_fmtE + fmtCol = 6 + case("P") + call dist_unitScale(fmtName, fmtUnit, 3, fmtFac, fErr) + fmtID = dist_fmtP + fmtCol = 6 + case("DE/E0","DEE0") + fmtID = dist_fmtDEE0 + fmtCol = 6 + case("DP/P0","DPP0","DELTA") + fmtID = dist_fmtDPP0 + fmtCol = 6 + case("DE/P0","DEP0","PT") + fmtID = dist_fmtPT + fmtCol = 6 + case("PSIGMA") + fmtID = dist_fmtPSIGMA + fmtCol = 6 + + case("XN") + fmtID = dist_fmtXN + fmtCol = 1 + dist_distLib = dist_distLibNorm + case("YN") + fmtID = dist_fmtYN + fmtCol = 3 + dist_distLib = dist_distLibNorm + case("ZN") + fmtID = dist_fmtZN + fmtCol = 5 + dist_distLib = dist_distLibNorm + case("PXN") + fmtID = dist_fmtPXN + fmtCol = 2 + dist_distLib = dist_distLibNorm + case("PYN") + fmtID = dist_fmtPYN + fmtCol = 4 + dist_distLib = dist_distLibNorm + case("PZN") + fmtID = dist_fmtPZN + fmtCol = 6 + dist_distLib = dist_distLibNorm + + case("JX") + fmtID = dist_fmtJX + fmtCol = 1 + dist_distLib = .true. + case("JY") + fmtID = dist_fmtJY + fmtCol = 3 + dist_distLib = .true. + case("JZ") + fmtID = dist_fmtJZ + fmtCol = 5 + dist_distLib = .true. + case("PHIX") + call dist_unitScale(fmtName, fmtUnit, 2, fmtFac, fErr) + fmtID = dist_fmtPhiX + fmtCol = 2 + dist_distLib = .true. + case("PHIY") + call dist_unitScale(fmtName, fmtUnit, 2, fmtFac, fErr) + fmtID = dist_fmtPhiY + fmtCol = 4 + dist_distLib = .true. + case("PHIZ") + call dist_unitScale(fmtName, fmtUnit, 2, fmtFac, fErr) + fmtID = dist_fmtPhiZ + fmtCol = 6 + dist_distLib = .true. + + case("MASS","M") + call dist_unitScale(fmtName, fmtUnit, 3, fmtFac, fErr) + fmtID = dist_fmtMASS + case("CHARGE","Q") + fmtID = dist_fmtCHARGE + case("ION_A") + fmtID = dist_fmtIonA + case("ION_Z") + fmtID = dist_fmtIonZ + case("PDGID") + fmtID = dist_fmtPDGID + + case("SX") + fmtID = dist_fmtSPINX + case("SY") + fmtID = dist_fmtSPINY + case("SZ") + fmtID = dist_fmtSPINZ + + case default + isValid = .false. + return + + end select + +#ifndef DISTLIB + if(dist_distLib) then + write(lerr,"(a)") "DIST> ERROR Format '"//trim(fmtName)//"' requires SixTrack to be built with DISTLIB enabled" + fErr = .true. + return + end if +#endif + +end subroutine dist_parseColumn + +! ================================================================================================ ! +! Parse Multi-Column Formats +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-05 +! Updated: 2019-07-10 +! ================================================================================================ ! +subroutine dist_setMultiColFormat(fmtName, isValid) + + use string_tools + use numerical_constants + + character(len=*), intent(in) :: fmtName + logical, intent(out) :: isValid + + isValid = .false. + + select case(chr_toUpper(fmtName)) + + case("4D") ! 4D default coordinates + call dist_appendFormat(dist_fmtX, one, 1) + call dist_appendFormat(dist_fmtPX, one, 2) + call dist_appendFormat(dist_fmtY, one, 3) + call dist_appendFormat(dist_fmtPY, one, 4) + isValid = .true. + + case("6D") ! 6D default coordinates + call dist_appendFormat(dist_fmtX, one, 1) + call dist_appendFormat(dist_fmtPX, one, 2) + call dist_appendFormat(dist_fmtY, one, 3) + call dist_appendFormat(dist_fmtPY, one, 4) + call dist_appendFormat(dist_fmtZETA, one, 5) + call dist_appendFormat(dist_fmtDPP0, one, 6) + isValid = .true. + + case("NORM") ! 6D normalised coordinates + call dist_appendFormat(dist_fmtXN, one, 1) + call dist_appendFormat(dist_fmtPXN, one, 2) + call dist_appendFormat(dist_fmtYN, one, 3) + call dist_appendFormat(dist_fmtPYN, one, 4) + call dist_appendFormat(dist_fmtZN, one, 5) + call dist_appendFormat(dist_fmtPZN, one, 6) + dist_distLib = dist_distLibNorm + isValid = .true. + + case("ACTION") ! 6D action + call dist_appendFormat(dist_fmtJX, one, 1) + call dist_appendFormat(dist_fmtPhiX, one, 2) + call dist_appendFormat(dist_fmtJY, one, 3) + call dist_appendFormat(dist_fmtPhiY, one, 4) + call dist_appendFormat(dist_fmtJZ, one, 5) + call dist_appendFormat(dist_fmtPhiZ, one, 6) + dist_distLib = .true. + isValid = .true. + + case("IONS") ! The ion columns + call dist_appendFormat(dist_fmtMASS, c1e3, 0) + call dist_appendFormat(dist_fmtCHARGE, one, 0) + call dist_appendFormat(dist_fmtIonA, one, 0) + call dist_appendFormat(dist_fmtIonZ, one, 0) + call dist_appendFormat(dist_fmtPDGID, one, 0) + isValid = .true. + + case("SPIN") ! The spin columns + call dist_appendFormat(dist_fmtSPINX, one, 0) + call dist_appendFormat(dist_fmtSPINY, one, 0) + call dist_appendFormat(dist_fmtSPINZ, one, 0) + isValid = .true. + + case("OLD_DIST") ! The old DIST block file format + ! This is added for the block to be compatible with the old, fixed column DIST file format. + ! The scaling is hardcoded, and the file format has a few columns that are not used. + ! Specifically the weight (column 3), and the z and pz coordinates (columns 6 and 9). + call dist_appendFormat(dist_fmtPartID, one, 0) + call dist_appendFormat(dist_fmtParentID, one, 0) + call dist_appendFormat(dist_fmtNONE, one, 0) + call dist_appendFormat(dist_fmtX, c1e3, 1) + call dist_appendFormat(dist_fmtY, c1e3, 3) + call dist_appendFormat(dist_fmtNONE, one, 0) + call dist_appendFormat(dist_fmtXP, c1e3, 2) + call dist_appendFormat(dist_fmtYP, c1e3, 4) + call dist_appendFormat(dist_fmtNONE, one, 0) + call dist_appendFormat(dist_fmtIonA, one, 0) + call dist_appendFormat(dist_fmtIonZ, one, 0) + call dist_appendFormat(dist_fmtMASS, c1e3, 0) + call dist_appendFormat(dist_fmtP, c1e3, 6) + call dist_appendFormat(dist_fmtDT, one, 5) + isValid = .true. + end select + +end subroutine dist_setMultiColFormat + +! ================================================================================================ ! +! Parse File Column Units +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-05 +! Updated: 2019-07-10 +! ================================================================================================ ! +subroutine dist_unitScale(fmtName, fmtUnit, unitType, unitScale, uErr) + + use crcoall + use string_tools + use numerical_constants + + character(len=*), intent(in) :: fmtName + character(len=*), intent(in) :: fmtUnit + integer, intent(in) :: unitType + real(kind=fPrec), intent(out) :: unitScale + logical, intent(inout) :: uErr + + unitScale = zero + + if(unitType == 1) then ! Positions + select case(chr_toLower(fmtUnit)) + case("[m]") + unitScale = c1e3 + case("[mm]") + unitScale = one + case("[1]") + unitScale = one + case default + goto 100 + end select + elseif(unitType == 2) then ! Angle + select case(chr_toLower(fmtUnit)) + case("[rad]") + unitScale = c1e3 + case("[mrad]") + unitScale = one + case("[1]") + unitScale = one + case default + goto 100 + end select + elseif(unitType == 3) then ! Energy/Momentum/Mass + select case(chr_toLower(fmtUnit)) + case("[ev]", "[ev/c]", "[ev/c^2]", "[ev/c2]", "[ev/c**2]") + unitScale = c1m6 + case("[kev]","[kev/c]","[kev/c^2]","[kev/c2]","[kev/c**2]") + unitScale = c1m3 + case("[mev]","[mev/c]","[mev/c^2]","[mev/c2]","[mev/c**2]") + unitScale = one + case("[gev]","[gev/c]","[gev/c^2]","[gev/c2]","[gev/c**2]") + unitScale = c1e3 + case("[tev]","[tev/c]","[tev/c^2]","[tev/c2]","[tev/c**2]") + unitScale = c1e6 + case("[1]") + unitScale = one + case default + goto 100 + end select + elseif(unitType == 4) then ! Time + select case(chr_toLower(fmtUnit)) + case("[s]") + unitScale = one + case("[ms]") + unitScale = c1e3 + case("[us]","[µs]") + unitScale = c1e6 + case("[ns]") + unitScale = c1e9 + case("[ps]") + unitScale = c1e12 + case("[1]") + unitScale = one + case default + goto 100 + end select + end if + + return + +100 continue + write(lerr,"(a)") "DIST> ERROR Unrecognised or invalid unit for format identifier '"//trim(fmtName)//"'" + uErr = .true. + +end subroutine dist_unitScale + +! ================================================================================================ ! +! Save File Column Format +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-05 +! Updated: 2019-07-05 +! ================================================================================================ ! +subroutine dist_appendFormat(fmtID, colScale, partCol) + + use crcoall + use mod_alloc + use numerical_constants + + integer, intent(in) :: fmtID + real(kind=fPrec), intent(in) :: colScale + integer, intent(in) :: partCol + + dist_nColumns = dist_nColumns + 1 + + call alloc(dist_colFormat, dist_nColumns, dist_fmtNONE, "dist_colFormat") + call alloc(dist_colScale, dist_nColumns, one, "dist_colScale") + + dist_colFormat(dist_nColumns) = fmtID + dist_colScale(dist_nColumns) = colScale + + if(partCol > 0) then + if(dist_partFmt(partCol) == 0) then + dist_partFmt(partCol) = fmtID + else + call dist_multFormatError(partCol) + call prror + end if + end if + +end subroutine dist_appendFormat + +! ================================================================================================ ! +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-05 +! Updated: 2019-07-05 +! ================================================================================================ ! +subroutine dist_multFormatError(partCol) + + use crcoall + + integer, intent(in) :: partCol + + write(lerr,"(a,i0)") "DIST> ERROR Multiple formats selected for particle coordinate ",partCol + select case(partCol) + case(1) + write(lerr,"(a)") "DIST> Choose only one of: X, XN, JX" + case(2) + write(lerr,"(a)") "DIST> Choose only one of: XP, PX, PX/P0, PXN, PHIX" + case(3) + write(lerr,"(a)") "DIST> Choose only one of: Y, YN, JY" + case(4) + write(lerr,"(a)") "DIST> Choose only one of: YP, PY, PY/P0, PYN, PHIY" + case(5) + write(lerr,"(a)") "DIST> Choose only one of: SIGMA, ZETA, DT, ZN, JZ" + case(6) + write(lerr,"(a)") "DIST> Choose only one of: E, P, DE/E0, DP/P0, PT, PZN, PHIZ, PSIGMA" + end select + +end subroutine dist_multFormatError + +! ================================================================================================ ! +! Parse PARTICLE Lines from DIST Block +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-08 +! Updated: 2019-07-09 ! ================================================================================================ ! -module mod_dist +subroutine dist_parseParticles - use crcoall - use floatPrecision - use mod_pdgid + use mod_common + use string_tools - implicit none + character(len=:), allocatable :: lnSplit(:) + integer i, j, nSplit + logical spErr, cErr - logical, public, save :: dist_enable ! DIST input block given - logical, public, save :: dist_echo ! Echo the read distribution? - character(len=256), public, save :: dist_readFile ! File name for reading the distribution - character(len=256), public, save :: dist_echoFile ! File name for echoing the distribution - integer, private, save :: dist_readUnit ! Unit for reading the distribution - integer, private, save :: dist_echoUnit ! Unit for echoing the distribution + spErr = .false. + cErr = .false. -contains + if(dist_nParticle > 0) then + do j=1,dist_nParticle + call chr_split(dist_partLine(j), lnSplit, nSplit, spErr) + if(spErr) then + write(lerr,"(a,i0,a)") "DIST> ERROR Could not split PARTICLE definition number ",j," from "//trim(fort3) + call prror + end if + do i=2,nSplit + call dist_saveParticle(j, i-1, lnSplit(i), cErr) + if(cErr) then + write(lerr,"(a,2(i0,a))") "DIST> ERROR Could not parse PARTICLE definition number ",j,", column ",i," from "//trim(fort3) + call prror + end if + end do + dist_numPart = dist_numPart + 1 + end do + end if + +end subroutine dist_parseParticles ! ================================================================================================ ! ! A. Mereghetti and D. Sinuela Pastor, for the FLUKA Team ! V.K. Berglyd Olsen, BE-ABP-HSS -! Last modified: 2018-10-30 +! Updated: 2019-07-09 ! ================================================================================================ ! -subroutine dist_parseInputLine(inLine, iLine, iErr) +subroutine dist_readDist + use parpro + use mod_common + use mod_common_main use string_tools + use numerical_constants use mod_units - implicit none + character(len=:), allocatable :: lnSplit(:) + character(len=mInputLn) inLine + real(kind=fPrec) fmtFac + integer i, nSplit, lineNo, fUnit, nRead, fmtID, fmtCol + logical spErr, cErr, isValid - character(len=*), intent(in) :: inLine - integer, intent(inout) :: iLine - logical, intent(inout) :: iErr + write(lout,"(a)") "DIST> Reading particles from '"//trim(dist_distFile)//"'" - character(len=:), allocatable :: lnSplit(:) - integer nSplit - logical spErr + nRead = 0 + lineNo = 0 + cErr = .false. + + if(dist_hasFormat .eqv. .false.) then + call dist_setMultiColFormat("OLD_DIST",isValid) + end if + + call f_requestUnit(dist_distFile, fUnit) + call f_open(unit=fUnit,file=dist_distFile,mode='r',err=cErr,formatted=.true.,status="old") + if(cErr) goto 20 + +10 continue + read(fUnit,"(a)",end=40,err=30) inLine + lineNo = lineNo + 1 + + if(inLine(1:1) == "*") goto 10 + if(inLine(1:1) == "#") goto 10 + if(inLine(1:1) == "!") goto 10 + + dist_numPart = dist_numPart + 1 + nRead = nRead + 1 + + if(dist_numPart > napx) then + write(lout,"(a,i0,a)") "DIST> Stopping reading file as ",napx," particles have been read, as requested in '"//trim(fort3)//"'" + goto 40 + end if call chr_split(inLine, lnSplit, nSplit, spErr) - if(spErr) then - write(lerr,"(a)") "DIST> ERROR Failed to parse input line." - iErr = .true. + if(spErr) goto 30 + if(nSplit == 0) goto 10 + + if(nSplit /= dist_nColumns) then + write(lerr,"(3(a,i0),a)") "DIST> ERROR Number of columns in file on line ",lineNo," is ",nSplit,& + " but FORMAT defines ",dist_nColumns," columns" + call prror + end if + do i=1,nSplit + call dist_saveParticle(dist_numPart, i, lnSplit(i), cErr) + end do + if(cErr) goto 30 + + goto 10 + +20 continue + write(lerr,"(a)") "DIST> ERROR Opening file '"//trim(dist_distFile)//"'" + call prror + return + +30 continue + write(lerr,"(a,i0)") "DIST> ERROR Reading particles from line ",lineNo + call prror + return + +40 continue + call f_close(fUnit) + write(lout,"(a,i0,a)") "DIST> Read ",nRead," particles from file '"//trim(dist_distFile)//"'" + +end subroutine dist_readDist + +! ================================================================================================ ! +! Save Particle Data to Arrays +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-08 +! Updated: 2019-07-13 +! ================================================================================================ ! +subroutine dist_saveParticle(partNo, colNo, inVal, sErr) + + use mod_common + use mod_common_main + use string_tools + + integer, intent(in) :: partNo + integer, intent(in) :: colNo + character(len=*), intent(in) :: inVal + logical, intent(inout) :: sErr + + select case(dist_colFormat(colNo)) + + case(dist_fmtNONE) + return + + case(dist_fmtPartID) + call chr_cast(inVal, partID(partNo), sErr) + dist_readPartID = .true. + + case(dist_fmtParentID) + call chr_cast(inVal, parentID(partNo), sErr) + dist_readParentID = .true. + + ! Horizontal Coordinates + ! ======================== + + case(dist_fmtX, dist_fmtXN, dist_fmtJX) + call chr_cast(inVal, dist_partCol1(partNo), sErr) + dist_partCol1(partNo) = dist_partCol1(partNo) * dist_colScale(colNo) + + case(dist_fmtPX, dist_fmtXP, dist_fmtPXP0, dist_fmtPXN, dist_fmtPhiX) + call chr_cast(inVal, dist_partCol2(partNo), sErr) + dist_partCol2(partNo) = dist_partCol2(partNo) * dist_colScale(colNo) + + ! Vertical Coordinates + ! ======================== + + case(dist_fmtY, dist_fmtYN, dist_fmtJY) + call chr_cast(inVal, dist_partCol3(partNo), sErr) + dist_partCol3(partNo) = dist_partCol3(partNo) * dist_colScale(colNo) + + case(dist_fmtPY, dist_fmtYP, dist_fmtPYP0, dist_fmtPYN, dist_fmtPhiY) + call chr_cast(inVal, dist_partCol4(partNo), sErr) + dist_partCol4(partNo) = dist_partCol4(partNo) * dist_colScale(colNo) + + ! Longitudinal Coordinates + ! ========================== + + case(dist_fmtSIGMA, dist_fmtZETA, dist_fmtDT, dist_fmtZN, dist_fmtJZ) + call chr_cast(inVal, dist_partCol5(partNo), sErr) + dist_partCol5(partNo) = dist_partCol5(partNo) * dist_colScale(colNo) + + case(dist_fmtE, dist_fmtDEE0, dist_fmtPT, dist_fmtPSIGMA, dist_fmtP, dist_fmtDPP0, dist_fmtPZN, dist_fmtPhiZ) + call chr_cast(inVal, dist_partCol6(partNo), sErr) + dist_partCol6(partNo) = dist_partCol6(partNo) * dist_colScale(colNo) + + ! Ion Columns + ! ============= + + case(dist_fmtMASS) + call chr_cast(inVal, nucm(partNo), sErr) + nucm(partNo) = nucm(partNo) * dist_colScale(colNo) + dist_readMass = .true. + + case(dist_fmtCHARGE) + call chr_cast(inVal, nqq(partNo), sErr) + dist_readCharge = .true. + + case(dist_fmtIonA) + call chr_cast(inVal, naa(partNo), sErr) + dist_readIonA = .true. + + case(dist_fmtIonZ) + call chr_cast(inVal, nzz(partNo), sErr) + dist_readIonZ = .true. + + case(dist_fmtPDGID) + call chr_cast(inVal, pdgid(partNo), sErr) + dist_readPDGID = .true. + + ! Spin Columns + ! ============== + + case(dist_fmtSPINX) + call chr_cast(inVal, spin_x(partNo), sErr) + + case(dist_fmtSPINY) + call chr_cast(inVal, spin_y(partNo), sErr) + + case(dist_fmtSPINZ) + call chr_cast(inVal, spin_z(partNo), sErr) + + end select + +end subroutine dist_saveParticle + +! ================================================================================================ ! +! Run the FILLs +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-30 +! Updated: 2019-07-30 +! ================================================================================================ ! +subroutine dist_doFills + + use crcoall + use mod_common + use mod_common_main + use, intrinsic :: iso_fortran_env, only : int16 + + integer iFill, j, iA, iB, iVal, fM, fT, intVal + + if(dist_nFill == 0) then return end if - if(nSplit == 0) return - select case(lnSplit(1)) + ! If we have fills, we consider all particles generated + dist_numPart = napx - case("READ") - if(nSplit < 2) then - write(lerr,"(a)") "DIST> ERROR READ must be followed by one file name only." - iErr = .true. - return + do iFill=1,dist_nFill + + iA = dist_fillList(iFill)%iParams(1) + iB = dist_fillList(iFill)%iParams(2) + if(iB == -1) then + iB = napx end if - dist_readFile = trim(lnSplit(2)) - call f_requestUnit(dist_readFile, dist_readUnit) - if(.not.dist_enable) dist_enable = .true. - case("ECHO") - if(nSplit >= 2) then - dist_echoFile = trim(lnSplit(2)) - else - dist_echoFile = "echo_distribution.dat" + fM = dist_fillList(iFill)%fillMethod + fT = dist_fillList(iFill)%fillTarget + + if((fM == dist_fillGAUSS .or. fM == dist_fillUNIFORM) .and. dist_seedOne < 1) then + write(lerr,"(a)") "DIST> ERROR Random number fill requested, but no SEED provided in DIST block" + call prror end if - dist_echo = .true. - call f_requestUnit(dist_echoFile, dist_echoUnit) - case default - write(lerr,"(a)") "DIST> ERROR Unknown keyword '"//trim(lnSplit(1))//"'." - iErr = .true. - return + select case(fT) + + case(dist_fmtNONE) + return + + case(dist_fmtPartID) + dist_readPartID = .true. + if(fM == dist_fillCOUNT) then + iVal = dist_fillList(iFill)%iParams(3) + do j=iA,iB + partID(j) = iVal + iVal = iVal + dist_fillList(iFill)%iParams(4) + end do + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be COUNT" + call prror + end if + + case(dist_fmtParentID) + write(lerr,"(a)") "DIST> ERROR Variable "//trim(dist_fillList(iFill)%fillName)//" cannot be filled automatically" + call prror + + ! Horizontal Coordinates + ! ======================== + + case(dist_fmtX, dist_fmtXN, dist_fmtJX) + if(fM == dist_fillFLOAT .or. fM == dist_fillGAUSS .or. fM == dist_fillUNIFORM .or. fM == dist_fillLINEAR) then + call dist_fillThis(dist_partCol1, iA, iB, fM, dist_fillList(iFill)%fParams) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be FLOAT, GAUSS, UNIFORM or LINEAR" + call prror + end if + + case(dist_fmtPX, dist_fmtXP, dist_fmtPXP0, dist_fmtPXN, dist_fmtPhiX) + if(fM == dist_fillFLOAT .or. fM == dist_fillGAUSS .or. fM == dist_fillUNIFORM .or. fM == dist_fillLINEAR) then + call dist_fillThis(dist_partCol2, iA, iB, fM, dist_fillList(iFill)%fParams) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be FLOAT, GAUSS, UNIFORM or LINEAR" + call prror + end if + + ! Vertical Coordinates + ! ======================== + + case(dist_fmtY, dist_fmtYN, dist_fmtJY) + if(fM == dist_fillFLOAT .or. fM == dist_fillGAUSS .or. fM == dist_fillUNIFORM .or. fM == dist_fillLINEAR) then + call dist_fillThis(dist_partCol3, iA, iB, fM, dist_fillList(iFill)%fParams) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be FLOAT, GAUSS, UNIFORM or LINEAR" + call prror + end if + + case(dist_fmtPY, dist_fmtYP, dist_fmtPYP0, dist_fmtPYN, dist_fmtPhiY) + if(fM == dist_fillFLOAT .or. fM == dist_fillGAUSS .or. fM == dist_fillUNIFORM .or. fM == dist_fillLINEAR) then + call dist_fillThis(dist_partCol4, iA, iB, fM, dist_fillList(iFill)%fParams) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be FLOAT, GAUSS, UNIFORM or LINEAR" + call prror + end if + + ! Longitudinal Coordinates + ! ========================== + + case(dist_fmtSIGMA, dist_fmtZETA, dist_fmtDT, dist_fmtZN, dist_fmtJZ) + if(fM == dist_fillFLOAT .or. fM == dist_fillGAUSS .or. fM == dist_fillUNIFORM .or. fM == dist_fillLINEAR) then + call dist_fillThis(dist_partCol5, iA, iB, fM, dist_fillList(iFill)%fParams) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be FLOAT, GAUSS, UNIFORM or LINEAR" + call prror + end if + + case(dist_fmtE, dist_fmtDEE0, dist_fmtPT, dist_fmtPSIGMA, dist_fmtP, dist_fmtDPP0, dist_fmtPZN, dist_fmtPhiZ) + if(fM == dist_fillFLOAT .or. fM == dist_fillGAUSS .or. fM == dist_fillUNIFORM .or. fM == dist_fillLINEAR) then + call dist_fillThis(dist_partCol6, iA, iB, fM, dist_fillList(iFill)%fParams) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be FLOAT, GAUSS, UNIFORM or LINEAR" + call prror + end if + + ! Ion Columns + ! ============= + + case(dist_fmtMASS) + if(fM == dist_fillFLOAT) then + call dist_fillThis(nucm, iA, iB, fM, dist_fillList(iFill)%fParams) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be FLOAT" + call prror + end if + dist_readMass = .true. + + case(dist_fmtCHARGE) + if(fM == dist_fillINT) then + nqq(iA:iB) = int(dist_fillList(iFill)%iParams(3), kind=int16) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be INT" + call prror + end if + dist_readCharge = .true. + + case(dist_fmtIonA) + if(fM == dist_fillINT) then + naa(iA:iB) = int(dist_fillList(iFill)%iParams(3), kind=int16) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be INT" + call prror + end if + dist_readIonA = .true. + + case(dist_fmtIonZ) + if(fM == dist_fillINT) then + nzz(iA:iB) = int(dist_fillList(iFill)%iParams(3), kind=int16) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be INT" + call prror + end if + dist_readIonZ = .true. + + case(dist_fmtPDGID) + if(fM == dist_fillINT) then + pdgid(iA:iB) = dist_fillList(iFill)%iParams(3) + else + write(lerr,"(a)") "DIST> ERROR FILL "//trim(dist_fillList(iFill)%fillName)//" must be INT" + call prror + end if + dist_readPDGID = .true. + + ! Spin Columns + ! ============== + + case(dist_fmtSPINX, dist_fmtSPINY, dist_fmtSPINZ) + write(lerr,"(a)") "DIST> ERROR Variable "//trim(dist_fillList(iFill)%fillName)//" cannot be filled automatically" + call prror + + end select + end do + +end subroutine dist_doFills + +! ================================================================================================ ! +! Fill Arrays +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-30 +! Updated: 2019-07-30 +! ================================================================================================ ! +subroutine dist_fillThis(fillArray, iA, iB, fillMethod, fParams) + + use mod_ranecu + + real(kind=fPrec), intent(inout) :: fillArray(*) + integer, intent(in) :: iA, iB + integer, intent(in) :: fillMethod + real(kind=fPrec), intent(in) :: fParams(*) + + integer tmpOne, tmpTwo, nRnd, j + real(kind=fPrec) rndVals(iB-iA+1), dStep + + nRnd = iB-iA+1 + + select case(fillMethod) + + case(dist_fillFLOAT) + fillArray(iA:iB) = fParams(1) + + case(dist_fillGAUSS) + call recuut(tmpOne, tmpTwo) + call recuin(dist_seedOne, dist_seedTwo) + + call ranecu(rndVals, nRnd, 1, fParams(3)) + fillArray(iA:iB) = rndVals*fParams(1) + fParams(2) + + call recuut(dist_seedOne, dist_seedTwo) + call recuin(tmpOne, tmpTwo) + + case(dist_fillUNIFORM) + call recuut(tmpOne, tmpTwo) + call recuin(dist_seedOne, dist_seedTwo) + + call ranecu(rndVals, nRnd, 0) + fillArray(iA:iB) = rndVals*(fParams(2)-fParams(1)) + fParams(1) + + call recuut(dist_seedOne, dist_seedTwo) + call recuin(tmpOne, tmpTwo) + + case(dist_fillLINEAR) + dStep = (fParams(2)-fParams(1))/real(iB-iA,kind=fPrec) + do j=iA,iB + fillArray(j) = fParams(1) + dStep*real(j-iA,kind=fPrec) + end do end select -end subroutine dist_parseInputLine +end subroutine dist_fillThis ! ================================================================================================ ! -! A. Mereghetti and D. Sinuela Pastor, for the FLUKA Team +! Post-Processing of Particle Arrays ! V.K. Berglyd Olsen, BE-ABP-HSS -! Last modified: 2018-10-30 +! Created: 2019-07-05 +! Updated: 2019-07-13 ! ================================================================================================ ! -subroutine dist_readDist +subroutine dist_postprParticles - use parpro + use crcoall use mod_common - use mod_common_main - use string_tools use mod_particles + use mod_common_main use physical_constants use numerical_constants - use mod_units, only : f_open, f_close - implicit none + logical doAction, doNormal - integer id, gen, j, ln, nSplit - real(kind=fPrec) weight, z, zp, dt(npart) - logical spErr, cErr - character(len=mInputLn) inLine - character(len=:), allocatable :: lnSplit(:) + doAction = .false. + doNormal = .false. - write(lout,"(a)") "DIST> Reading particles from '"//trim(dist_readFile)//"'" - - xv1(:) = zero - yv1(:) = zero - xv2(:) = zero - yv2(:) = zero - sigmv(:) = zero - ejfv(:) = zero - ejf0v(:) = zero - naa(:) = 0 - nzz(:) = 0 - nqq(:) = 0 - pdgid(:) = 0 - nucm(:) = zero - dt(:) = zero - - j = 0 - ln = 0 - cErr = .false. + ! Forward energy/momentum must be calculated first + select case(dist_partFmt(6)) + case(dist_fmtNONE) + ejv(1:napx) = e0 + call part_updatePartEnergy(1,.false.) + case(dist_fmtE) + ejv(1:napx) = dist_partCol6(1:napx) + call part_updatePartEnergy(1,.false.) + case(dist_fmtP) + ejfv(1:napx) = dist_partCol6(1:napx) + call part_updatePartEnergy(2,.false.) + case(dist_fmtDEE0) + ejv(1:napx) = (one + dist_partCol6(1:napx))*e0 + call part_updatePartEnergy(1,.false.) + case(dist_fmtDPP0) + dpsv(1:napx) = dist_partCol6(1:napx) + call part_updatePartEnergy(3,.false.) + case(dist_fmtPT) + ejv(1:napx) = dist_partCol6(1:napx)*e0f + e0 + call part_updatePartEnergy(1,.false.) + case(dist_fmtPSIGMA) + ejv(1:napx) = (dist_partCol6(1:napx)*e0f)*beta0 + e0 + call part_updatePartEnergy(1,.false.) + case(dist_fmtPZN) + doNormal = .true. + case(dist_fmtPhiZ) + doAction = .true. + end select - call f_open(unit=dist_readUnit,file=dist_readFile,mode='r',err=cErr,formatted=.true.,status="old") - if(cErr) goto 19 + select case(dist_partFmt(5)) + case(dist_fmtNONE) + sigmv(1:napx) = zero + case(dist_fmtZETA) + sigmv(1:napx) = dist_partCol5(1:napx)/rvv(1:napx) + case(dist_fmtSIGMA) + sigmv(1:napx) = dist_partCol5(1:napx) + case(dist_fmtDT) + sigmv(1:napx) = -beta0*(dist_partCol5(1:napx)*clight) + case(dist_fmtZN) + doNormal = .true. + case(dist_fmtJZ) + doAction = .true. + end select -10 continue - read(dist_readUnit,"(a)",end=30,err=20) inLine - ln = ln+1 + select case(dist_partFmt(1)) + case(dist_fmtNONE) + xv1(1:napx) = zero + case(dist_fmtX) + xv1(1:napx) = dist_partCol1(1:napx) + case(dist_fmtXN) + doNormal = .true. + case(dist_fmtJX) + doAction = .true. + end select - if(inLine(1:1) == "*") goto 10 - if(inLine(1:1) == "#") goto 10 - if(inLine(1:1) == "!") goto 10 - j = j+1 + select case(dist_partFmt(2)) + case(dist_fmtNONE) + yv1(1:napx) = zero + case(dist_fmtXP) + yv1(1:napx) = dist_partCol2(1:napx) + case(dist_fmtPX) + yv1(1:napx) = (dist_partCol2(1:napx)/ejfv(1:napx))*c1e3 + case(dist_fmtPXP0) + yv1(1:napx) = ((dist_partCol2(1:napx)*e0f)/ejfv(1:napx))*c1e3 + case(dist_fmtPXN) + doNormal = .true. + case(dist_fmtPhiX) + doAction = .true. + end select - if(j > napx) then - write(lout,"(a,i0,a)") "DIST> Stopping reading file as ",napx," particles have been read, as requested in "//trim(fort3) - j = napx - goto 30 - end if + select case(dist_partFmt(3)) + case(dist_fmtNONE) + xv2(1:napx) = zero + case(dist_fmtY) + xv2(1:napx) = dist_partCol3(1:napx) + case(dist_fmtYN) + doNormal = .true. + case(dist_fmtJY) + doAction = .true. + end select - call chr_split(inLine, lnSplit, nSplit, spErr) - if(spErr) goto 20 - if(nSplit > 0) call chr_cast(lnSplit(1), id, cErr) - if(nSplit > 1) call chr_cast(lnSplit(2), gen, cErr) - if(nSplit > 2) call chr_cast(lnSplit(3), weight, cErr) - if(nSplit > 3) call chr_cast(lnSplit(4), xv1(j), cErr) - if(nSplit > 4) call chr_cast(lnSplit(5), xv2(j), cErr) - if(nSplit > 5) call chr_cast(lnSplit(6), z, cErr) - if(nSplit > 6) call chr_cast(lnSplit(7), yv1(j), cErr) - if(nSplit > 7) call chr_cast(lnSplit(8), yv2(j), cErr) - if(nSplit > 8) call chr_cast(lnSplit(9), zp, cErr) - if(nSplit > 9) call chr_cast(lnSplit(10), naa(j), cErr) - if(nSplit > 10) call chr_cast(lnSplit(11), nzz(j), cErr) - if(nSplit > 11) call chr_cast(lnSplit(12), nucm(j), cErr) - if(nSplit > 12) call chr_cast(lnSplit(13), ejfv(j), cErr) - if(nSplit > 13) call chr_cast(lnSplit(14), dt(j), cErr) - if(nSplit > 14) call chr_cast(lnSplit(15), nqq(j), cErr) - if(nSplit > 15) call chr_cast(lnSplit(16), pdgid(j),cErr) - if(cErr) goto 20 + select case(dist_partFmt(4)) + case(dist_fmtNONE) + yv2(1:napx) = zero + case(dist_fmtYP) + yv2(1:napx) = dist_partCol4(1:napx) + case(dist_fmtPY) + yv2(1:napx) = (dist_partCol4(1:napx)/ejfv(1:napx))*c1e3 + case(dist_fmtPYP0) + yv2(1:napx) = ((dist_partCol4(1:napx)*e0f)/ejfv(1:napx))*c1e3 + case(dist_fmtPYN) + doNormal = .true. + case(dist_fmtPhiY) + doAction = .true. + end select - xv1(j) = xv1(j)*c1e3 - xv2(j) = xv2(j)*c1e3 - yv1(j) = yv1(j)*c1e3 - yv2(j) = yv2(j)*c1e3 - ejfv(j) = ejfv(j)*c1e3 - nucm(j) = nucm(j)*c1e3 - sigmv(j) = -(e0f/e0)*((dt(j)*clight)*c1e3) + if(doNormal .and. doAction) then + write(lerr,"(a)") "DIST> ERROR Cannot mix normalised and action coordinates" + call prror + end if - if(nSplit <= 14) then - nqq(j)=nzz(j) +#ifdef DISTLIB + if(doNormal .and. dist_distLibNorm) then + call distlib_setCoords( & + dist_partCol1, dist_partCol2, dist_partCol3, & + dist_partCol4, dist_partCol5, dist_partCol6, & + napx, dist_coordTypeNormal & + ) end if - mtc(j) = (nqq(j)*nucm0)/(qq0*nucm(j)) - partID(j) = j - parentID(j) = j - pstop(j) = .false. - ejf0v(j) = ejfv(j) + if(doAction .and. dist_distLibNorm) then + call distlib_setCoords( & + dist_partCol1, dist_partCol2, dist_partCol3, & + dist_partCol4, dist_partCol5, dist_partCol6, & + napx, dist_coordTypeAction & + ) + end if +#endif - if(nSplit <= 15) then - call CalculatePDGid(pdgid(j), naa(j), nzz(j)) + if(doNormal .and. .not. dist_distLibNorm) then + call dist_normToPhysical end if - goto 10 +end subroutine dist_postprParticles -19 continue - write(lerr,"(a)") "DIST> ERROR Opening file '"//trim(dist_readFile)//"'" - call prror - return +! ================================================================================================ ! +! Apply normalisation matrix +! V.K. Berglyd Olsen, BE-ABP-HSS +! Created: 2019-07-30 +! Updated: 2019-07-30 +! ================================================================================================ ! +subroutine dist_normToPhysical -20 continue - write(lerr,"(a,i0)") "DIST> ERROR Reading particles from line ",ln - call prror - return + use mod_common + use mod_particles + use mod_common_main + use numerical_constants -30 continue - if(j == 0) then - write(lerr,"(a)") "DIST> ERROR Reading particles. No particles read from file." - call prror - return - end if + real(kind=fPrec) sqEmitX, sqEmitY, sqEmitZ - call f_close(dist_readUnit) - write(lout,"(a,i0,a)") "DIST> Read ",j," particles from file '"//trim(dist_readFile)//"'" + sqEmitX = sqrt(dist_beamEmit(1)) + sqEmitY = sqrt(dist_beamEmit(2)) + sqEmitZ = sqrt(dist_beamEmit(3)) - ! Update longitudinal particle arrays from read momentum - call part_updatePartEnergy(2) + xv1(1:napx) = ( & + dist_partCol1(1:napx) * (sqEmitX * dist_tMat(1,1)) + & + dist_partCol2(1:napx) * (sqEmitX * dist_tMat(1,2)) + & + dist_partCol3(1:napx) * (sqEmitY * dist_tMat(1,3)) + & + dist_partCol4(1:napx) * (sqEmitY * dist_tMat(1,4)) + & + dist_partCol5(1:napx) * (sqEmitZ * dist_tMat(1,5)) + & + dist_partCol6(1:napx) * (sqEmitZ * dist_tMat(1,6))) * c1e3 - if(j < napx) then - write(lout,"(a,i0)") "DIST> WARNING Read a number of particles LOWER than requested: ",napx - napx = j - end if + yv1(1:napx) = ( & + dist_partCol1(1:napx) * (sqEmitX * dist_tMat(2,1)) + & + dist_partCol2(1:napx) * (sqEmitX * dist_tMat(2,2)) + & + dist_partCol3(1:napx) * (sqEmitY * dist_tMat(2,3)) + & + dist_partCol4(1:napx) * (sqEmitY * dist_tMat(2,4)) + & + dist_partCol5(1:napx) * (sqEmitZ * dist_tMat(2,5)) + & + dist_partCol6(1:napx) * (sqEmitZ * dist_tMat(2,6))) * (c1e3*(one+dpsv(1:napx))) -end subroutine dist_readDist + xv2(1:napx) = ( & + dist_partCol1(1:napx) * (sqEmitX * dist_tMat(3,1)) + & + dist_partCol2(1:napx) * (sqEmitX * dist_tMat(3,2)) + & + dist_partCol3(1:napx) * (sqEmitY * dist_tMat(3,3)) + & + dist_partCol4(1:napx) * (sqEmitY * dist_tMat(3,4)) + & + dist_partCol5(1:napx) * (sqEmitZ * dist_tMat(3,5)) + & + dist_partCol6(1:napx) * (sqEmitZ * dist_tMat(3,6))) * c1e3 + + yv2(1:napx) = ( & + dist_partCol1(1:napx) * (sqEmitX * dist_tMat(4,1)) + & + dist_partCol2(1:napx) * (sqEmitX * dist_tMat(4,2)) + & + dist_partCol3(1:napx) * (sqEmitY * dist_tMat(4,3)) + & + dist_partCol4(1:napx) * (sqEmitY * dist_tMat(4,4)) + & + dist_partCol5(1:napx) * (sqEmitZ * dist_tMat(4,5)) + & + dist_partCol6(1:napx) * (sqEmitZ * dist_tMat(4,6))) * (c1e3*(one+dpsv(1:napx))) + + sigmv(1:napx) = ( & + dist_partCol1(1:napx) * (sqEmitX * dist_tMat(5,1)) + & + dist_partCol2(1:napx) * (sqEmitX * dist_tMat(5,2)) + & + dist_partCol3(1:napx) * (sqEmitY * dist_tMat(5,3)) + & + dist_partCol4(1:napx) * (sqEmitY * dist_tMat(5,4)) + & + dist_partCol5(1:napx) * (sqEmitZ * dist_tMat(5,5)) + & + dist_partCol6(1:napx) * (sqEmitZ * dist_tMat(5,6))) / rvv(1:napx) + + dpsv(1:napx) = ( & + dist_partCol1(1:napx) * (sqEmitX * dist_tMat(6,1)) + & + dist_partCol2(1:napx) * (sqEmitX * dist_tMat(6,2)) + & + dist_partCol3(1:napx) * (sqEmitY * dist_tMat(6,3)) + & + dist_partCol4(1:napx) * (sqEmitY * dist_tMat(6,4)) + & + dist_partCol5(1:napx) * (sqEmitZ * dist_tMat(6,5)) + & + dist_partCol6(1:napx) * (sqEmitZ * dist_tMat(6,6))) + + call part_updatePartEnergy(3,.true.) + +end subroutine dist_normToPhysical ! ================================================================================================ ! ! A. Mereghetti and D. Sinuela Pastor, for the FLUKA Team ! V.K. Berglyd Olsen, BE-ABP-HSS -! Last modified: 2018-10-31 +! Updated: 2019-07-09 ! ================================================================================================ ! subroutine dist_finaliseDist use parpro + use mod_pdgid use mod_common - use mod_common_track use mod_common_main + use mod_common_track use numerical_constants - implicit none + real(kind=fPrec) chkP, chkE + integer j + + ! Finish the ION bits + if(dist_numPart /= napx) then + write(lerr,"(2(a,i0),a)") "DIST> ERROR Number of particles read or generated is ",dist_numPart,& + " but the simulation setup requests ",napx," particles" + call prror + end if - integer :: j - real(kind=fPrec) :: chkP, chkE + if(dist_readIonA .neqv. dist_readIonZ) then + write(lerr,"(a)") "DIST> ERROR ION_A and ION_Z columns have to both be present if one of them is" + call prror + end if + + if(dist_readParentID .and. .not. dist_readPartID) then + write(lerr,"(a)") "DIST> ERROR If you set particle parent ID you must also set particle ID" + call prror + end if + + if(dist_readPartID .and. .not. dist_readParentID) then + parentID(1:napx) = partID(1:napx) + end if + + if(dist_readIonZ .and. .not. dist_readCharge) then + nqq(1:napx) = nzz(1:napx) + end if + mtc(1:napx) = (nqq(1:napx)*nucm0)/(qq0*nucm(1:napx)) + + if(dist_readIonA .and. dist_readIonZ .and. .not. dist_readPDGID) then + do j=1,napx + call CalculatePDGid(pdgid(j), naa(j), nzz(j)) + end do + end if ! Check existence of on-momentum particles in the distribution do j=1, napx @@ -290,58 +2005,41 @@ subroutine dist_finaliseDist write(lout,"(a,2(1x,i0),1x,f15.7,2(1x,i0))") "DIST> Reference particle species [A,Z,M,Q,ID]:", aa0, zz0, nucm0, qq0, pdgid0 write(lout,"(a,1x,f15.7)") "DIST> Reference energy [Z TeV]:", c1m6*e0/qq0 - do j=napx+1,npart - partID(j) = j - parentID(j) = j - pstop(j) = .true. - ejv(j) = zero - dpsv(j) = zero - oidpsv(j) = one - mtc(j) = one - naa(j) = aa0 - nzz(j) = zz0 - nqq(j) = qq0 - pdgid(j) = pdgid0 - nucm(j) = nucm0 - moidpsv(j) = one - omoidpsv(j) = zero - end do - end subroutine dist_finaliseDist ! ================================================================================================ ! ! A. Mereghetti and D. Sinuela Pastor, for the FLUKA Team ! V.K. Berglyd Olsen, BE-ABP-HSS -! Last modified: 2018-10-30 +! Updated: 2019-07-08 ! ================================================================================================ ! subroutine dist_echoDist use mod_common use mod_common_main - use mod_units, only : f_open, f_close + use mod_units - integer j + integer j, fUnit logical cErr - call f_open(unit=dist_echoUnit,file=dist_echoFile,mode='w',err=cErr,formatted=.true.) + call f_requestUnit(dist_echoFile, fUnit) + call f_open(unit=fUnit,file=dist_echoFile,mode='w',err=cErr,formatted=.true.) if(cErr) goto 19 - rewind(dist_echoUnit) - write(dist_echoUnit,"(a,1pe25.18)") "# Total energy of synch part [MeV]: ",e0 - write(dist_echoUnit,"(a,1pe25.18)") "# Momentum of synch part [MeV/c]: ",e0f - write(dist_echoUnit,"(a)") "#" - write(dist_echoUnit,"(a)") "# x[mm], y[mm], xp[mrad], yp[mrad], sigmv[mm], ejfv[MeV/c]" + rewind(fUnit) + write(fUnit,"(a,1pe25.18)") "# Total energy of synch part [MeV]: ",e0 + write(fUnit,"(a,1pe25.18)") "# Momentum of synch part [MeV/c]: ",e0f + write(fUnit,"(a)") "#" + write(fUnit,"(a)") "# x[mm], y[mm], xp[mrad], yp[mrad], sigmv[mm], ejfv[MeV/c]" do j=1, napx - write(dist_echoUnit,"(6(1x,1pe25.18))") xv1(j), yv1(j), xv2(j), yv2(j), sigmv(j), ejfv(j) + write(fUnit,"(6(1x,1pe25.18))") xv1(j), yv1(j), xv2(j), yv2(j), sigmv(j), ejfv(j) end do - call f_close(dist_echoUnit) + call f_close(fUnit) return 19 continue write(lerr,"(a)") "DIST> ERROR Opening file '"//trim(dist_echoFile)//"'" call prror - return end subroutine dist_echoDist diff --git a/source/mod_fluc.f90 b/source/mod_fluc.f90 index 54f418c25..c16b49ff9 100644 --- a/source/mod_fluc.f90 +++ b/source/mod_fluc.f90 @@ -144,7 +144,7 @@ subroutine fluc_moreRandomness real(kind=fPrec) :: tmpRnd(newRnd) call recuin(fluc_iSeed1, fluc_iSeed2) - call ranecu(tmpRnd, newRnd, mcut) + call ranecu(tmpRnd, newRnd, 1, real(mcut,kind=fPrec)) call recuut(fluc_iSeed1, fluc_iSeed2) if(nzfz == -1) nzfz = 0 diff --git a/source/mod_particles.f90 b/source/mod_particles.f90 index b33a64751..88f2c9235 100644 --- a/source/mod_particles.f90 +++ b/source/mod_particles.f90 @@ -5,7 +5,6 @@ ! ================================================================================================ ! module mod_particles - use crcoall use floatPrecision implicit none @@ -56,7 +55,7 @@ subroutine part_applyClosedOrbit xv2(1:napx) = xv2(1:napx) + clo(2)*real(idz(2),fPrec) yv2(1:napx) = yv2(1:napx) + clop(2)*real(idz(2),fPrec) end if - call part_updatePartEnergy(3) + call part_updatePartEnergy(3,.false.) end subroutine part_applyClosedOrbit @@ -67,6 +66,7 @@ end subroutine part_applyClosedOrbit ! ================================================================================================ ! subroutine part_updateRefEnergy(refEnergy) + use crcoall use mod_common use mod_common_main use numerical_constants, only : one, c1m6 @@ -88,7 +88,8 @@ subroutine part_updateRefEnergy(refEnergy) e0 = refEnergy e0f = sqrt(e0**2 - nucm0**2) gammar = nucm0/e0 - betrel = sqrt((one+gammar)*(one-gammar)) + gamma0 = e0/nucm0 + beta0 = sqrt((one+gammar)*(one-gammar)) brho = (e0f/(clight*c1m6))/qq0 ! Also update sigmv with the new beta0 = e0f/e0 @@ -99,7 +100,7 @@ subroutine part_updateRefEnergy(refEnergy) call prror end if - call part_updatePartEnergy(1) + call part_updatePartEnergy(1,.false.) end subroutine part_updateRefEnergy @@ -108,8 +109,9 @@ end subroutine part_updateRefEnergy ! Last modified: 2019-01-10 ! Updates the relevant particle arrays after the particle's energy, momentum or delta has changed. ! ================================================================================================ ! -subroutine part_updatePartEnergy(refArray,updateAngle) +subroutine part_updatePartEnergy(refArray, updateAngle) + use crcoall use mod_common use mod_common_track use mod_common_main @@ -117,21 +119,15 @@ subroutine part_updatePartEnergy(refArray,updateAngle) implicit none - integer, intent(in) :: refArray - logical, optional, intent(in) :: updateAngle - - logical :: doUpdateAngle = .false. + integer, intent(in) :: refArray + logical, intent(in) :: updateAngle !if(part_isTracking .and. refArray /= 1) then ! write(lerr,"(a)") "PART> ERROR During tracking, only energy updates are allowed in part_updatePartEnergy." ! call prror !end if - if(present(updateAngle)) then - doUpdateAngle = updateAngle - end if - - if(doUpdateAngle .and. refArray /= 2) then + if(updateAngle .and. refArray /= 2) then ! If momentum is updated before the call, then ejf0v must be too ejf0v(1:napx) = ejfv(1:napx) end if @@ -161,7 +157,7 @@ subroutine part_updatePartEnergy(refArray,updateAngle) omoidpsv(1:napx) = ((one-mtc(1:napx))*oidpsv(1:napx))*c1e3 rvv(1:napx) = (ejv(1:napx)*e0f)/(e0*ejfv(1:napx)) ! Beta_0 / beta(j) - if(doUpdateAngle) then ! Update particle angles + if(updateAngle) then ! Update particle angles yv1(1:napx) = (ejf0v(1:napx)/ejfv(1:napx))*yv1(1:napx) yv2(1:napx) = (ejf0v(1:napx)/ejfv(1:napx))*yv2(1:napx) end if @@ -182,8 +178,8 @@ end subroutine part_updatePartEnergy ! ================================================================================================ ! subroutine part_writeState(fileName, isText, withIons) - use mod_units use parpro + use mod_units use mod_common use mod_common_main use mod_common_track diff --git a/source/postprocessing.f90 b/source/postprocessing.f90 index ce081cb0a..1edc31ee6 100644 --- a/source/postprocessing.f90 +++ b/source/postprocessing.f90 @@ -3445,6 +3445,8 @@ subroutine writebin(nthinerr) ! partID(ia)=particle ID that is not changing ! (the particle arrays are compressed to remove lost particles) ! In the case of no lost particles, all partID(i)=i for 1..npart + ! FIXME: This logic assumes partID(ia)+1 exists, which it may very well not! + ! This only works if the largest particle ID is in the last position. if(.not.pstop(partID(ia)).and..not.pstop(partID(ia)+1).and. & & (mod(partID(ia),2).ne.0)) then !Skip odd particle IDs diff --git a/source/ranecu.f90 b/source/ranecu.f90 index 73644473b..140fa5af6 100644 --- a/source/ranecu.f90 +++ b/source/ranecu.f90 @@ -32,29 +32,34 @@ module mod_ranecu contains -! Generate LEN random numbers into RVEC -! If mcut == 0, generate normal distributed random numbers -! If mcut > 0, generate normal distributed random numbers r <= mcut -! If mcut == -1, generate uniformly distributed random numbers -subroutine ranecu(rvec,len,mcut) +! Generate LEN random numbers into RVEC with optional sigma cut if normal +! mode 0 : Generate uniformly distributed random numbers +! mode 1 : Generate normal distributed random numbers +subroutine ranecu(rvec, len, mode, cut) use crcoall use floatPrecision use mathlib_bouncer use numerical_constants - implicit none - real(kind=fPrec), intent(out), dimension(*) :: rvec - integer, intent(in) :: len, mcut + real(kind=fPrec), intent(out) :: rvec(*) + integer, intent(in) :: len + integer, intent(in) :: mode + real(kind=fPrec), optional, intent(in) :: cut + + real(kind=fPrec) rvec0, r(2), docut + integer i, iz, j, k - integer i,iz,j,k - real(kind=fPrec) rvec0 - real(kind=fPrec), dimension(2) :: r + if(present(cut)) then + docut = cut + else + docut = zero + end if - i=1 + i = 1 rvec0 = zero - if(mcut < -1) then - write(lerr,"(a,i0)") "RANECU> ERROR mcut must be greater or equal to -1, got ", mcut + if(mode /= 0 .and. mode /= 1) then + write(lerr,"(a,i0)") "RANECU> ERROR mode must be 0 (uniform) or 1 (normal), got ", mode call prror end if @@ -71,19 +76,19 @@ subroutine ranecu(rvec,len,mcut) r(j) = real(iz,fPrec)*4.656613e-10_fPrec end do - if (mcut >= 0) then ! mcut = -1 => Generate uniform numbers! + if(mode == 1) then ! Convert r(1), r(2) from U(0,1) -> rvec0 as Gaussian with cutoff mcut (#sigmas): - rvec0 = sqrt(((-one*two)*log_mb(r(1))))*cos_mb((two*pi)*r(2)) - else if (mcut == -1) then + rvec0 = sqrt((-one*two)*log_mb(r(1))) * cos_mb(twopi*r(2)) + else rvec0 = r(1) end if - if(abs(rvec0) <= real(mcut,fPrec) .or. mcut == 0 .or. mcut == -1) then + if(mode == 0 .or. docut <= zero .or. abs(rvec0) <= docut) then rvec(i) = rvec0 - i=i+1 + i = i + 1 end if + if(i <= len) goto 10 - return end subroutine ranecu diff --git a/source/scatter.f90 b/source/scatter.f90 index 0fe82a228..21b0c4f37 100644 --- a/source/scatter.f90 +++ b/source/scatter.f90 @@ -911,7 +911,7 @@ subroutine scatter_thin(iElem, ix, turn) end do ! Generate random numbers for probability, branching ratio and phi angle - call ranecu(rndVals, napx*3, -1) + call ranecu(rndVals, napx*3, 0) ! Loop over particles do j=1,napx @@ -1380,7 +1380,7 @@ function scatter_generator_getPPElastic(a, b1, b2, phi, tmin) result(t) maxItt = 1000000 do nItt = nItt + 1 - call ranecu(rndArr, 3, -1) + call ranecu(rndArr, 3, 0) ! Randomly switch between g1 and g3 according to probability if(rndArr(1) > prob3) then diff --git a/source/sixtrack.f90 b/source/sixtrack.f90 index f402b041b..2f3fe7ea8 100644 --- a/source/sixtrack.f90 +++ b/source/sixtrack.f90 @@ -916,16 +916,17 @@ subroutine daten omoidpsv(:) = zero gammar = nucm0/e0 - betrel = sqrt((one+gammar)*(one-gammar)) + gamma0 = e0/nucm0 + beta0 = sqrt((one+gammar)*(one-gammar)) e0f = sqrt(e0**2-nucm0**2) brho = (e0f/(clight*c1m6))/qq0 if(nbeam >= 1) then parbe14 = (((((-one*crad)*partnum)/four)/pi)/sixin_emitNX)*c1e6 end if - crad = (((two*crad)*partnum)*gammar)*c1e6 - emitx = sixin_emitNX*gammar - emity = sixin_emitNY*gammar + crad = (((two*crad)*partnum)*gammar)*c1e6 + emitx = sixin_emitNX*gammar + emity = sixin_emitNY*gammar if(do_coll) then call collimate_postInput(gammar) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9c0be5cf0..b842d8a14 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -93,6 +93,8 @@ list(APPEND SIXTRACK_TESTS chebythin6d_ramp_DYNK crabs dipedge + dist_file_6d + dist_file_6d_direct distance dump_2_all_ele_highprec dump_all_highprec @@ -219,6 +221,14 @@ if(PYTHIA) ) endif() +if(DISTLIB) + list(APPEND SIXTRACK_TESTS + distlib_normalised + distlib_tmatrix + distlib_twiss + ) +endif() + if(SIXDA) list(APPEND SIXTRACK_DA_TESTS frs_da @@ -260,6 +270,11 @@ set(TESTS_NOFORT10 collimation_new-db_new-block collimation_old-db_new-block collimation_old-db_old-block + dist_file_6d + dist_file_6d_direct + distlib_normalised + distlib_tmatrix + distlib_twiss dump_2_all_ele_highprec dump_all_highprec dump_binary @@ -328,6 +343,11 @@ set(TESTS_NO_STF_FORT90 crabs orbit6d-element-rotations dipedge + dist_file_6d + dist_file_6d_direct + distlib_normalised + distlib_tmatrix + distlib_twiss dump_all_highprec dump4 dump5 @@ -601,6 +621,11 @@ set(FAST_TESTS collimation_old-db_old-block collimation_old-db_old-block crabs + dist_file_6d + dist_file_6d_direct + distlib_normalised + distlib_tmatrix + distlib_twiss dump_2_all_ele_highprec dump_all_highprec dump_binary diff --git a/test/dist_file_6d/extra_checks.txt b/test/dist_file_6d/extra_checks.txt new file mode 100644 index 000000000..3ac9a49e1 --- /dev/null +++ b/test/dist_file_6d/extra_checks.txt @@ -0,0 +1 @@ +initial_state.dat diff --git a/test/dist_file_6d/fort.2 b/test/dist_file_6d/fort.2 new file mode 100644 index 000000000..0fa0481ac --- /dev/null +++ b/test/dist_file_6d/fort.2 @@ -0,0 +1,54 @@ +SINGLE ELEMENTS--------------------------------------------------------- + redip_den 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_0 0 0.000000000e+00 0.000000000e+00 5.000000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redip 11 -2.000000000e-02 1.000000000e+00 -1.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + ip5 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_2 0 0.000000000e+00 0.000000000e+00 5.000000000e-02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redipv_den 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_3 0 0.000000000e+00 0.000000000e+00 4.500000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redipv 11 -1.200000000e-02 9.000000000e-01 -1.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_5 0 0.000000000e+00 0.000000000e+00 5.500000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qfstart 2 -1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_6 0 0.000000000e+00 0.000000000e+00 7.500000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qd 2 1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_7 0 0.000000000e+00 0.000000000e+00 1.000000000e+01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qf 2 -1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_11 0 0.000000000e+00 0.000000000e+00 2.000000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + hkick 1 1.200000000e-04 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + vkick -1 1.330000000e-03 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_13 0 0.000000000e+00 0.000000000e+00 9.600000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_14 0 0.000000000e+00 0.000000000e+00 2.000000000e-02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + rfcav.1 -12 1.500000000e-01 1.000000000e+02 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + rfcav.2 12 1.500000000e-01 1.000000000e+02 1.800000000e+02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_15 0 0.000000000e+00 0.000000000e+00 9.980000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 +NEXT +BLOCK DEFINITIONS------------------------------------------------------- + 1 1 + BLOC1 drift_0 + BLOC2 drift_2 + BLOC3 drift_3 + BLOC4 drift_5 + BLOC5 drift_6 + BLOC6 drift_7 + BLOC7 drift_11 + BLOC8 drift_13 + BLOC9 drift_14 + BLOC10 drift_15 +NEXT +STRUCTURE INPUT--------------------------------------------------------- + redip_den BLOC1 redip + BLOC1 redip_den ip5 + BLOC2 redipv_den BLOC3 + redipv BLOC3 redipv_den + BLOC4 qfstart BLOC5 + qd BLOC6 qf + BLOC6 qd BLOC6 + qf BLOC6 qd + BLOC7 hkick BLOC7 + vkick BLOC8 qf + BLOC9 rfcav.1 rfcav.2 + BLOC10 qd BLOC6 + qf BLOC6 qd + BLOC6 qf BLOC6 + qd BLOC6 +NEXT diff --git a/test/dist_file_6d/fort.3 b/test/dist_file_6d/fort.3 new file mode 100644 index 000000000..cdc8e8c74 --- /dev/null +++ b/test/dist_file_6d/fort.3 @@ -0,0 +1,50 @@ +GEOMETRY + +SETTINGS------------------------------------------------------------------------ + DEBUG + INITIALSTATE text +NEXT + +SIMULATION---------------------------------------------------------------------- + PARTICLES 6 + TURNS 1 + LATTICE Thin 6D + 6D_CLORB off + WRITE_TRACKS 100 off + REF_PARTICLE 938.272046 + REF_ENERGY 1500.0 +NEXT + +DIST---------------------------------------------------------------------------- +! FORMAT ID 6D + FORMAT ID X PX Y PY ZETA DELTA + READ partDist.dat +! PARTICLE 6 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 +! PARTICLE 5 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 +! PARTICLE 4 0.10000000000000e+00 0.11894833196372e+00 0.10000000000000e+00 0.11894833196372e+00 0.99372705908544e-01 1.63756644903508e-02 +! PARTICLE 3 0.10000000000000e+00 0.11894833196372e+00 0.10000000000000e+00 0.11894833196372e+00 0.99372705908544e-01 1.63756644903508e-02 +! PARTICLE 2 -0.10000000000000e+00 -0.11511538309653e+00 -0.10000000000000e+00 -0.11511538309653e+00 -1.00654674740072e-01 -1.63756644903508e-02 +! PARTICLE 1 -0.10000000000000e+00 -0.11511538309653e+00 -0.10000000000000e+00 -0.11511538309653e+00 -1.00654674740072e-01 -1.63756644903508e-02 +NEXT + +ITERATION ERRORS---------------------------------------------------------------- + 100 1e-12 1e-15 + 10 1e-10 1e-10 + 10 1e-09 1e-10 + 1e-09 1e-09 1e-09 1000.0 1000.0 +NEXT + +LINEAR OPTICS CALCULATION------------------------------------------------------- + ELEMENT 0 1 +NEXT + +SYNC---------------------------------------------------------------------------- + 100 0.008066 0.300 0.0 120.000000 938.272081 1 + 1.0 1.0 +NEXT + +BEAM---------------------------------------------------------------------------- + 0.0000e+00 1.24731e+06 1.24731e+06 1.0000e+00 1.0000e-03 1 0 +NEXT + +ENDE============================================================================ diff --git a/test/dist_file_6d/initial_state.dat.canonical b/test/dist_file_6d/initial_state.dat.canonical new file mode 100644 index 000000000..60eb0b346 --- /dev/null +++ b/test/dist_file_6d/initial_state.dat.canonical @@ -0,0 +1,33 @@ +# Tracking +# NPart Start = 6 +# NPart End = 6 +# NPart Allocated = 6 +# NTurns = 1 +# +# Reference Particle +# Mass [MeV] = 9.3827204600000005E+002 +# Energy [MeV] = 1.5000000000000000E+003 +# Momentum [MeV] = 1.1703185753011758E+003 +# Atomic Mass = 1 +# Atomic Number = 1 +# Charge = 1 +# +# Closed Orbit [x, xp, y, yp, sigma, dp] +# 4D Closed Orbit = -1.5498722213546328E+000 -4.3500010391828145E-002 -1.4989124120633555E+001 1.7237369151616875E+000 +# 6D Closed Orbit = -1.5489235141986075E+000 -4.3473605825315342E-002 -1.4989261289375476E+001 1.7237444642071484E+000 -4.2107237160409504E-002 1.5435395404724985E-006 +# +# Tune = 1.1939602242323781E+000 1.1927164443633989E+000 0.0000000000000000E+000 +# TAS(1,1:6) = 5.0575672102869138E+000 -1.8385037714357122E-015 2.8806340225118838E-003 -1.9090655284444659E-003 0.0000000000000000E+000 0.0000000000000000E+000 +# TAS(2,1:6) = 2.6897121784231165E-001 1.9771763239125204E-001 2.2671402818887694E-004 1.1266406561199552E-005 0.0000000000000000E+000 0.0000000000000000E+000 +# TAS(3,1:6) = -1.9065876524737939E-003 -1.2665562236528053E-003 3.3963723744718655E+000 4.1097020183597299E-016 0.0000000000000000E+000 0.0000000000000000E+000 +# TAS(4,1:6) = 1.9713759040716075E-004 -1.0780383367122033E-004 -1.5509220936749352E-001 2.9443110903604275E-001 0.0000000000000000E+000 0.0000000000000000E+000 +# TAS(5,1:6) = 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 +# TAS(6,1:6) = 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 +# +# partID parentID lost prim x y xp yp sigma dp p e + 6 6 F T 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 + 5 5 F T 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 + 4 4 F T 1.0000000000000001E-001 1.0000000000000001E-001 1.0000000000000563E-001 1.0000000000000563E-001 1.0000000000000059E-001 1.6375664490350800E-002 1.1894833196371330E+003 1.5150000000000000E+003 + 3 3 F T 1.0000000000000001E-001 1.0000000000000001E-001 1.0000000000000563E-001 1.0000000000000563E-001 1.0000000000000059E-001 1.6375664490350800E-002 1.1894833196371330E+003 1.5150000000000000E+003 + 2 2 F T -1.0000000000000001E-001 -1.0000000000000001E-001 -1.0000000000000708E-001 -1.0000000000000708E-001 -1.0000000000000010E-001 -1.6375664490350800E-002 1.1511538309652185E+003 1.4850958133571467E+003 + 1 1 F T -1.0000000000000001E-001 -1.0000000000000001E-001 -1.0000000000000708E-001 -1.0000000000000708E-001 -1.0000000000000010E-001 -1.6375664490350800E-002 1.1511538309652185E+003 1.4850958133571467E+003 diff --git a/test/dist_file_6d/partDist.dat b/test/dist_file_6d/partDist.dat new file mode 100644 index 000000000..659bb5ae4 --- /dev/null +++ b/test/dist_file_6d/partDist.dat @@ -0,0 +1,6 @@ +6 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 +5 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 +4 0.10000000000000e+00 0.11894833196372e+00 0.10000000000000e+00 0.11894833196372e+00 0.99372705908544e-01 1.63756644903508e-02 +3 0.10000000000000e+00 0.11894833196372e+00 0.10000000000000e+00 0.11894833196372e+00 0.99372705908544e-01 1.63756644903508e-02 +2 -0.10000000000000e+00 -0.11511538309653e+00 -0.10000000000000e+00 -0.11511538309653e+00 -1.00654674740072e-01 -1.63756644903508e-02 +1 -0.10000000000000e+00 -0.11511538309653e+00 -0.10000000000000e+00 -0.11511538309653e+00 -1.00654674740072e-01 -1.63756644903508e-02 diff --git a/test/dist_file_6d_direct/extra_checks.txt b/test/dist_file_6d_direct/extra_checks.txt new file mode 100644 index 000000000..3ac9a49e1 --- /dev/null +++ b/test/dist_file_6d_direct/extra_checks.txt @@ -0,0 +1 @@ +initial_state.dat diff --git a/test/dist_file_6d_direct/fort.2 b/test/dist_file_6d_direct/fort.2 new file mode 100644 index 000000000..0fa0481ac --- /dev/null +++ b/test/dist_file_6d_direct/fort.2 @@ -0,0 +1,54 @@ +SINGLE ELEMENTS--------------------------------------------------------- + redip_den 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_0 0 0.000000000e+00 0.000000000e+00 5.000000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redip 11 -2.000000000e-02 1.000000000e+00 -1.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + ip5 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_2 0 0.000000000e+00 0.000000000e+00 5.000000000e-02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redipv_den 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_3 0 0.000000000e+00 0.000000000e+00 4.500000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redipv 11 -1.200000000e-02 9.000000000e-01 -1.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_5 0 0.000000000e+00 0.000000000e+00 5.500000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qfstart 2 -1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_6 0 0.000000000e+00 0.000000000e+00 7.500000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qd 2 1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_7 0 0.000000000e+00 0.000000000e+00 1.000000000e+01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qf 2 -1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_11 0 0.000000000e+00 0.000000000e+00 2.000000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + hkick 1 1.200000000e-04 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + vkick -1 1.330000000e-03 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_13 0 0.000000000e+00 0.000000000e+00 9.600000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_14 0 0.000000000e+00 0.000000000e+00 2.000000000e-02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + rfcav.1 -12 1.500000000e-01 1.000000000e+02 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + rfcav.2 12 1.500000000e-01 1.000000000e+02 1.800000000e+02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_15 0 0.000000000e+00 0.000000000e+00 9.980000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 +NEXT +BLOCK DEFINITIONS------------------------------------------------------- + 1 1 + BLOC1 drift_0 + BLOC2 drift_2 + BLOC3 drift_3 + BLOC4 drift_5 + BLOC5 drift_6 + BLOC6 drift_7 + BLOC7 drift_11 + BLOC8 drift_13 + BLOC9 drift_14 + BLOC10 drift_15 +NEXT +STRUCTURE INPUT--------------------------------------------------------- + redip_den BLOC1 redip + BLOC1 redip_den ip5 + BLOC2 redipv_den BLOC3 + redipv BLOC3 redipv_den + BLOC4 qfstart BLOC5 + qd BLOC6 qf + BLOC6 qd BLOC6 + qf BLOC6 qd + BLOC7 hkick BLOC7 + vkick BLOC8 qf + BLOC9 rfcav.1 rfcav.2 + BLOC10 qd BLOC6 + qf BLOC6 qd + BLOC6 qf BLOC6 + qd BLOC6 +NEXT diff --git a/test/dist_file_6d_direct/fort.3 b/test/dist_file_6d_direct/fort.3 new file mode 100644 index 000000000..3a9c29790 --- /dev/null +++ b/test/dist_file_6d_direct/fort.3 @@ -0,0 +1,50 @@ +GEOMETRY + +SETTINGS------------------------------------------------------------------------ + DEBUG + INITIALSTATE text +NEXT + +SIMULATION---------------------------------------------------------------------- + PARTICLES 6 + TURNS 1 + LATTICE Thin 6D + 6D_CLORB off + WRITE_TRACKS 100 off + REF_PARTICLE 938.272046 + REF_ENERGY 1500.0 +NEXT + +DIST---------------------------------------------------------------------------- +! FORMAT ID 6D + FORMAT ID X PX Y PY ZETA DELTA +! READ partDist.dat + PARTICLE 6 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 + PARTICLE 5 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 + PARTICLE 4 0.10000000000000e+00 0.11894833196372e+00 0.10000000000000e+00 0.11894833196372e+00 0.99372705908544e-01 1.63756644903508e-02 + PARTICLE 3 0.10000000000000e+00 0.11894833196372e+00 0.10000000000000e+00 0.11894833196372e+00 0.99372705908544e-01 1.63756644903508e-02 + PARTICLE 2 -0.10000000000000e+00 -0.11511538309653e+00 -0.10000000000000e+00 -0.11511538309653e+00 -1.00654674740072e-01 -1.63756644903508e-02 + PARTICLE 1 -0.10000000000000e+00 -0.11511538309653e+00 -0.10000000000000e+00 -0.11511538309653e+00 -1.00654674740072e-01 -1.63756644903508e-02 +NEXT + +ITERATION ERRORS---------------------------------------------------------------- + 100 1e-12 1e-15 + 10 1e-10 1e-10 + 10 1e-09 1e-10 + 1e-09 1e-09 1e-09 1000.0 1000.0 +NEXT + +LINEAR OPTICS CALCULATION------------------------------------------------------- + ELEMENT 0 1 +NEXT + +SYNC---------------------------------------------------------------------------- + 100 0.008066 0.300 0.0 120.000000 938.272081 1 + 1.0 1.0 +NEXT + +BEAM---------------------------------------------------------------------------- + 0.0000e+00 1.24731e+06 1.24731e+06 1.0000e+00 1.0000e-03 1 0 +NEXT + +ENDE============================================================================ diff --git a/test/dist_file_6d_direct/initial_state.dat.canonical b/test/dist_file_6d_direct/initial_state.dat.canonical new file mode 100644 index 000000000..60eb0b346 --- /dev/null +++ b/test/dist_file_6d_direct/initial_state.dat.canonical @@ -0,0 +1,33 @@ +# Tracking +# NPart Start = 6 +# NPart End = 6 +# NPart Allocated = 6 +# NTurns = 1 +# +# Reference Particle +# Mass [MeV] = 9.3827204600000005E+002 +# Energy [MeV] = 1.5000000000000000E+003 +# Momentum [MeV] = 1.1703185753011758E+003 +# Atomic Mass = 1 +# Atomic Number = 1 +# Charge = 1 +# +# Closed Orbit [x, xp, y, yp, sigma, dp] +# 4D Closed Orbit = -1.5498722213546328E+000 -4.3500010391828145E-002 -1.4989124120633555E+001 1.7237369151616875E+000 +# 6D Closed Orbit = -1.5489235141986075E+000 -4.3473605825315342E-002 -1.4989261289375476E+001 1.7237444642071484E+000 -4.2107237160409504E-002 1.5435395404724985E-006 +# +# Tune = 1.1939602242323781E+000 1.1927164443633989E+000 0.0000000000000000E+000 +# TAS(1,1:6) = 5.0575672102869138E+000 -1.8385037714357122E-015 2.8806340225118838E-003 -1.9090655284444659E-003 0.0000000000000000E+000 0.0000000000000000E+000 +# TAS(2,1:6) = 2.6897121784231165E-001 1.9771763239125204E-001 2.2671402818887694E-004 1.1266406561199552E-005 0.0000000000000000E+000 0.0000000000000000E+000 +# TAS(3,1:6) = -1.9065876524737939E-003 -1.2665562236528053E-003 3.3963723744718655E+000 4.1097020183597299E-016 0.0000000000000000E+000 0.0000000000000000E+000 +# TAS(4,1:6) = 1.9713759040716075E-004 -1.0780383367122033E-004 -1.5509220936749352E-001 2.9443110903604275E-001 0.0000000000000000E+000 0.0000000000000000E+000 +# TAS(5,1:6) = 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 +# TAS(6,1:6) = 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 +# +# partID parentID lost prim x y xp yp sigma dp p e + 6 6 F T 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 + 5 5 F T 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 + 4 4 F T 1.0000000000000001E-001 1.0000000000000001E-001 1.0000000000000563E-001 1.0000000000000563E-001 1.0000000000000059E-001 1.6375664490350800E-002 1.1894833196371330E+003 1.5150000000000000E+003 + 3 3 F T 1.0000000000000001E-001 1.0000000000000001E-001 1.0000000000000563E-001 1.0000000000000563E-001 1.0000000000000059E-001 1.6375664490350800E-002 1.1894833196371330E+003 1.5150000000000000E+003 + 2 2 F T -1.0000000000000001E-001 -1.0000000000000001E-001 -1.0000000000000708E-001 -1.0000000000000708E-001 -1.0000000000000010E-001 -1.6375664490350800E-002 1.1511538309652185E+003 1.4850958133571467E+003 + 1 1 F T -1.0000000000000001E-001 -1.0000000000000001E-001 -1.0000000000000708E-001 -1.0000000000000708E-001 -1.0000000000000010E-001 -1.6375664490350800E-002 1.1511538309652185E+003 1.4850958133571467E+003 diff --git a/test/dist_file_6d_direct/partDist.dat b/test/dist_file_6d_direct/partDist.dat new file mode 100644 index 000000000..659bb5ae4 --- /dev/null +++ b/test/dist_file_6d_direct/partDist.dat @@ -0,0 +1,6 @@ +6 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 +5 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 +4 0.10000000000000e+00 0.11894833196372e+00 0.10000000000000e+00 0.11894833196372e+00 0.99372705908544e-01 1.63756644903508e-02 +3 0.10000000000000e+00 0.11894833196372e+00 0.10000000000000e+00 0.11894833196372e+00 0.99372705908544e-01 1.63756644903508e-02 +2 -0.10000000000000e+00 -0.11511538309653e+00 -0.10000000000000e+00 -0.11511538309653e+00 -1.00654674740072e-01 -1.63756644903508e-02 +1 -0.10000000000000e+00 -0.11511538309653e+00 -0.10000000000000e+00 -0.11511538309653e+00 -1.00654674740072e-01 -1.63756644903508e-02 diff --git a/test/distlib_normalised/extra_checks.txt b/test/distlib_normalised/extra_checks.txt new file mode 100644 index 000000000..3ac9a49e1 --- /dev/null +++ b/test/distlib_normalised/extra_checks.txt @@ -0,0 +1 @@ +initial_state.dat diff --git a/test/distlib_normalised/fort.2 b/test/distlib_normalised/fort.2 new file mode 100644 index 000000000..0fa0481ac --- /dev/null +++ b/test/distlib_normalised/fort.2 @@ -0,0 +1,54 @@ +SINGLE ELEMENTS--------------------------------------------------------- + redip_den 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_0 0 0.000000000e+00 0.000000000e+00 5.000000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redip 11 -2.000000000e-02 1.000000000e+00 -1.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + ip5 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_2 0 0.000000000e+00 0.000000000e+00 5.000000000e-02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redipv_den 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_3 0 0.000000000e+00 0.000000000e+00 4.500000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redipv 11 -1.200000000e-02 9.000000000e-01 -1.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_5 0 0.000000000e+00 0.000000000e+00 5.500000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qfstart 2 -1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_6 0 0.000000000e+00 0.000000000e+00 7.500000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qd 2 1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_7 0 0.000000000e+00 0.000000000e+00 1.000000000e+01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qf 2 -1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_11 0 0.000000000e+00 0.000000000e+00 2.000000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + hkick 1 1.200000000e-04 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + vkick -1 1.330000000e-03 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_13 0 0.000000000e+00 0.000000000e+00 9.600000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_14 0 0.000000000e+00 0.000000000e+00 2.000000000e-02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + rfcav.1 -12 1.500000000e-01 1.000000000e+02 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + rfcav.2 12 1.500000000e-01 1.000000000e+02 1.800000000e+02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_15 0 0.000000000e+00 0.000000000e+00 9.980000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 +NEXT +BLOCK DEFINITIONS------------------------------------------------------- + 1 1 + BLOC1 drift_0 + BLOC2 drift_2 + BLOC3 drift_3 + BLOC4 drift_5 + BLOC5 drift_6 + BLOC6 drift_7 + BLOC7 drift_11 + BLOC8 drift_13 + BLOC9 drift_14 + BLOC10 drift_15 +NEXT +STRUCTURE INPUT--------------------------------------------------------- + redip_den BLOC1 redip + BLOC1 redip_den ip5 + BLOC2 redipv_den BLOC3 + redipv BLOC3 redipv_den + BLOC4 qfstart BLOC5 + qd BLOC6 qf + BLOC6 qd BLOC6 + qf BLOC6 qd + BLOC7 hkick BLOC7 + vkick BLOC8 qf + BLOC9 rfcav.1 rfcav.2 + BLOC10 qd BLOC6 + qf BLOC6 qd + BLOC6 qf BLOC6 + qd BLOC6 +NEXT diff --git a/test/distlib_normalised/fort.3 b/test/distlib_normalised/fort.3 new file mode 100644 index 000000000..0488740af --- /dev/null +++ b/test/distlib_normalised/fort.3 @@ -0,0 +1,54 @@ +GEOMETRY + +SETTINGS------------------------------------------------------------------------ + DEBUG + INITIALSTATE text ions +NEXT + +SIMULATION---------------------------------------------------------------------- + PARTICLES 100 + TURNS 10 + LATTICE Thin 6D + 6D_CLORB on + WRITE_TRACKS 100000 off + REF_PARTICLE 938.272046 + REF_ENERGY 1500.0 +NEXT + +DIST---------------------------------------------------------------------------- + EMITTANCE 2.5 2.5 + SEED 12 + FILL ID COUNT 1 1 + FILL XN GAUSS 1.0 0.0 5.0 + FILL PXN GAUSS 1.0 0.0 5.0 + FILL YN GAUSS 1.0 0.0 5.0 + FILL PYN GAUSS 1.0 0.0 5.0 + FILL ZN GAUSS 0.8 0.0 5.0 + FILL PZN GAUSS 0.5 0.0 5.0 + FILL ION_A INT 1 + FILL ION_Z INT 1 + FILL CHARGE INT 1 + FILL MASS FLOAT 938.272046 +NEXT + +ITERATION ERRORS---------------------------------------------------------------- + 100 1e-12 1e-15 + 10 1e-10 1e-10 + 10 1e-09 1e-10 + 1e-09 1e-09 1e-09 1000.0 1000.0 +NEXT + +LINEAR OPTICS CALCULATION------------------------------------------------------- + ELEMENT 0 1 +NEXT + +SYNC---------------------------------------------------------------------------- + 100 0.008066 0.300 0.0 120.000000 938.272081 1 + 1.0 1.0 +NEXT + +BEAM---------------------------------------------------------------------------- + 0.0000e+00 1.24731e+06 1.24731e+06 1.0000e+00 1.0000e-03 1 0 +NEXT + +ENDE============================================================================ diff --git a/test/distlib_normalised/initial_state.dat.canonical b/test/distlib_normalised/initial_state.dat.canonical new file mode 100644 index 000000000..d4e4cd70c --- /dev/null +++ b/test/distlib_normalised/initial_state.dat.canonical @@ -0,0 +1,127 @@ +# Tracking +# NPart Start = 100 +# NPart End = 100 +# NPart Allocated = 100 +# NTurns = 10 +# +# Reference Particle +# Mass [MeV] = 9.3827204600000005E+002 +# Energy [MeV] = 1.5000000000000000E+003 +# Momentum [MeV] = 1.1703185753011758E+003 +# Atomic Mass = 1 +# Atomic Number = 1 +# Charge = 1 +# +# Closed Orbit [x, xp, y, yp, sigma, dp] +# 4D Closed Orbit = -1.5498722213546328E+000 -4.3500010391828145E-002 -1.4989124120633555E+001 1.7237369151616875E+000 +# 6D Closed Orbit = -1.5489235141985989E+000 -4.3473605825315120E-002 -1.4989261289375516E+001 1.7237444642071489E+000 -4.2107237039057596E-002 1.5435395404834125E-006 +# +# Tune = 1.1939580566902230E+000 1.1927142768866879E+000 4.5375143182007568E-002 +# TAS(1,1:6) = 5.0575676953128488E+000 -3.3870888240479871E-015 2.8806797574983120E-003 -1.9091230819892593E-003 6.6567796668340036E-004 5.1166711173457773E-002 +# TAS(2,1:6) = 2.6897044343621834E-001 1.9771761320049092E-001 2.2671821888737428E-004 1.1265393279688216E-005 -5.5348174208300581E-004 1.5045674851595922E-003 +# TAS(3,1:6) = -1.9066179617558249E-003 -1.2665946113833268E-003 3.3963739014102718E+000 1.1895196927328681E-015 1.4316453082114900E-003 -7.4438890648758100E-003 +# TAS(4,1:6) = 1.9714155052385097E-004 -1.0780501610546031E-004 -1.5509111235773113E-001 2.9443097664480766E-001 1.4108128451493176E-004 5.6558841502251528E-004 +# TAS(5,1:6) = 7.8669428379806436E-002 1.2937578591225055E-001 -9.7076149174573322E-003 -2.7980431022808196E-002 1.2786197210833075E+001 -4.7046131016399247E-016 +# TAS(6,1:6) = -2.3296675479710709E-004 -1.0281192838804185E-005 5.4702830656052533E-005 -3.2887901422474877E-005 1.4164465116485263E-006 7.8206897813173568E-002 +# +# partID parentID lost prim x y xp yp sigma dp p e mass A Z Q PDGid + 1 1 F T 9.3520158313430706E+000 -1.1981858175456182E+001 6.8031653152210159E-001 9.8024405507853551E-001 2.0170775529033316E-001 -6.8217718539169751E-007 1.1703177769365441E+003 1.4999993771061111E+003 9.3827204600000005E+002 1 1 1 2212 + 2 2 F T -4.4205655828209780E+000 1.2765505252389351E+001 2.5773405682946676E-001 -8.3561953789085819E-001 1.8793966396833023E-001 4.1237911937611701E-007 1.1703190579161192E+003 1.5000003765421857E+003 9.3827204600000005E+002 1 1 1 2212 + 3 3 F T -4.4709845408915800E+000 3.7823751397751706E+000 -3.8895729920748079E-001 -4.3130552552892593E-001 -1.2074716951195773E-001 3.0379701502242205E-007 1.1703189308404656E+003 1.5000002773961733E+003 9.3827204600000005E+002 1 1 1 2212 + 4 4 F T -2.2673869889272344E+000 -8.0003441799676249E+000 -1.9753620494689619E-001 1.4488854475402640E-001 -3.2417594227520642E-002 3.9312789449370684E-009 1.1703185799020243E+003 1.5000000035896389E+003 9.3827204600000005E+002 1 1 1 2212 + 5 5 F T 3.3389941940806844E+000 4.5456377512875603E+000 1.2167492739647548E-001 -9.0719398987258582E-001 5.3712736596594250E-002 8.6916421624345366E-010 1.1703185763183749E+003 1.5000000007936314E+003 9.3827204600000005E+002 1 1 1 2212 + 6 6 F T 6.6643495212261179E+000 3.6723674011170107E+000 6.8819835524592021E-001 -1.0053724128778327E+000 3.0520082182422786E-001 -1.7117844405872865E-007 1.1703183749678631E+003 1.4999998436974738E+003 9.3827204600000005E+002 1 1 1 2212 + 7 7 F T -7.7834682414667595E+000 6.3069280918661574E+000 -6.2948788422479474E-001 2.4577059662711379E-001 -2.5833227268297848E-001 4.1173367810882287E-007 1.1703190571607472E+003 1.5000003759528352E+003 9.3827204600000005E+002 1 1 1 2212 + 8 8 F T -1.0979569714397545E+001 -1.8650642091035998E+000 -8.8451637626233237E-001 6.1700817446694489E-001 -3.2199770943525574E-001 4.3161755840200896E-007 1.1703190804312217E+003 1.5000003941087505E+003 9.3827204600000005E+002 1 1 1 2212 + 9 9 F T -6.3041590466301116E+000 -1.1597935243474792E+001 -4.7767496219124378E-001 4.2527995405403801E-001 -1.1534658570865540E-001 1.2215543899625704E-007 1.1703187182619552E+003 1.5000001115397731E+003 9.3827204600000005E+002 1 1 1 2212 + 10 10 F T 9.4751548174285691E+000 -7.3911307606947063E-001 7.6573722931035415E-001 -2.1700828012534451E-001 2.6893651275244024E-001 -4.3384028189075137E-007 1.1703180675698352E+003 1.4999996038617542E+003 9.3827204600000005E+002 1 1 1 2212 + 11 11 F T -1.7390396620457214E+001 -1.4056367406593990E+000 -1.6680035309007284E+000 -6.7993134537890232E-001 -5.3198365586588037E-001 9.0017130106450437E-007 1.1703196287883704E+003 1.5000008219439001E+003 9.3827204600000005E+002 1 1 1 2212 + 12 12 F T -7.6245229835618424E+000 6.4331078289994883E+000 -6.1070584537205160E-002 1.5574059071304634E-002 4.5815021281538353E-002 4.0247035855467042E-007 1.1703190463197125E+003 1.5000003674945242E+003 9.3827204600000005E+002 1 1 1 2212 + 13 13 F T -2.6189173368310634E+001 6.2844256542225834E+000 -1.4363228850760914E+000 5.2331704064660911E-001 -4.1439935650788945E-001 1.2191284025673431E-006 1.1703200020697911E+003 1.5000011131828076E+003 9.3827204600000005E+002 1 1 1 2212 + 14 14 F T 1.3887748944674936E+000 -7.2272120154254509E+000 1.2091600134821803E-001 -9.7144098488520583E-002 8.8869774480948849E-002 -1.3526615985156363E-007 1.1703184169966762E+003 1.4999998764888724E+003 9.3827204600000005E+002 1 1 1 2212 + 15 15 F T -4.1881592482034691E+000 -8.2277901373489115E+000 -2.6518608073872207E-001 1.1100677679912609E+000 -1.0851187969186150E-001 -1.9991031899309733E-008 1.1703185519052997E+003 1.4999999817462478E+003 9.3827204600000005E+002 1 1 1 2212 + 16 16 F T 8.1674099303938821E+000 -4.9431285554082498E+000 1.0825381117732160E+000 3.8473759961361975E-001 4.2931142047078341E-001 -5.0746477630140707E-007 1.1703179814057216E+003 1.4999995366354581E+003 9.3827204600000005E+002 1 1 1 2212 + 17 17 F T 5.6646400872627574E+000 -3.1708889482572284E+000 2.1907108586360971E-001 1.8843073129049218E-001 3.0697663934185108E-002 -3.1269413341469853E-007 1.1703182093494231E+003 1.4999997144799281E+003 9.3827204600000005E+002 1 1 1 2212 + 18 18 F T -3.7452470245186258E+000 7.7016444075404671E+000 -3.8986112379261678E-001 -1.1972954113790799E+000 -9.7332045366559705E-002 4.0144321700731704E-007 1.1703190451176297E+003 1.5000003665566442E+003 9.3827204600000005E+002 1 1 1 2212 + 19 19 F T -5.0274376972545873E+000 -4.1768826288599882E-002 -5.4704299021865965E-001 2.7156281115712499E-001 -2.2370903485253330E-001 2.1520619697820314E-007 1.1703188271609858E+003 1.5000001965041511E+003 9.3827204600000005E+002 1 1 1 2212 + 20 20 F T 1.0991515767071142E+001 2.1162549276517897E+000 9.4330234915922773E-001 -2.5885211198128550E-002 3.0650997659612134E-001 -4.9861265416518607E-007 1.1703179917655248E+003 1.4999995447183032E+003 9.3827204600000005E+002 1 1 1 2212 + 21 21 F T -7.1241232835919976E-001 3.4333680686049588E+000 2.2542078068961394E-001 -4.4620083121283516E-001 1.3952309339486405E-001 1.0696598856231430E-007 1.1703187004854590E+003 1.5000000976703300E+003 9.3827204600000005E+002 1 1 1 2212 + 22 22 F T 9.7617939899084161E-001 4.0352325437655328E+000 -4.5267172483959084E-001 -7.0022087295920221E-001 -2.1648851693466939E-001 1.0420666320089559E-007 1.1703186972561696E+003 1.5000000951507984E+003 9.3827204600000005E+002 1 1 1 2212 + 23 23 F T 8.5315094042246873E+000 -1.0057086443502612E+001 1.3342353565962534E-001 5.3942059899597650E-001 -4.3263102979325653E-002 -5.4762611545194611E-007 1.1703179344041605E+003 1.4999994999642656E+003 9.3827204600000005E+002 1 1 1 2212 + 24 24 F T 2.8521291117996928E+000 -2.3011077838106804E+000 2.8985671928663459E-001 -8.9019709155107596E-001 1.8423959550744495E-001 -6.4242319220624124E-008 1.1703185001171962E+003 1.4999999413405287E+003 9.3827204600000005E+002 1 1 1 2212 + 25 25 F T 1.7158545774247127E+001 -4.4493540527320610E+000 6.1006182201759818E-001 -9.0013042465392365E-002 8.5648104146669096E-002 -8.1351354642867388E-007 1.1703176232311612E+003 1.4999992571833029E+003 9.3827204600000005E+002 1 1 1 2212 + 26 26 F T 1.3530475229619288E+001 -1.2170079584119122E+000 1.1439302161023182E+000 -9.1881511521591108E-001 4.5592987798019829E-001 -5.5574087478163403E-007 1.1703179249073071E+003 1.4999994925547046E+003 9.3827204600000005E+002 1 1 1 2212 + 27 27 F T 1.3102733851169429E+001 2.7072702268598041E+000 9.5535881741140871E-001 -1.2157881409171493E-001 2.8474653009866341E-001 -5.7339684666971494E-007 1.1703179042441950E+003 1.4999994764330922E+003 9.3827204600000005E+002 1 1 1 2212 + 28 28 F T 2.2035810027823618E-002 -6.1699167307788727E+000 -2.9533251370747533E-002 5.6276658900281717E-001 -2.2384848934817271E-002 -1.3050942489156385E-007 1.1703184225635716E+003 1.4999998808322330E+003 9.3827204600000005E+002 1 1 1 2212 + 29 29 F T -1.2172843697297844E+000 3.2513687268345948E-001 5.9385915726693453E-002 -2.0656822428952384E-001 6.2090710123766858E-002 7.6326734326683608E-008 1.1703186646277707E+003 1.5000000696937166E+003 9.3827204600000005E+002 1 1 1 2212 + 30 30 F T 1.0721216482559040E+001 1.2764145242451557E+000 7.7243275390668698E-001 -4.1048858231542841E-002 2.2921125292429673E-001 -4.8559606793908243E-007 1.1703180069990774E+003 1.4999995566037073E+003 9.3827204600000005E+002 1 1 1 2212 + 31 31 F T -7.5761097679210243E+000 2.7198688099383403E+000 -6.3303639209283991E-001 -3.1879418599128900E-001 -2.0109040850023538E-001 4.2658460599266054E-007 1.1703190745410643E+003 1.5000003895131761E+003 9.3827204600000005E+002 1 1 1 2212 + 32 32 F T 8.1691050053297065E+000 8.2572452328084669E+000 8.5621205742578199E-002 3.2514017622423963E-001 -1.4964913977689512E-001 -3.0339441221498351E-007 1.1703182202330595E+003 1.4999997229714752E+003 9.3827204600000005E+002 1 1 1 2212 + 33 33 F T -6.3038964923307041E+000 3.0749394963596548E+000 3.5210860246418313E-001 -1.2852633387057308E+000 3.5245226744455743E-001 4.3243497525373455E-007 1.1703190813878598E+003 1.5000003948551314E+003 9.3827204600000005E+002 1 1 1 2212 + 34 34 F T 2.0001521068106300E+001 -4.5904231525408870E+000 1.4734808777333825E+000 1.0352778108405152E+000 4.0093846770535274E-001 -1.1090383669925478E-006 1.1703172773729741E+003 1.4999989873405639E+003 9.3827204600000005E+002 1 1 1 2212 + 35 35 F T 4.7749700625695990E+000 5.1233021216857191E+000 4.5381419277434713E-002 -5.4431770336081564E-001 -3.6992842140787151E-002 -9.1588095925458378E-008 1.1703184681139260E+003 1.4999999163711818E+003 9.3827204600000005E+002 1 1 1 2212 + 36 36 F T -1.7261251647906651E+001 4.0286565890753732E+000 -5.5331326580344564E-001 -5.0045661595598867E-001 -8.9161989025960744E-003 8.7648775266582045E-007 1.1703196010710737E+003 1.5000008003185142E+003 9.3827204600000005E+002 1 1 1 2212 + 37 37 F T -1.3468463695739853E+001 -4.1189622879632015E+000 1.8142350788319835E-002 -1.5104408994181326E-001 2.4587981313678933E-001 5.5356970020486325E-007 1.1703192231540788E+003 1.5000005054629123E+003 9.3827204600000005E+002 1 1 1 2212 + 38 38 F T -4.2150112448583261E+000 -4.1958706300455004E+000 -2.5217117568560155E-001 -7.5145318837830966E-001 1.4025299784036452E-002 2.3342968038157045E-007 1.1703188484882669E+003 1.5000002131439612E+003 9.3827204600000005E+002 1 1 1 2212 + 39 39 F T 1.3106642351933320E+000 -4.2065649947569215E+000 2.5129115147246245E-001 1.2143318218345082E-001 1.2331662272281707E-001 -1.2981190552736575E-007 1.1703184233798913E+003 1.4999998814691355E+003 9.3827204600000005E+002 1 1 1 2212 + 40 40 F T 7.4748339726638768E+000 -7.6801805754425132E+000 5.3262972687388402E-002 -4.5698108251696495E-001 -7.7372442011114607E-003 -3.5991540156759286E-007 1.1703181540854957E+003 1.4999996713623334E+003 9.3827204600000005E+002 1 1 1 2212 + 41 41 F T -7.0989575847550075E+000 1.5868991688623770E+000 -1.2763383469195586E-001 -1.1490083607580259E-001 4.0982802681929734E-002 3.4432129228354103E-007 1.1703189782667801E+003 1.5000003143987758E+003 9.3827204600000005E+002 1 1 1 2212 + 42 42 F T -2.0539762440715243E+000 -1.9918285241671032E+000 -4.2763433036825854E-001 4.1188161490623626E-001 -2.0680531956952858E-001 4.3050449140012434E-008 1.1703186256839163E+003 1.5000000393092384E+003 9.3827204600000005E+002 1 1 1 2212 + 43 43 F T -6.9946428721643912E+000 2.2987911382263242E+000 -1.0774496043393644E-001 -9.6401660007766388E-001 1.0860975895697969E-001 4.4170870685048891E-007 1.1703190922410804E+003 1.5000004033229500E+003 9.3827204600000005E+002 1 1 1 2212 + 44 44 F T 1.9537160813309125E+001 1.1883328368510386E+000 1.1056174779687504E+000 -4.0796129992549646E-001 2.9470366559987199E-001 -8.4444219520448739E-007 1.1703175870347891E+003 1.4999992289424542E+003 9.3827204600000005E+002 1 1 1 2212 + 45 45 F T 3.7781159910113113E+000 -4.0357216317295457E+000 8.7083625943244619E-002 -8.4895116167479232E-002 1.6818563082010959E-002 -2.0310045317427511E-007 1.1703183376089428E+003 1.4999998145495838E+003 9.3827204600000005E+002 1 1 1 2212 + 46 46 F T 2.6047084481393354E+000 -8.9936767193869347E+000 -6.3728137503878735E-002 8.6040407909822214E-001 -8.4775757988223802E-002 -3.0501818168357817E-007 1.1703182183327319E+003 1.4999997214888162E+003 9.3827204600000005E+002 1 1 1 2212 + 47 47 F T -1.1570368851937353E+001 8.3284827126176864E-001 -8.7523873929228757E-001 1.7120584287254352E-003 -2.7792370831766916E-001 5.5537693823913921E-007 1.1703192252691229E+003 1.5000005071130963E+003 9.3827204600000005E+002 1 1 1 2212 + 48 48 F T -2.8075848629231763E+000 1.3311888845883575E+000 -2.4487007567482594E-002 -6.4069754174586740E-002 2.6889057474787568E-002 1.4467376220159768E-007 1.1703187446155671E+003 1.5000001321011885E+003 9.3827204600000005E+002 1 1 1 2212 + 49 49 F T 5.3953111103130942E+000 -2.9095532159643018E+000 -6.2869083125327713E-002 -3.3520711865539693E-001 -7.1764823592310248E-002 -2.2485746085664787E-007 1.1703183121463126E+003 1.4999997946833259E+003 9.3827204600000005E+002 1 1 1 2212 + 50 50 F T -9.2831464965350143E+000 1.1328461639255019E+001 -7.9588635108091360E-002 -1.9592828013514346E-001 4.9343102546033885E-002 5.5292874546237127E-007 1.1703192224039574E+003 1.5000005048776582E+003 9.3827204600000005E+002 1 1 1 2212 + 51 51 F T -7.7932473444974981E+000 -5.1877787668797097E+000 -6.5482601585535771E-001 6.2919134644358887E-002 -1.9268202341945614E-001 3.0712785246920576E-007 1.1703189347386065E+003 1.5000002804375515E+003 9.3827204600000005E+002 1 1 1 2212 + 52 52 F T -7.1048921882426674E-001 1.0079595904002632E+001 1.9596703608501576E-002 -4.3743344523332045E-001 -3.7213244530964955E-003 1.8993004051559739E-007 1.1703187975798303E+003 1.5000001734245652E+003 9.3827204600000005E+002 1 1 1 2212 + 53 53 F T 1.3740219020116099E+001 -5.4349237951033258E+000 6.5739622718703561E-001 -4.0931199782445826E-001 1.9039189868514875E-001 -6.4311579768056382E-007 1.1703178226508116E+003 1.4999994127729392E+003 9.3827204600000005E+002 1 1 1 2212 + 54 54 F T 1.3102025582035118E+001 -4.9575214450846161E+000 8.6249206067708728E-001 5.4208704506629346E-001 2.3131608170073537E-001 -7.2742056860961245E-007 1.1703177239873723E+003 1.4999993357945227E+003 9.3827204600000005E+002 1 1 1 2212 + 55 55 F T -1.4560124499119198E+001 3.8948427694387204E+000 -5.9954941774561077E-001 -4.4547801629726158E-002 -1.0616309986320600E-001 7.0943247828952741E-007 1.1703194055631830E+003 1.5000006477807894E+003 9.3827204600000005E+002 1 1 1 2212 + 56 56 F T 1.3698598190779900E+000 -2.2830104815926386E-001 1.6812456914556553E-001 -1.0165093332158430E+000 1.4203444027619166E-001 4.3267008891398431E-008 1.1703186259373599E+003 1.5000000395069783E+003 9.3827204600000005E+002 1 1 1 2212 + 57 57 F T 1.0448060885388509E+001 -6.2411665187046008E+000 6.5455583044716437E-001 1.6750805834840296E-001 2.0007049195928978E-001 -5.7393879668852200E-007 1.1703179036099409E+003 1.4999994759382396E+003 9.3827204600000005E+002 1 1 1 2212 + 58 58 F T 9.4533717390975163E+000 -1.0237788471459011E+001 1.1402167587664045E+000 7.7683119222753938E-001 4.4020847953901604E-001 -6.6845461073773745E-007 1.1703177929963281E+003 1.4999993896361500E+003 9.3827204600000005E+002 1 1 1 2212 + 59 59 F T 2.0022551899472727E+001 1.5180482589120776E+000 1.0970585868123628E+000 -7.2438526377478246E-002 2.5627199670479106E-001 -8.9894314593738818E-007 1.1703175232513140E+003 1.4999991791778141E+003 9.3827204600000005E+002 1 1 1 2212 + 60 60 F T 1.1190828137088657E+001 -1.4608609340153920E+000 3.9604554903357592E-001 8.4216635254409655E-001 -2.0109780973941723E-002 -6.1545876128610379E-007 1.1703178550183552E+003 1.4999994380264914E+003 9.3827204600000005E+002 1 1 1 2212 + 61 61 F T -1.2495864727321798E+001 -2.4501613851568225E+000 -8.2815542149977528E-001 2.8224809288521502E-001 -2.4230721990380530E-001 5.2535767974028868E-007 1.1703191901370271E+003 1.5000004797025942E+003 9.3827204600000005E+002 1 1 1 2212 + 62 62 F T -1.4507199416587181E+001 1.4826795291381514E+000 -1.2087562723743142E+000 2.2431018279626921E-001 -4.2428429574732068E-001 6.8209398376544831E-007 1.1703193735684351E+003 1.5000006228180844E+003 9.3827204600000005E+002 1 1 1 2212 + 63 63 F T -1.3328623359571708E+001 9.2687356421263312E-001 -4.3791256615902968E-001 -5.9547447542795373E-001 1.5519792682592397E-002 6.7666406062686789E-007 1.1703193672136952E+003 1.5000006178600361E+003 9.3827204600000005E+002 1 1 1 2212 + 64 64 F T -5.2307971227007863E+000 -3.0615680650899111E+000 1.7229344819865766E-001 1.0041877541880248E-001 1.7627911564225232E-001 1.7245821214286444E-007 1.1703187771322250E+003 1.5000001574710893E+003 9.3827204600000005E+002 1 1 1 2212 + 65 65 F T 2.8097350938896288E+000 2.8020951039841062E+000 -3.2671908436509056E-001 -4.2019559904282194E-001 -1.9355461543665628E-001 -2.6677561081779150E-008 1.1703185440799305E+003 1.4999999756407979E+003 9.3827204600000005E+002 1 1 1 2212 + 66 66 F T -4.4177040389983206E+000 2.5771873201601442E-001 -1.7550234677556567E-001 2.4133332425229492E-001 -4.2652176342641804E-002 1.7618410152061404E-007 1.1703187814927026E+003 1.5000001608731882E+003 9.3827204600000005E+002 1 1 1 2212 + 67 67 F T -9.5173242790020733E+000 1.6857148947917502E+000 -6.8500513794189777E-001 -2.1070292682914180E-001 -2.0067239357365962E-001 4.8980699133635711E-007 1.1703191485313962E+003 1.5000004472413596E+003 9.3827204600000005E+002 1 1 1 2212 + 68 68 F T -1.8128478093493630E+000 9.5332496603374750E+000 -2.2213371734407558E-002 -3.6828302479069613E-001 -1.0569553951388921E-002 2.2605312386237456E-007 1.1703188398553455E+003 1.5000002064084485E+003 9.3827204600000005E+002 1 1 1 2212 + 69 69 F T 2.6177160893619460E+000 7.2388928195992053E+000 -1.4997697733903956E-001 -9.0349784996286941E-001 -8.9597348192149026E-002 7.5517098010168669E-008 1.1703186636802382E+003 1.5000000689544399E+003 9.3827204600000005E+002 1 1 1 2212 + 70 70 F T 6.9072016320666298E+000 -5.5155638520989276E+000 -1.0702406995614608E-001 3.4126109628754830E-001 -1.5252892437912008E-001 -3.9251317425645049E-007 1.1703181159357168E+003 1.4999996415974078E+003 9.3827204600000005E+002 1 1 1 2212 + 71 71 F T -7.8410844283155912E-001 1.3640536883330903E+000 -7.2403427160128195E-002 -8.1109763973462201E-001 2.7348192646642601E-002 1.4358322830564049E-007 1.1703187433392948E+003 1.5000001311054250E+003 9.3827204600000005E+002 1 1 1 2212 + 72 72 F T 3.2765764798252670E+000 3.7388834128802401E-001 2.5646322634029817E-001 3.5091464800532374E-001 5.3561652295803050E-002 -1.9034482510163811E-007 1.1703183525370912E+003 1.4999998261967091E+003 9.3827204600000005E+002 1 1 1 2212 + 73 73 F T -4.7966101412660986E+000 5.2187062170767753E+000 7.3873512339696329E-002 -8.4290414597175822E-001 1.4285543180245863E-001 3.5576812991148464E-007 1.1703189916632266E+003 1.5000003248508506E+003 9.3827204600000005E+002 1 1 1 2212 + 74 74 F T 6.2420221186190723E+000 2.1268216880872535E+000 -3.3195373482889984E-001 -1.7104004485609117E-001 -2.6243773952294563E-001 -2.1033807588641084E-007 1.1703183291386185E+003 1.4999998079409324E+003 9.3827204600000005E+002 1 1 1 2212 + 75 75 F T 5.0784602961769929E+000 -9.9783727342543944E+000 1.3654379892967008E-001 7.5547537130325004E-001 -6.3290645931719687E-003 -4.2163237204821134E-007 1.1703180818569788E+003 1.4999996150087586E+003 9.3827204600000005E+002 1 1 1 2212 + 76 76 F T -6.3069758262776991E+000 -2.4752709147060261E+000 1.5425248989786153E-001 -2.7524758883514983E-001 2.0781311853910753E-001 2.6851872382895959E-007 1.1703188895536261E+003 1.5000002451836663E+003 9.3827204600000005E+002 1 1 1 2212 + 77 77 F T -8.5201201597282115E+000 -3.7121996589839630E+000 -5.0098642299082274E-001 8.8106765671444293E-002 -1.1344026495208280E-001 3.4405547563477329E-007 1.1703189779556899E+003 1.5000003141560594E+003 9.3827204600000005E+002 1 1 1 2212 + 78 78 F T -5.0879280546234773E-001 2.6258632504485790E+000 -4.2968784693195922E-001 -2.8815314993302182E-001 -2.0511571327297054E-001 1.0560311231103132E-007 1.1703186988904597E+003 1.5000000964258918E+003 9.3827204600000005E+002 1 1 1 2212 + 79 79 F T 3.0833173416317988E-001 9.9815876453434649E-001 -1.5241720115357384E-002 -9.0341260601014062E-001 4.9049104523153836E-002 9.9620488170766724E-008 1.1703186918888834E+003 1.5000000909631751E+003 9.3827204600000005E+002 1 1 1 2212 + 80 80 F T -3.6023700706757924E+000 1.7405337290149809E+000 -8.1576663124484305E-002 -8.0177617111490337E-002 8.5636840204228997E-003 1.8836781822448309E-007 1.1703187957515324E+003 1.5000001719981046E+003 9.3827204600000005E+002 1 1 1 2212 + 81 81 F T -5.7889337908134875E-001 -8.3035479448264589E+000 6.2078399533823818E-002 6.3861645697272051E-001 3.9804604680418881E-002 -1.4129239075124470E-007 1.1703184099440664E+003 1.4999998709863391E+003 9.3827204600000005E+002 1 1 1 2212 + 82 82 F T 1.4097210825410755E+000 2.0560130167276269E+000 -2.8557914173465010E-001 -3.2046484086966537E-001 -1.5473697302379574E-001 1.2390305845995737E-008 1.1703185898017809E+003 1.5000000113135518E+003 9.3827204600000005E+002 1 1 1 2212 + 83 83 F T -1.9112348959154826E+000 2.7591085544590404E+000 -8.8530403417980477E-002 3.0299341982231898E-001 -5.4572115195575387E-002 8.3851883946563661E-008 1.1703186734345929E+003 1.5000000765649086E+003 9.3827204600000005E+002 1 1 1 2212 + 84 84 F T -9.7631757342736059E+000 -4.3311131328432344E+000 -1.4877211161700668E-001 5.7949372439930524E-001 5.2007380366154508E-002 3.1770193066207992E-007 1.1703189471136468E+003 1.5000002900927122E+003 9.3827204600000005E+002 1 1 1 2212 + 85 85 F T -4.7794191152957266E+000 9.7325245437991210E+000 -7.0528803976668275E-001 -4.6473483264118576E-001 -3.0868038933373043E-001 4.0298678395365429E-007 1.1703190469240947E+003 1.5000003679660706E+003 9.3827204600000005E+002 1 1 1 2212 + 86 86 F T 4.8794109567290898E+000 -8.5020165676418920E+000 2.3178027682044403E-001 -5.3202192883711652E-001 1.3255438964081429E-001 -2.5750612747624625E-007 1.1703182739369715E+003 1.4999997648719277E+003 9.3827204600000005E+002 1 1 1 2212 + 87 87 F T -8.6521130306441343E+000 -1.1845102704958930E+000 -4.4318458893551071E-001 1.9012589862218590E-001 -1.0379250994954443E-001 3.6322850554593061E-007 1.1703190003942427E+003 1.5000003316628986E+003 9.3827204600000005E+002 1 1 1 2212 + 88 88 F T 1.1108590294402358E+001 3.4623442692075383E+000 5.9310204020979296E-001 -4.4510772245800456E-001 1.4952931445218950E-001 -4.2367852281468299E-007 1.1703180794623306E+003 1.4999996131404248E+003 9.3827204600000005E+002 1 1 1 2212 + 89 89 F T -4.4790919863220511E+000 4.1731348260277930E+000 1.0392439205199504E-003 -5.7386891886417601E-001 8.6831495962421498E-002 3.0414748227448590E-007 1.1703189312506240E+003 1.5000002777161840E+003 9.3827204600000005E+002 1 1 1 2212 + 90 90 F T -9.2186510623170126E-002 -2.9775942898621048E+000 -2.4932779694000326E-001 4.7180835224702733E-002 -1.1258906626156411E-001 -2.1182050918928333E-008 1.1703185505114282E+003 1.4999999806587321E+003 9.3827204600000005E+002 1 1 1 2212 + 91 91 F T -1.4246364726350080E+001 -8.0302841526339428E+000 -5.7607821828216232E-001 2.9034833856812597E-001 -5.6474736856575239E-002 5.2555768133986891E-007 1.1703191903710926E+003 1.5000004798852151E+003 9.3827204600000005E+002 1 1 1 2212 + 92 92 F T 5.0543421538243845E+000 -2.0312780032699611E+000 7.0686342636027333E-001 -2.4901651618477466E-001 3.1490851353227584E-001 -2.5007668080507596E-007 1.1703182826317909E+003 1.4999997716557327E+003 9.3827204600000005E+002 1 1 1 2212 + 93 93 F T 1.7780914343548326E+000 3.9666987095148865E+000 7.6691814726937813E-001 -4.5958218233406628E-001 3.7653379759630601E-001 -2.1616470412801908E-008 1.1703185500030190E+003 1.4999999802620648E+003 9.3827204600000005E+002 1 1 1 2212 + 94 94 F T 1.6975119985949135E+001 2.3657572682551868E+000 9.7816933646853077E-001 5.9966294105277740E-001 1.8663176405463255E-001 -8.2674817798935864E-007 1.1703176077424259E+003 1.4999992450988036E+003 9.3827204600000005E+002 1 1 1 2212 + 95 95 F T 2.4539688144814327E+000 -1.0268280880215945E+001 -3.8053589229405621E-001 4.6791398949971885E-001 -2.0788935730506580E-001 -2.5213430986406756E-007 1.1703182802237095E+003 1.4999997697769181E+003 9.3827204600000005E+002 1 1 1 2212 + 96 96 F T 1.5255763025748492E+000 -9.0308535295696348E+000 2.9244523634930913E-001 5.2620431115944055E-001 1.3825965120635428E-001 -2.3980735212426990E-007 1.1703182946501772E+003 1.4999997810326258E+003 9.3827204600000005E+002 1 1 1 2212 + 97 97 F T 5.2299295802578181E+000 -1.2633110610751896E+000 2.3053376651467009E-001 2.0375817227870027E-001 3.1172129680877046E-002 -2.7514154444747756E-007 1.1703182532979156E+003 1.4999997487690823E+003 9.3827204600000005E+002 1 1 1 2212 + 98 98 F T -3.4228787427290541E+000 -1.2311437188422569E+000 5.6912270131324227E-001 -6.1465469414448715E-001 3.9447966338756690E-001 1.7383126756207011E-007 1.1703187787391373E+003 1.5000001587248223E+003 9.3827204600000005E+002 1 1 1 2212 + 99 99 F T -1.7570678231155156E+001 -4.2512058821219950E-001 -1.0817821459912138E+000 6.9943945689105780E-001 -3.3800682187643777E-001 7.3385607627307409E-007 1.1703194341465735E+003 1.5000006700819110E+003 9.3827204600000005E+002 1 1 1 2212 + 100 100 F T -7.9624052851531451E+000 2.1551441665247317E+000 1.4603227704834507E-002 8.7885321077623368E-001 4.9543738550037769E-002 2.6929499673112317E-007 1.1703188904621127E+003 1.5000002458924787E+003 9.3827204600000005E+002 1 1 1 2212 diff --git a/test/distlib_tmatrix/extra_checks.txt b/test/distlib_tmatrix/extra_checks.txt new file mode 100644 index 000000000..3ac9a49e1 --- /dev/null +++ b/test/distlib_tmatrix/extra_checks.txt @@ -0,0 +1 @@ +initial_state.dat diff --git a/test/distlib_tmatrix/fort.2 b/test/distlib_tmatrix/fort.2 new file mode 100644 index 000000000..0fa0481ac --- /dev/null +++ b/test/distlib_tmatrix/fort.2 @@ -0,0 +1,54 @@ +SINGLE ELEMENTS--------------------------------------------------------- + redip_den 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_0 0 0.000000000e+00 0.000000000e+00 5.000000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redip 11 -2.000000000e-02 1.000000000e+00 -1.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + ip5 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_2 0 0.000000000e+00 0.000000000e+00 5.000000000e-02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redipv_den 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_3 0 0.000000000e+00 0.000000000e+00 4.500000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redipv 11 -1.200000000e-02 9.000000000e-01 -1.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_5 0 0.000000000e+00 0.000000000e+00 5.500000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qfstart 2 -1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_6 0 0.000000000e+00 0.000000000e+00 7.500000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qd 2 1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_7 0 0.000000000e+00 0.000000000e+00 1.000000000e+01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qf 2 -1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_11 0 0.000000000e+00 0.000000000e+00 2.000000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + hkick 1 1.200000000e-04 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + vkick -1 1.330000000e-03 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_13 0 0.000000000e+00 0.000000000e+00 9.600000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_14 0 0.000000000e+00 0.000000000e+00 2.000000000e-02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + rfcav.1 -12 1.500000000e-01 1.000000000e+02 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + rfcav.2 12 1.500000000e-01 1.000000000e+02 1.800000000e+02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_15 0 0.000000000e+00 0.000000000e+00 9.980000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 +NEXT +BLOCK DEFINITIONS------------------------------------------------------- + 1 1 + BLOC1 drift_0 + BLOC2 drift_2 + BLOC3 drift_3 + BLOC4 drift_5 + BLOC5 drift_6 + BLOC6 drift_7 + BLOC7 drift_11 + BLOC8 drift_13 + BLOC9 drift_14 + BLOC10 drift_15 +NEXT +STRUCTURE INPUT--------------------------------------------------------- + redip_den BLOC1 redip + BLOC1 redip_den ip5 + BLOC2 redipv_den BLOC3 + redipv BLOC3 redipv_den + BLOC4 qfstart BLOC5 + qd BLOC6 qf + BLOC6 qd BLOC6 + qf BLOC6 qd + BLOC7 hkick BLOC7 + vkick BLOC8 qf + BLOC9 rfcav.1 rfcav.2 + BLOC10 qd BLOC6 + qf BLOC6 qd + BLOC6 qf BLOC6 + qd BLOC6 +NEXT diff --git a/test/distlib_tmatrix/fort.3 b/test/distlib_tmatrix/fort.3 new file mode 100644 index 000000000..ed2d7f83c --- /dev/null +++ b/test/distlib_tmatrix/fort.3 @@ -0,0 +1,61 @@ +GEOMETRY + +SETTINGS------------------------------------------------------------------------ + DEBUG + INITIALSTATE text ions +NEXT + +SIMULATION---------------------------------------------------------------------- + PARTICLES 100 + TURNS 10 + LATTICE Thin 6D + 6D_CLORB on + WRITE_TRACKS 100000 off + REF_PARTICLE 938.272046 + REF_ENERGY 1500.0 +NEXT + +DIST---------------------------------------------------------------------------- + EMITTANCE 2.5 2.5 + LONGEMIT 1.0 um + SEED 12 + FILL ID COUNT 1 1 + FILL XN GAUSS 1.0 0.0 5.0 + FILL PXN GAUSS 1.0 0.0 5.0 + FILL YN GAUSS 1.0 0.0 5.0 + FILL PYN GAUSS 1.0 0.0 5.0 + FILL ZN FLOAT 0.0 + FILL PZN FLOAT 0.0 + FILL ION_A INT 1 + FILL ION_Z INT 1 + FILL CHARGE INT 1 + FILL MASS FLOAT 938.272046 + TMATRIX 1.0 0.0 0.0 0.0 0.0 0.0 + TMATRIX 0.5 -1.0 0.0 0.0 0.0 0.0 + TMATRIX 0.0 0.0 1.0 0.0 0.0 0.0 + TMATRIX 0.0 0.0 0.5 -1.0 0.0 0.0 + TMATRIX 0.0 0.0 0.0 0.0 1.0 0.0 + TMATRIX 0.0 0.0 0.0 0.0 0.0 1.0 +NEXT + +ITERATION ERRORS---------------------------------------------------------------- + 100 1e-12 1e-15 + 10 1e-10 1e-10 + 10 1e-09 1e-10 + 1e-09 1e-09 1e-09 1000.0 1000.0 +NEXT + +LINEAR OPTICS CALCULATION------------------------------------------------------- + ELEMENT 0 1 +NEXT + +SYNC---------------------------------------------------------------------------- + 100 0.008066 0.300 0.0 120.000000 938.272081 1 + 1.0 1.0 +NEXT + +BEAM---------------------------------------------------------------------------- + 0.0000e+00 1.24731e+06 1.24731e+06 1.0000e+00 1.0000e-03 1 0 +NEXT + +ENDE============================================================================ diff --git a/test/distlib_tmatrix/initial_state.dat.canonical b/test/distlib_tmatrix/initial_state.dat.canonical new file mode 100644 index 000000000..0b1cd41f1 --- /dev/null +++ b/test/distlib_tmatrix/initial_state.dat.canonical @@ -0,0 +1,127 @@ +# Tracking +# NPart Start = 100 +# NPart End = 100 +# NPart Allocated = 100 +# NTurns = 10 +# +# Reference Particle +# Mass [MeV] = 9.3827204600000005E+002 +# Energy [MeV] = 1.5000000000000000E+003 +# Momentum [MeV] = 1.1703185753011758E+003 +# Atomic Mass = 1 +# Atomic Number = 1 +# Charge = 1 +# +# Closed Orbit [x, xp, y, yp, sigma, dp] +# 4D Closed Orbit = -1.5498722213546328E+000 -4.3500010391828145E-002 -1.4989124120633555E+001 1.7237369151616875E+000 +# 6D Closed Orbit = -1.5489235141985989E+000 -4.3473605825315120E-002 -1.4989261289375516E+001 1.7237444642071489E+000 -4.2107237039057596E-002 1.5435395404834125E-006 +# +# Tune = 1.1939580566902230E+000 1.1927142768866879E+000 4.5375143182007568E-002 +# TAS(1,1:6) = 5.0575676953128488E+000 -3.3870888240479871E-015 2.8806797574983120E-003 -1.9091230819892593E-003 6.6567796668340036E-004 5.1166711173457773E-002 +# TAS(2,1:6) = 2.6897044343621834E-001 1.9771761320049092E-001 2.2671821888737428E-004 1.1265393279688216E-005 -5.5348174208300581E-004 1.5045674851595922E-003 +# TAS(3,1:6) = -1.9066179617558249E-003 -1.2665946113833268E-003 3.3963739014102718E+000 1.1895196927328681E-015 1.4316453082114900E-003 -7.4438890648758100E-003 +# TAS(4,1:6) = 1.9714155052385097E-004 -1.0780501610546031E-004 -1.5509111235773113E-001 2.9443097664480766E-001 1.4108128451493176E-004 5.6558841502251528E-004 +# TAS(5,1:6) = 7.8669428379806436E-002 1.2937578591225055E-001 -9.7076149174573322E-003 -2.7980431022808196E-002 1.2786197210833075E+001 -4.7046131016399247E-016 +# TAS(6,1:6) = -2.3296675479710709E-004 -1.0281192838804185E-005 5.4702830656052533E-005 -3.2887901422474877E-005 1.4164465116485263E-006 7.8206897813173568E-002 +# +# partID parentID lost prim x y xp yp sigma dp p e mass A Z Q PDGid + 1 1 F T 1.8516771234109954E+000 -3.5264536334731083E+000 1.0106976095782504E-005 -3.2340521391000303E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 2 2 F T -8.7651408160518784E-001 3.7590060420735671E+000 -2.9299316588618716E+000 2.7360366798409204E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 3 3 F T -8.8498415335523806E-001 1.1128690616248955E+000 3.2205918074700396E-001 1.4347983298320544E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 4 4 F T -4.4725643280093641E-001 -2.3559503378569446E+000 1.6427284974227366E-001 -4.2923581887643109E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 5 5 F T 6.5853805272772314E-001 1.3386442302741632E+000 6.1113094775085597E-001 3.0459143720127004E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 6 6 F T 1.3160081067641709E+000 1.0826299975435614E+000 -1.0313626235328963E+000 3.3859316807865656E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 7 7 F T -1.5393472539799771E+000 1.8556879533782134E+000 3.2223906133441876E-001 -8.8499911617885507E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 8 8 F T -2.1699233528142425E+000 -5.5091936726813151E-001 4.3623287938418109E-001 -2.0817558111701380E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 9 9 F T -1.2446685909614397E+000 -3.4157660799291683E+000 9.6456246467957446E-002 -1.3536164155611423E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 10 10 F T 1.8732623984406669E+000 -2.1607263289196427E-001 -3.8820403627625011E-001 7.4359148369560424E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 11 11 F T -3.4392068260624962E+000 -4.1719572330345139E-001 2.0374568151551342E+000 2.3195407672593507E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 12 12 F T -1.5082289550105275E+000 1.8939130664699206E+000 -2.4947644811431058E+000 -1.0520223909827144E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 13 13 F T -5.1782277763095053E+000 1.8473440108766082E+000 -2.3666538652028009E+000 -1.8301862569554053E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 14 14 F T 2.7525767402945983E-001 -2.1276761344160589E+000 -1.0199843844490393E-001 3.8694737779446703E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 15 15 F T -8.2577583112146713E-001 -2.4230657251977075E+000 -1.9765402787409816E-001 -3.7058742765596229E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 16 16 F T 1.6159209942779111E+000 -1.4532837573503279E+000 -2.4705838534753721E+000 -1.2679602210804573E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 17 17 F T 1.1206196712347134E+000 -9.3313592523298361E-001 9.7571367607893633E-001 -6.1411996587981454E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 18 18 F T -7.4289872140483781E-001 2.2668315351768888E+000 5.9217271295836171E-001 4.0056947119829287E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 19 19 F T -9.9368941361984331E-001 -1.3383593547248126E-002 9.1819009740721014E-001 -9.2212041736870964E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 20 20 F T 2.1730158033625231E+000 6.2498883675721240E-001 -7.2759678552564566E-001 7.1989175691234183E-002 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 21 21 F T -1.4180743247119013E-001 1.0113093557840083E+000 -1.4028265071419921E+000 1.4878347637484277E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 22 22 F T 1.9167531738025134E-001 1.1872562910462672E+000 2.6473360976798554E+000 2.3475227407149530E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 23 23 F T 1.6886685272718986E+000 -2.9607804503070190E+000 2.4633617354222865E+000 -1.7511569936642344E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 24 24 F T 5.6304259631481490E-001 -6.7694147336574995E-001 -4.1951102400764861E-001 3.0416765429914214E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 25 25 F T 3.3930164895511927E+000 -1.3086960520001452E+000 3.2252131089864657E+000 3.4355581419298653E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 26 26 F T 2.6742465932321684E+000 -3.5602328174209075E-001 -8.1116424176447421E-001 3.1311723024543929E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 27 27 F T 2.5902658466023629E+000 7.9904767424094947E-001 -1.2146067938286712E-002 3.9281010585468507E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 28 28 F T 5.7519925064895569E-003 -1.8166734513554115E+000 1.5804296130359236E-001 -1.8627157474207352E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 29 29 F T -2.4098594280210386E-001 9.5829547187496603E-002 -7.4860909320076163E-001 6.9862995566590891E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 30 30 F T 2.1196435413697157E+000 3.7738817316651962E-001 3.7026206600053589E-002 1.3036766270517292E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 31 31 F T -1.4986798791938096E+000 7.9954014978091470E-001 4.1449109437515830E-001 1.0607832866994082E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 32 32 F T 1.6147388157353220E+000 2.4314420868222286E+000 2.5738986070557459E+000 -1.1676095783567706E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 33 33 F T -1.2484113615819656E+000 9.0595588508667346E-001 -4.1025649472985988E+000 4.3389042918806107E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 34 34 F T 3.9565973518225852E+000 -1.3485723257097033E+000 -9.3067911552743937E-002 -3.4782315356138360E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 35 35 F T 9.4286627315276350E-001 1.5085982746238924E+000 1.5262298335510098E+000 1.8093751453778584E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 36 36 F T -3.4140349410736759E+000 1.1849353955906310E+000 -3.5515884845117847E+000 1.6650865080680370E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 37 37 F T -2.6627746209188570E+000 -1.2128620560799586E+000 -5.0469791505658268E+000 5.4230270870119390E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 38 38 F T -8.3391179879401633E-001 -1.2359172569018209E+000 -2.7757872004163608E-001 2.5847742619013276E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 39 39 F T 2.5976386921200473E-001 -1.2380573591998876E+000 -7.8913434115006098E-001 -3.7947962442824196E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 40 40 F T 1.4782021508610950E+000 -2.2611069196007718E+000 2.4778747445043008E+000 1.6141895633679952E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 41 41 F T -1.4039506452753987E+000 4.6691653752220141E-001 -1.9658136638017143E+000 3.7635507199737106E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 42 42 F T -4.0537370890888424E-001 -5.8728564120402871E-001 1.4080949049896625E+000 -1.3828798247191250E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 43 43 F T -1.3844915114694316E+000 6.7655860507248156E-001 -2.0301222829396233E+000 3.2546559638423567E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 44 44 F T 3.8623013422690784E+000 3.5217679924581463E-001 1.5937738396486589E+000 1.3786334479713025E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 45 45 F T 7.4735367415291976E-001 -1.1880390379900201E+000 9.4850061155619536E-001 3.2082545169857085E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 46 46 F T 5.1709666284426847E-001 -2.6481143029026559E+000 1.2813639320895274E+000 -2.8507056821316130E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 47 47 F T -2.2878215199984853E+000 2.4344230060659919E-001 1.7079037954037143E-001 -1.3377032412047213E-002 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 48 48 F T -5.5535270882154064E-001 3.9186778071528289E-001 -9.0886811786571320E-001 2.0652049621922891E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 49 49 F T 1.0666671649876871E+000 -8.5672510600695984E-001 2.3013037890162775E+000 1.1627688516161307E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 50 50 F T -1.8369831809213366E+000 3.3352068926972107E+000 -3.0110569699476963E+000 5.7423923281537470E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 51 51 F T -1.5402604982543344E+000 -1.5287639911927287E+000 4.4467508597679062E-001 -1.7339164292792894E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 52 52 F T -1.4214143780955649E-001 2.9677801459737316E+000 -3.6014373505634267E-001 1.4061062014568779E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 53 53 F T 2.7168314842543930E+000 -1.5988261026581778E+000 1.7274466547447473E+000 1.4348995355074718E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 54 54 F T 2.5918133383385364E+000 -1.4578837831314215E+000 4.5789986426852275E-001 -1.8007082660137061E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 55 55 F T -2.8793597559283364E+000 1.1454780457766831E+000 -2.3230003141964604E+000 1.1841013259120917E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 56 56 F T 2.6957505119283032E-001 -6.6887274536589825E-002 -3.4909101499464679E-001 3.4542463830522641E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 57 57 F T 2.0667222719397231E+000 -1.8362499175889992E+000 5.3219657454306268E-001 -5.1860351510440938E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 58 58 F T 1.8712663924715547E+000 -3.0120760092429397E+000 -2.2890248359891707E+000 -2.5577723963401628E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 59 59 F T 3.9586686928351722E+000 4.4924445605341606E-001 1.8165212847282006E+000 2.3660298123776341E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 60 60 F T 2.2139278903030672E+000 -4.2925691635377067E-001 2.1153121242843129E+000 -2.8469830706032098E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 61 61 F T -2.4700956905499032E+000 -7.2310031827187427E-001 -4.0752568233993125E-001 -9.4063174170788111E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 62 62 F T -2.8682872283679868E+000 4.3411265636170071E-001 7.7801237094438525E-001 -7.7456599012148419E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 63 63 F T -2.6362454932506862E+000 2.7193238615295034E-001 -2.6893650201084540E+000 2.0129189787094148E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 64 64 F T -1.0337881147623871E+000 -9.0115307815113055E-001 -2.7956881120812507E+000 -3.1848251493522928E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 65 65 F T 5.5470582109671784E-001 8.2443891632174671E-001 2.6853035970136991E+000 1.4063451010988548E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 66 66 F T -8.7320224215737507E-001 7.5502282756236050E-002 -7.3670796654609938E-001 -8.2237437986539297E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 67 67 F T -1.8822519691616346E+000 4.9493387051018395E-001 -3.6591381527323615E-002 7.0146002501410420E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 68 68 F T -3.5995524601415968E-001 2.8068279481749014E+000 -5.5407184851888325E-001 1.1753732537412618E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 69 69 F T 5.1563523325194349E-001 2.1311033375256949E+000 1.7201499204255108E+000 3.0125004492397180E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 70 70 F T 1.3667550569719067E+000 -1.6240839146310742E+000 3.0821316112196095E+000 -1.1138170644544461E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 71 71 F T -1.5622537025680500E-001 4.0147546401402362E-001 7.5873602605659146E-002 2.7440104895546145E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 72 72 F T 6.4826496074581519E-001 1.1060325748830477E-001 -9.0903422477610824E-002 -1.1945162763922061E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 73 73 F T -9.5005243977033593E-001 1.5366396991258797E+000 -2.1394419158168589E+000 2.8204767432876681E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 74 74 F T 1.2337424653465154E+000 6.2564394226060405E-001 3.9748569088231043E+000 5.6623764222410855E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 75 75 F T 1.0061882801780322E+000 -2.9376356704808897E+000 1.1779789524638407E+000 -2.4863831568724737E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 76 76 F T -1.2471194657343765E+000 -7.2857424294601991E-001 -3.1011883837680587E+000 9.5259229479825980E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 77 77 F T -1.6841090504226206E+000 -1.0940245900615366E+000 -6.0049843909579559E-001 -2.7101984121831529E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 78 78 F T -1.0125631319321758E-001 7.7232102350206422E-001 1.9857184274199176E+000 9.5869748527660781E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 79 79 F T 5.9697215557456967E-002 2.9386395492603623E-001 1.8831860283538737E-001 3.0605719442730766E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 80 80 F T -7.1256568614429860E-001 5.1227563331345805E-001 -9.1246145702558368E-001 2.5793042444341968E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 81 81 F T -1.1273562974899895E-001 -2.4447153684708338E+000 -5.2645883435389362E-001 -2.1038398124109525E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 82 82 F T 2.7809957618608816E-001 6.0483146507077001E-001 1.9623985027357131E+000 1.0730963648469707E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 83 83 F T -3.7780860704569169E-001 8.1218112665766795E-001 -2.5409012905244244E-001 -1.0510829773795654E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 84 84 F T -1.9291926921148701E+000 -1.2756011828439082E+000 -2.8379662793128388E+000 -1.9360396191347700E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 85 85 F T -9.4666125491603259E-001 2.8641806697898140E+000 1.8092834172417278E+000 1.5020065681078201E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 86 86 F T 9.6501976061740058E-001 -2.5027723686462542E+000 6.1997328532782447E-001 1.8745913119800575E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 87 87 F T -1.7103522541397782E+000 -3.4968554107600858E-001 -9.4077053313059089E-001 -6.3756329911350273E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 88 88 F T 2.1954797734776057E+000 1.0206606938753475E+000 1.0857925003618514E+000 1.4859194887266132E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 89 89 F T -8.8681261474517159E-001 1.2286565378228429E+000 -1.6537270185286099E+000 1.9151767134445417E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 90 90 F T -1.7841914180296493E-002 -8.7716887754748074E-001 1.2268140139783128E+000 -1.3634054861305128E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 91 91 F T -2.8155910219775162E+000 -2.3656076156172827E+000 -2.3271444321157970E+000 -9.2507941411599570E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 92 92 F T 9.9926425019423293E-001 -5.9668500967677041E-001 -1.7168575455912272E+000 8.6157296153089558E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 93 93 F T 3.5054809503207834E-001 1.1693866704231259E+000 -3.2254172503259921E+000 1.5286265860169892E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 94 94 F T 3.3568891980047106E+000 6.9857989874872062E-001 1.2987156313131829E+000 -2.0532600175390634E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 95 95 F T 4.8692784576286990E-001 -3.0239971045436227E+000 2.8270442915691816E+000 -1.5070543720159417E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 96 96 F T 3.0330256735348732E-001 -2.6584000625164772E+000 -9.1787451115838770E-001 -1.7162702715911757E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 97 97 F T 1.0344786499016927E+000 -3.7146788765322453E-001 7.5814776908723880E-001 -6.8132323308591047E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 98 98 F T -6.7743689806263230E-001 -3.6145064656062575E-001 -4.1392948374161200E+000 2.0954255060444344E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 99 99 F T -3.4731913142939081E+000 -1.2739708591855864E-001 -9.9010537180413283E-001 -2.3742096756147206E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 100 100 F T -1.5734624457360278E+000 6.3448482809661366E-001 -3.0001752083277289E+000 -3.0037574058210272E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 diff --git a/test/distlib_twiss/extra_checks.txt b/test/distlib_twiss/extra_checks.txt new file mode 100644 index 000000000..3ac9a49e1 --- /dev/null +++ b/test/distlib_twiss/extra_checks.txt @@ -0,0 +1 @@ +initial_state.dat diff --git a/test/distlib_twiss/fort.2 b/test/distlib_twiss/fort.2 new file mode 100644 index 000000000..0fa0481ac --- /dev/null +++ b/test/distlib_twiss/fort.2 @@ -0,0 +1,54 @@ +SINGLE ELEMENTS--------------------------------------------------------- + redip_den 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_0 0 0.000000000e+00 0.000000000e+00 5.000000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redip 11 -2.000000000e-02 1.000000000e+00 -1.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + ip5 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_2 0 0.000000000e+00 0.000000000e+00 5.000000000e-02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redipv_den 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_3 0 0.000000000e+00 0.000000000e+00 4.500000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + redipv 11 -1.200000000e-02 9.000000000e-01 -1.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_5 0 0.000000000e+00 0.000000000e+00 5.500000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qfstart 2 -1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_6 0 0.000000000e+00 0.000000000e+00 7.500000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qd 2 1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_7 0 0.000000000e+00 0.000000000e+00 1.000000000e+01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + qf 2 -1.175570505e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_11 0 0.000000000e+00 0.000000000e+00 2.000000000e-01 0.000000000e+00 0.000000000e+00 0.000000000e+00 + hkick 1 1.200000000e-04 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + vkick -1 1.330000000e-03 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_13 0 0.000000000e+00 0.000000000e+00 9.600000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_14 0 0.000000000e+00 0.000000000e+00 2.000000000e-02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + rfcav.1 -12 1.500000000e-01 1.000000000e+02 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 + rfcav.2 12 1.500000000e-01 1.000000000e+02 1.800000000e+02 0.000000000e+00 0.000000000e+00 0.000000000e+00 + drift_15 0 0.000000000e+00 0.000000000e+00 9.980000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 +NEXT +BLOCK DEFINITIONS------------------------------------------------------- + 1 1 + BLOC1 drift_0 + BLOC2 drift_2 + BLOC3 drift_3 + BLOC4 drift_5 + BLOC5 drift_6 + BLOC6 drift_7 + BLOC7 drift_11 + BLOC8 drift_13 + BLOC9 drift_14 + BLOC10 drift_15 +NEXT +STRUCTURE INPUT--------------------------------------------------------- + redip_den BLOC1 redip + BLOC1 redip_den ip5 + BLOC2 redipv_den BLOC3 + redipv BLOC3 redipv_den + BLOC4 qfstart BLOC5 + qd BLOC6 qf + BLOC6 qd BLOC6 + qf BLOC6 qd + BLOC7 hkick BLOC7 + vkick BLOC8 qf + BLOC9 rfcav.1 rfcav.2 + BLOC10 qd BLOC6 + qf BLOC6 qd + BLOC6 qf BLOC6 + qd BLOC6 +NEXT diff --git a/test/distlib_twiss/fort.3 b/test/distlib_twiss/fort.3 new file mode 100644 index 000000000..1a427f527 --- /dev/null +++ b/test/distlib_twiss/fort.3 @@ -0,0 +1,62 @@ +GEOMETRY + +SETTINGS------------------------------------------------------------------------ + DEBUG + INITIALSTATE text ions +NEXT + +SIMULATION---------------------------------------------------------------------- + PARTICLES 100 + TURNS 10 + LATTICE Thin 6D + 6D_CLORB on + WRITE_TRACKS 100000 off + REF_PARTICLE 938.272046 + REF_ENERGY 1500.0 +NEXT + +DIST---------------------------------------------------------------------------- + EMITTANCE 2.5 2.5 + LONGEMIT 1.0 um + TWISS 1.0 -0.5 1.0 -0.5 + SEED 12 + FILL ID COUNT 1 1 + FILL XN GAUSS 1.0 0.0 5.0 + FILL PXN GAUSS 1.0 0.0 5.0 + FILL YN GAUSS 1.0 0.0 5.0 + FILL PYN GAUSS 1.0 0.0 5.0 + FILL ZN FLOAT 0.0 + FILL PZN FLOAT 0.0 + FILL ION_A INT 1 + FILL ION_Z INT 1 + FILL CHARGE INT 1 + FILL MASS FLOAT 938.272046 + ! TMATRIX 1.0 0.0 0.0 0.0 0.0 0.0 + ! TMATRIX 0.5 -1.0 0.0 0.0 0.0 0.0 + ! TMATRIX 0.0 0.0 1.0 0.0 0.0 0.0 + ! TMATRIX 0.0 0.0 0.5 -1.0 0.0 0.0 + ! TMATRIX 0.0 0.0 0.0 0.0 1.0 0.0 + ! TMATRIX 0.0 0.0 0.0 0.0 0.0 1.0 +NEXT + +ITERATION ERRORS---------------------------------------------------------------- + 100 1e-12 1e-15 + 10 1e-10 1e-10 + 10 1e-09 1e-10 + 1e-09 1e-09 1e-09 1000.0 1000.0 +NEXT + +LINEAR OPTICS CALCULATION------------------------------------------------------- + ELEMENT 0 1 +NEXT + +SYNC---------------------------------------------------------------------------- + 100 0.008066 0.300 0.0 120.000000 938.272081 1 + 1.0 1.0 +NEXT + +BEAM---------------------------------------------------------------------------- + 0.0000e+00 1.24731e+06 1.24731e+06 1.0000e+00 1.0000e-03 1 0 +NEXT + +ENDE============================================================================ diff --git a/test/distlib_twiss/initial_state.dat.canonical b/test/distlib_twiss/initial_state.dat.canonical new file mode 100644 index 000000000..0b1cd41f1 --- /dev/null +++ b/test/distlib_twiss/initial_state.dat.canonical @@ -0,0 +1,127 @@ +# Tracking +# NPart Start = 100 +# NPart End = 100 +# NPart Allocated = 100 +# NTurns = 10 +# +# Reference Particle +# Mass [MeV] = 9.3827204600000005E+002 +# Energy [MeV] = 1.5000000000000000E+003 +# Momentum [MeV] = 1.1703185753011758E+003 +# Atomic Mass = 1 +# Atomic Number = 1 +# Charge = 1 +# +# Closed Orbit [x, xp, y, yp, sigma, dp] +# 4D Closed Orbit = -1.5498722213546328E+000 -4.3500010391828145E-002 -1.4989124120633555E+001 1.7237369151616875E+000 +# 6D Closed Orbit = -1.5489235141985989E+000 -4.3473605825315120E-002 -1.4989261289375516E+001 1.7237444642071489E+000 -4.2107237039057596E-002 1.5435395404834125E-006 +# +# Tune = 1.1939580566902230E+000 1.1927142768866879E+000 4.5375143182007568E-002 +# TAS(1,1:6) = 5.0575676953128488E+000 -3.3870888240479871E-015 2.8806797574983120E-003 -1.9091230819892593E-003 6.6567796668340036E-004 5.1166711173457773E-002 +# TAS(2,1:6) = 2.6897044343621834E-001 1.9771761320049092E-001 2.2671821888737428E-004 1.1265393279688216E-005 -5.5348174208300581E-004 1.5045674851595922E-003 +# TAS(3,1:6) = -1.9066179617558249E-003 -1.2665946113833268E-003 3.3963739014102718E+000 1.1895196927328681E-015 1.4316453082114900E-003 -7.4438890648758100E-003 +# TAS(4,1:6) = 1.9714155052385097E-004 -1.0780501610546031E-004 -1.5509111235773113E-001 2.9443097664480766E-001 1.4108128451493176E-004 5.6558841502251528E-004 +# TAS(5,1:6) = 7.8669428379806436E-002 1.2937578591225055E-001 -9.7076149174573322E-003 -2.7980431022808196E-002 1.2786197210833075E+001 -4.7046131016399247E-016 +# TAS(6,1:6) = -2.3296675479710709E-004 -1.0281192838804185E-005 5.4702830656052533E-005 -3.2887901422474877E-005 1.4164465116485263E-006 7.8206897813173568E-002 +# +# partID parentID lost prim x y xp yp sigma dp p e mass A Z Q PDGid + 1 1 F T 1.8516771234109954E+000 -3.5264536334731083E+000 1.0106976095782504E-005 -3.2340521391000303E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 2 2 F T -8.7651408160518784E-001 3.7590060420735671E+000 -2.9299316588618716E+000 2.7360366798409204E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 3 3 F T -8.8498415335523806E-001 1.1128690616248955E+000 3.2205918074700396E-001 1.4347983298320544E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 4 4 F T -4.4725643280093641E-001 -2.3559503378569446E+000 1.6427284974227366E-001 -4.2923581887643109E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 5 5 F T 6.5853805272772314E-001 1.3386442302741632E+000 6.1113094775085597E-001 3.0459143720127004E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 6 6 F T 1.3160081067641709E+000 1.0826299975435614E+000 -1.0313626235328963E+000 3.3859316807865656E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 7 7 F T -1.5393472539799771E+000 1.8556879533782134E+000 3.2223906133441876E-001 -8.8499911617885507E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 8 8 F T -2.1699233528142425E+000 -5.5091936726813151E-001 4.3623287938418109E-001 -2.0817558111701380E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 9 9 F T -1.2446685909614397E+000 -3.4157660799291683E+000 9.6456246467957446E-002 -1.3536164155611423E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 10 10 F T 1.8732623984406669E+000 -2.1607263289196427E-001 -3.8820403627625011E-001 7.4359148369560424E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 11 11 F T -3.4392068260624962E+000 -4.1719572330345139E-001 2.0374568151551342E+000 2.3195407672593507E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 12 12 F T -1.5082289550105275E+000 1.8939130664699206E+000 -2.4947644811431058E+000 -1.0520223909827144E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 13 13 F T -5.1782277763095053E+000 1.8473440108766082E+000 -2.3666538652028009E+000 -1.8301862569554053E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 14 14 F T 2.7525767402945983E-001 -2.1276761344160589E+000 -1.0199843844490393E-001 3.8694737779446703E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 15 15 F T -8.2577583112146713E-001 -2.4230657251977075E+000 -1.9765402787409816E-001 -3.7058742765596229E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 16 16 F T 1.6159209942779111E+000 -1.4532837573503279E+000 -2.4705838534753721E+000 -1.2679602210804573E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 17 17 F T 1.1206196712347134E+000 -9.3313592523298361E-001 9.7571367607893633E-001 -6.1411996587981454E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 18 18 F T -7.4289872140483781E-001 2.2668315351768888E+000 5.9217271295836171E-001 4.0056947119829287E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 19 19 F T -9.9368941361984331E-001 -1.3383593547248126E-002 9.1819009740721014E-001 -9.2212041736870964E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 20 20 F T 2.1730158033625231E+000 6.2498883675721240E-001 -7.2759678552564566E-001 7.1989175691234183E-002 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 21 21 F T -1.4180743247119013E-001 1.0113093557840083E+000 -1.4028265071419921E+000 1.4878347637484277E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 22 22 F T 1.9167531738025134E-001 1.1872562910462672E+000 2.6473360976798554E+000 2.3475227407149530E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 23 23 F T 1.6886685272718986E+000 -2.9607804503070190E+000 2.4633617354222865E+000 -1.7511569936642344E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 24 24 F T 5.6304259631481490E-001 -6.7694147336574995E-001 -4.1951102400764861E-001 3.0416765429914214E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 25 25 F T 3.3930164895511927E+000 -1.3086960520001452E+000 3.2252131089864657E+000 3.4355581419298653E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 26 26 F T 2.6742465932321684E+000 -3.5602328174209075E-001 -8.1116424176447421E-001 3.1311723024543929E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 27 27 F T 2.5902658466023629E+000 7.9904767424094947E-001 -1.2146067938286712E-002 3.9281010585468507E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 28 28 F T 5.7519925064895569E-003 -1.8166734513554115E+000 1.5804296130359236E-001 -1.8627157474207352E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 29 29 F T -2.4098594280210386E-001 9.5829547187496603E-002 -7.4860909320076163E-001 6.9862995566590891E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 30 30 F T 2.1196435413697157E+000 3.7738817316651962E-001 3.7026206600053589E-002 1.3036766270517292E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 31 31 F T -1.4986798791938096E+000 7.9954014978091470E-001 4.1449109437515830E-001 1.0607832866994082E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 32 32 F T 1.6147388157353220E+000 2.4314420868222286E+000 2.5738986070557459E+000 -1.1676095783567706E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 33 33 F T -1.2484113615819656E+000 9.0595588508667346E-001 -4.1025649472985988E+000 4.3389042918806107E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 34 34 F T 3.9565973518225852E+000 -1.3485723257097033E+000 -9.3067911552743937E-002 -3.4782315356138360E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 35 35 F T 9.4286627315276350E-001 1.5085982746238924E+000 1.5262298335510098E+000 1.8093751453778584E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 36 36 F T -3.4140349410736759E+000 1.1849353955906310E+000 -3.5515884845117847E+000 1.6650865080680370E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 37 37 F T -2.6627746209188570E+000 -1.2128620560799586E+000 -5.0469791505658268E+000 5.4230270870119390E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 38 38 F T -8.3391179879401633E-001 -1.2359172569018209E+000 -2.7757872004163608E-001 2.5847742619013276E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 39 39 F T 2.5976386921200473E-001 -1.2380573591998876E+000 -7.8913434115006098E-001 -3.7947962442824196E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 40 40 F T 1.4782021508610950E+000 -2.2611069196007718E+000 2.4778747445043008E+000 1.6141895633679952E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 41 41 F T -1.4039506452753987E+000 4.6691653752220141E-001 -1.9658136638017143E+000 3.7635507199737106E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 42 42 F T -4.0537370890888424E-001 -5.8728564120402871E-001 1.4080949049896625E+000 -1.3828798247191250E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 43 43 F T -1.3844915114694316E+000 6.7655860507248156E-001 -2.0301222829396233E+000 3.2546559638423567E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 44 44 F T 3.8623013422690784E+000 3.5217679924581463E-001 1.5937738396486589E+000 1.3786334479713025E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 45 45 F T 7.4735367415291976E-001 -1.1880390379900201E+000 9.4850061155619536E-001 3.2082545169857085E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 46 46 F T 5.1709666284426847E-001 -2.6481143029026559E+000 1.2813639320895274E+000 -2.8507056821316130E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 47 47 F T -2.2878215199984853E+000 2.4344230060659919E-001 1.7079037954037143E-001 -1.3377032412047213E-002 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 48 48 F T -5.5535270882154064E-001 3.9186778071528289E-001 -9.0886811786571320E-001 2.0652049621922891E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 49 49 F T 1.0666671649876871E+000 -8.5672510600695984E-001 2.3013037890162775E+000 1.1627688516161307E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 50 50 F T -1.8369831809213366E+000 3.3352068926972107E+000 -3.0110569699476963E+000 5.7423923281537470E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 51 51 F T -1.5402604982543344E+000 -1.5287639911927287E+000 4.4467508597679062E-001 -1.7339164292792894E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 52 52 F T -1.4214143780955649E-001 2.9677801459737316E+000 -3.6014373505634267E-001 1.4061062014568779E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 53 53 F T 2.7168314842543930E+000 -1.5988261026581778E+000 1.7274466547447473E+000 1.4348995355074718E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 54 54 F T 2.5918133383385364E+000 -1.4578837831314215E+000 4.5789986426852275E-001 -1.8007082660137061E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 55 55 F T -2.8793597559283364E+000 1.1454780457766831E+000 -2.3230003141964604E+000 1.1841013259120917E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 56 56 F T 2.6957505119283032E-001 -6.6887274536589825E-002 -3.4909101499464679E-001 3.4542463830522641E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 57 57 F T 2.0667222719397231E+000 -1.8362499175889992E+000 5.3219657454306268E-001 -5.1860351510440938E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 58 58 F T 1.8712663924715547E+000 -3.0120760092429397E+000 -2.2890248359891707E+000 -2.5577723963401628E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 59 59 F T 3.9586686928351722E+000 4.4924445605341606E-001 1.8165212847282006E+000 2.3660298123776341E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 60 60 F T 2.2139278903030672E+000 -4.2925691635377067E-001 2.1153121242843129E+000 -2.8469830706032098E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 61 61 F T -2.4700956905499032E+000 -7.2310031827187427E-001 -4.0752568233993125E-001 -9.4063174170788111E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 62 62 F T -2.8682872283679868E+000 4.3411265636170071E-001 7.7801237094438525E-001 -7.7456599012148419E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 63 63 F T -2.6362454932506862E+000 2.7193238615295034E-001 -2.6893650201084540E+000 2.0129189787094148E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 64 64 F T -1.0337881147623871E+000 -9.0115307815113055E-001 -2.7956881120812507E+000 -3.1848251493522928E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 65 65 F T 5.5470582109671784E-001 8.2443891632174671E-001 2.6853035970136991E+000 1.4063451010988548E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 66 66 F T -8.7320224215737507E-001 7.5502282756236050E-002 -7.3670796654609938E-001 -8.2237437986539297E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 67 67 F T -1.8822519691616346E+000 4.9493387051018395E-001 -3.6591381527323615E-002 7.0146002501410420E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 68 68 F T -3.5995524601415968E-001 2.8068279481749014E+000 -5.5407184851888325E-001 1.1753732537412618E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 69 69 F T 5.1563523325194349E-001 2.1311033375256949E+000 1.7201499204255108E+000 3.0125004492397180E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 70 70 F T 1.3667550569719067E+000 -1.6240839146310742E+000 3.0821316112196095E+000 -1.1138170644544461E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 71 71 F T -1.5622537025680500E-001 4.0147546401402362E-001 7.5873602605659146E-002 2.7440104895546145E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 72 72 F T 6.4826496074581519E-001 1.1060325748830477E-001 -9.0903422477610824E-002 -1.1945162763922061E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 73 73 F T -9.5005243977033593E-001 1.5366396991258797E+000 -2.1394419158168589E+000 2.8204767432876681E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 74 74 F T 1.2337424653465154E+000 6.2564394226060405E-001 3.9748569088231043E+000 5.6623764222410855E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 75 75 F T 1.0061882801780322E+000 -2.9376356704808897E+000 1.1779789524638407E+000 -2.4863831568724737E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 76 76 F T -1.2471194657343765E+000 -7.2857424294601991E-001 -3.1011883837680587E+000 9.5259229479825980E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 77 77 F T -1.6841090504226206E+000 -1.0940245900615366E+000 -6.0049843909579559E-001 -2.7101984121831529E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 78 78 F T -1.0125631319321758E-001 7.7232102350206422E-001 1.9857184274199176E+000 9.5869748527660781E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 79 79 F T 5.9697215557456967E-002 2.9386395492603623E-001 1.8831860283538737E-001 3.0605719442730766E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 80 80 F T -7.1256568614429860E-001 5.1227563331345805E-001 -9.1246145702558368E-001 2.5793042444341968E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 81 81 F T -1.1273562974899895E-001 -2.4447153684708338E+000 -5.2645883435389362E-001 -2.1038398124109525E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 82 82 F T 2.7809957618608816E-001 6.0483146507077001E-001 1.9623985027357131E+000 1.0730963648469707E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 83 83 F T -3.7780860704569169E-001 8.1218112665766795E-001 -2.5409012905244244E-001 -1.0510829773795654E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 84 84 F T -1.9291926921148701E+000 -1.2756011828439082E+000 -2.8379662793128388E+000 -1.9360396191347700E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 85 85 F T -9.4666125491603259E-001 2.8641806697898140E+000 1.8092834172417278E+000 1.5020065681078201E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 86 86 F T 9.6501976061740058E-001 -2.5027723686462542E+000 6.1997328532782447E-001 1.8745913119800575E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 87 87 F T -1.7103522541397782E+000 -3.4968554107600858E-001 -9.4077053313059089E-001 -6.3756329911350273E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 88 88 F T 2.1954797734776057E+000 1.0206606938753475E+000 1.0857925003618514E+000 1.4859194887266132E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 89 89 F T -8.8681261474517159E-001 1.2286565378228429E+000 -1.6537270185286099E+000 1.9151767134445417E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 90 90 F T -1.7841914180296493E-002 -8.7716887754748074E-001 1.2268140139783128E+000 -1.3634054861305128E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 91 91 F T -2.8155910219775162E+000 -2.3656076156172827E+000 -2.3271444321157970E+000 -9.2507941411599570E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 92 92 F T 9.9926425019423293E-001 -5.9668500967677041E-001 -1.7168575455912272E+000 8.6157296153089558E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 93 93 F T 3.5054809503207834E-001 1.1693866704231259E+000 -3.2254172503259921E+000 1.5286265860169892E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 94 94 F T 3.3568891980047106E+000 6.9857989874872062E-001 1.2987156313131829E+000 -2.0532600175390634E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 95 95 F T 4.8692784576286990E-001 -3.0239971045436227E+000 2.8270442915691816E+000 -1.5070543720159417E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 96 96 F T 3.0330256735348732E-001 -2.6584000625164772E+000 -9.1787451115838770E-001 -1.7162702715911757E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 97 97 F T 1.0344786499016927E+000 -3.7146788765322453E-001 7.5814776908723880E-001 -6.8132323308591047E-001 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 98 98 F T -6.7743689806263230E-001 -3.6145064656062575E-001 -4.1392948374161200E+000 2.0954255060444344E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 99 99 F T -3.4731913142939081E+000 -1.2739708591855864E-001 -9.9010537180413283E-001 -2.3742096756147206E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 + 100 100 F T -1.5734624457360278E+000 6.3448482809661366E-001 -3.0001752083277289E+000 -3.0037574058210272E+000 0.0000000000000000E+000 0.0000000000000000E+000 1.1703185753011758E+003 1.5000000000000000E+003 9.3827204600000005E+002 1 1 1 2212 diff --git a/test/thin6d_ions/fort.3 b/test/thin6d_ions/fort.3 index 52409f30c..102f5b003 100644 --- a/test/thin6d_ions/fort.3 +++ b/test/thin6d_ions/fort.3 @@ -75,7 +75,7 @@ HION 208 82 1.93687690162648124E+02 82 NEXT DIST -READ initial.dat + READ initial.dat NEXT ENDE==================================================================== ORGA--------------------------------------------------------------------