/* * This subroutine performs the calls to the PBOB c routines * */ #include #include #include #include #include #include #include extern PBOB *ReadPBOB(char *file_name); extern PARTICLE *ReadParticle(char *file_name,int time_slice,int start_indx,int N); void set_blocklabel(int *icol, char *name); void read_pbob_data_fromc(int icol, int istep, int np, double temparr[np],int itype[np], char *tag); void read_pbob_header(char *filename, int *npart, int *ncol, int *nsteps, int *ndim, int *ndimV, double *time, int *ierr) { *npart = 0; *ierr = 0; *ncol = 0; *nsteps = 0; *time = 0.; *npart = 0; *ndim = 2; *ndimV = 2; *ncol = 15; /* hard wired */ PBOB *pbob = NULL; if ((pbob=ReadPBOB(filename))==NULL) { *ierr = 1; return; } /*printf(" cluster_size = %i \n",pbob->cluster_size); printf(" length_units = %s \n",pbob->length_units); printf(" mass_units = %s \n",pbob->mass_units); printf(" time_units = %s \n",pbob->time_units); printf(" energy_units = %s \n",pbob->internal_energy_units); */ printf(" short title = %s \n",pbob->short_title); printf(" total_particles = %llu \n",pbob->total_particles); printf(" nn_k = %i \n",pbob->nn_k); printf(" time slices = %i \n",pbob->number_of_time_slices); /* printf(" offset = %i \n",pbob->first_particle_byte_offset); printf(" length = %i \n",pbob->particle_length_bytes); */ printf(" endian = %s \n",pbob->endian_str); printf(" version = %s \n",pbob->pbob_version); *nsteps = pbob->number_of_time_slices; *npart = pbob->total_particles; *time = pbob->time; /* printf(" ascii_header: \n"); printf("%s\n",pbob.ascii_header); */ } void read_pbob_data(char *filename, int npart, int time_slice, double *timeval, int *ierr) { PARTICLE *particle = NULL; *ierr = 0; int start_indx = 0; int N = npart; int i; *timeval = -1.; /*printf(" time_slice = %i\n",time_slice);*/ if ((particle=ReadParticle(filename,time_slice,start_indx,N))==NULL) { *ierr = 2; return; } int species[npart]; for (i=0;i