/*To get c13permil co2 ppm for 60 mnoth x 73 stations from obs */ #include #include #include //#include #include int main() { int s,yy; int vy,vd; float vco2[66],vc13[66],wv; char ls_fn[80],x2_fn[98],x3_fn[98]; FILE *x2_ptr,*x3_ptr,*ls_ptr; //sprintf(ls_fn,"../c13cnctrtn73stn42m_pml.txt"); sprintf(ls_fn,"../co2cnctrtn73stn42m_ppm.txt"); if ((ls_ptr=fopen(ls_fn, "w")) == NULL) { printf("\n Unable to open listing file, exitting program ...\n\n"); exit(0); } for (s=1;s<=73;s++) { sprintf(x2_fn,"../co2c13obs/co2_msr_monthly_stn%d.txt",s); if ((x2_ptr=fopen(x2_fn, "r")) == NULL) { printf("\n Unable to open input2 file, exitting program ...\n\n"); exit(0); } sprintf(x3_fn,"../co2c13obs/c13_msr_monthly_stn%d.txt",s); if ((x3_ptr=fopen(x3_fn, "r")) == NULL) { printf("\n Unable to open input3 file, exitting ...\n\n"); exit(0); } printf("processing stn %d \n",s); for (yy=1;yy<=60;yy++) // 5yr x 12mn { fscanf(x2_ptr,"%d %d %f\n",&vy,&vd,&vco2[yy]); fscanf(x3_ptr,"%d %d %f\n",&vy,&vd,&vc13[yy]); } for (yy=1;yy<=60;yy++) { //wv=vc13[yy]; wv=vco2[yy]; if (yy>18) fprintf(ls_ptr,"%f\n",wv); //fprintf(ls_ptr,"%f\t%f\t%f\t%f\t%f\n",c13r2,c13r1,vco2[yy],vco2[yy-1],wv); } fclose(x2_ptr); fclose(x3_ptr); } // end of s fclose(ls_ptr); return 1; }