PLUTO
extract.c File Reference
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
Include dependency graph for extract.c:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

int main ( void  )

Definition at line 5 of file extract.c.

6 {
7  int n, i;
8  char label[64];
9  double z[14], L[14], T;
10  FILE *f, *fout;
11 
12 // f = fopen("cooltab","r");
13  f = fopen("cooltab_z03z3.dat","r"); /* newer file */
14  if (f == NULL){
15  printf ("! File cooltab does not exists\n");
16  exit(1);
17  }
18 
19 /* -- read column header -- */
20 /*
21  for (i = 0; i < 14; i++){
22  fscanf(f, "%lf \n", z + i);
23  }
24 */
25  fscanf(f, "%s %lf %lf %lf \n", label, z, z+1, z+2);
26 
27  fout = fopen("cooltable.dat","w");
28  while (!feof(f)) {
29 /*
30  fscanf (f,"%d %lf", &n, &T);
31  for (i = 0; i < 14; i++){
32  fscanf(f, "%lf \n", L + i);
33  }
34 */
35  fscanf (f,"%lf %lf %lf %lf", &T, L, L+1, L+2);
36  fprintf (fout,"%12.6e %12.6e\n",T, L[1]*z[1]);
37  }
38  fclose(f);
39  fclose(fout);
40 
41 
42  return(0);
43 }
tuple T
Definition: Sph_disk.py:33
static int n
Definition: analysis.c:3
int i
Definition: analysis.c:2