/* To get C matrix 42 mnoth x 73 stations */ #include #include #include //#include #include int main() { int s,yy; int vy,vd; float v1,v2,v3,wv,v0; char ls_fn[80],x1_fn[98],x2_fn[98],x3_fn[98],x0_fn[98]; FILE *x1_ptr,*x2_ptr,*x3_ptr,*ls_ptr,*x0_ptr; sprintf(ls_fn,"../c13c_matrix3066_dlt_case5.txt"); if ((ls_ptr=fopen(ls_fn, "w")) == NULL) { printf("\n Unable to open file0, exitting...\n"); exit(0); } sprintf(x0_fn,"../../obsdata_proc/Ca_x_ddlt73stn42m.txt"); if ((x0_ptr=fopen(x0_fn, "r")) == NULL) { printf("\n Unable to open file1, exitting...\n"); exit(0); } sprintf(x1_fn,"../../flux2conc/d_xconcn4iterms/fxd_conctrn42x73f2c_ff.txt"); if ((x1_ptr=fopen(x1_fn, "r")) == NULL) { printf("\n Unable to open file1, exitting...\n"); exit(0); } sprintf(x2_fn,"../../flux2conc/d_xconcn4iterms/fxd_conctrn42x73f2c_bio_pt1.txt"); if ((x2_ptr=fopen(x2_fn, "r")) == NULL) { printf("\n Unable to open file2, exitting...\n"); exit(0); } sprintf(x3_fn,"../../flux2conc/d_xconcn4iterms/fxd_conctrn42x73f2c_ocn_pt1.txt"); if ((x3_ptr=fopen(x3_fn, "r")) == NULL) { printf("\n Unable to open file3, exitting...\n"); exit(0); } for (yy=1;yy<=3066;yy++) { fscanf(x0_ptr,"%d %d %f\n",&vy,&vd,&v0); fscanf(x1_ptr,"%f\n",&v1); fscanf(x2_ptr,"%f\n",&v2); fscanf(x3_ptr,"%f\n",&v3); wv=(float)(v0-v1-v2-v3); fprintf(ls_ptr,"%f\n",wv); } // end of yy fclose(x0_ptr); fclose(x3_ptr); fclose(x1_ptr); fclose(x2_ptr); fclose(ls_ptr); printf("done \n"); return 1; }