Advanced search
Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Corsair
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

Discussion Forums: general

Start New Thread Start New Thread

 

By: Jossitt vargas
No attachment found
generador automatico de inputs con variacion de la energia [ reply ]  
2017-01-09 13:28
# include <cstdlib> # include <iostream> # include <iomanip> # include <ctime> # include <cstring> # include <fstream> using namespace std; /// g++ -o exe inputgenerator.cpp /// ./exe int main ( ); void test01 ( ); void test02 ( ); void filename_inc ( string *filename ); void timestamp ( ); //****************************************************************************// int main ( ) //****************************************************************************// // // Purpose: // // FILES_MULTIPLE demonstrates how to work with multiple CORSIKA files. // // // 6 January 2017 // // Author: // // Jossitt Vargas, CORSAIR // { timestamp ( ); cout << "\n"; cout << "FILES_MULTIPLE:\n"; cout << " C++ version.\n"; cout << " Demonstrate how to work with multiple files.\n"; test01 ( ); // test02 ( ); // // Terminate. // cout << "\n"; cout << "FILES_MULTIPLE:\n"; cout << " Normal end of execution.\n"; cout << "\n"; timestamp ( ); return 0; } void test01 ( ) //****************************************************************************// // // Purpose: // // TEST01 writes data to four files which are open simultaneously. // // Discussion: { # define FILENUM 18 // // FILENUM can be increased, and the program will still work the same way. // int divisor[18]; string filename[18]; ofstream fileunit[18]; int i; int j; // string temp = "input"; string temp = "input0"; string temp2 = "input10"; cout << "\n"; cout << "File generator\n"; cout << " Create "<< FILENUM<<"\t files\n"; int energy[18]={ 1.00E+01, 1.33E+01, 1.78E+01, 2.37E+01, 3.16E+01, 4.22E+01, 5.62E+01, 7.50E+01, 1.00E+02, 1.78E+02, 3.16E+02, 5.62E+02, 1.00E+03, 3.16E+03, 1.00E+04, 3.16E+04, 1.00E+05, 3.16E+05}; // // Set the divisors. // PRIME is a function which can return the I-th prime number. // for ( i = 0; i < FILENUM; i++ ) { divisor[i] = energy[i]; // cout<<"altitud"<<endl; } // // Define the file names for an arbitrary number of files // by incrementing the numeric information in a "template". // for ( i = 0; i < FILENUM; i++ ) { filename_inc ( &temp ); filename[i] = temp; if(i>9) { filename_inc ( &temp2 ); filename[i] = temp2; } } // // Associate a unit number with each file. // for ( i = 0; i < FILENUM; i++ ) { cout<<"i="<<i<<endl; fileunit[i].open ( filename[i].c_str ( ) ); // fileunit[i] << "Multiples of " << divisor[i] << "\n"; // fileunit[i] << "ENERGIA= " << divisor[i] << "\n"; //************************************ fileunit[i] << "RUNNR" << "\t"<<2 << "\t"<< "\t \t""run number"<< "\n"; fileunit[i] << "EVTNR" << "\t"<<1 << "\t \tnumber of first shower event"<< "\n"; fileunit[i] << "NSHOW" << "\t"<<100 << "\t \tnumber of showers to generate"<< "\n"; fileunit[i] << "PRMPAR" << "\t"<<14 << "\t \tparticle type of prim. particle (p:14, N:A*100+Z)"<< "\n"; fileunit[i] << "ESLOPE" << "\t"<<-2.7 << "\t \tslope of primary energy spectrum"<< "\n"; fileunit[i] << "ERANGE" << "\t"<

By: Jossitt vargas
No attachment found
clearcorsika.sh [ reply ]  
2017-01-09 13:25
rm DAT000002.long DAT000002

By: Jossitt vargas
No attachment found
exein.sh [ reply ]  
2017-01-09 13:23
# script for run the corsika inputs of semi- authomatic way
# Author: Jossitt Vargas jossittv@gmail.com


./cleancorsika.sh

for i in `seq 0 17`;
do
./corsika75000Linux_QGSJET_gheisha < input${i} > output${i}.txt
./cleancorsika.sh
done

By: Jossitt vargas
No attachment found
RE: scripts for corsika inpunts [ reply ]  
2017-01-05 16:30
cleancorsika.sh

By: Jossitt vargas
No attachment found
scripts for corsika inpunts [ reply ]  
2017-01-05 16:24
Buen Dia Corsarios

Les deseo a todos un feliz año.

Envio una primera version de un script para facilitar la ejecucion de corsika a partir de los inputs.
Uno de los probleas que que no se puede hacer de forma iterativa para varias energias el calcula de la simulacion por lo que cada input se debe colocar a mano.

Con este script es posible correr de forma automatica archivos con a extencion inputxx donde xx es el numero del input. Para modificar el numero de inputs en la mcro es solo necesario en un editor de texto modificar la linea
for i in `seq 1 3`;

do

se modifica el 3 por el numero de files que quieran correr.

Nota: asi como esta escrito el nombre de los inputs es input1,input2....inputxx
uds pueden modificar este nombre en las lineas siguientes del script si lo prefieren.
infortunadamente aun no tenemos una template para los inputs, por lo que (por ahora )
los hacemos a mano
Si alguien encontro una forma mas eficaz de hacerlo me encantaria aprender como se hace.
un gran saludo a todos y por favor no duden en escribir.


saludos

# Script used to run the corsika inputs of semi- authomatic way
# Author: Jossitt Vargas jossittv@gmail.com


1. ) Create your inputs with the sequence inpuntxx where xx is the file number e.g. input1,input2...

2. Put your inputs files in the corsika run folder
e.g.
/home/corsair/corsika/corsika-75000/run

3. copy the scripts cleancorsika.sh and exein.sh in your .../run folder

4. execute in the terminal
chmod 777 exein.sh

./exein.sh

Note: This script generate the outputxx and use the auxiliar script ./cleancorsika in order to erase the DAT000002.long DAT000002 files








   

Powered By FusionForge