Commit 066546dc authored by saeed's avatar saeed
Browse files

sshval is added

parent 279b639e
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include<math.h> #include<math.h>
#include"svgplot.h" #include"svgplot.h"
#define LF 16 #define LF (64)
long int numLines(FILE *FS){ long int numLines(FILE *FS){
long int nl = 0L; long int nl = 0L;
...@@ -47,7 +47,7 @@ int Strcmp(char *sa, char *sb){ ...@@ -47,7 +47,7 @@ int Strcmp(char *sa, char *sb){
int main(int argc, char *argv[]){ int main(int argc, char *argv[]){
if (argc != 5){ if (argc != 5){
printf("Usage %s filename (stationame)\n",argv[0]); printf("Usage %s filename stationame startdate(YYYYMMDDHH) enddate(YYYYMMDDHH)\n",argv[0]);
return 1; return 1;
} }
...@@ -161,19 +161,33 @@ int main(int argc, char *argv[]){ ...@@ -161,19 +161,33 @@ int main(int argc, char *argv[]){
fclose(FS); fclose(FS);
int ii = 0; int ii = 0;
int ia = 0, ib = 0; int ia = -1, ib = -1;
for(ii=0; ii < (nline-1);++ii){ for(int i=0; i < (nline-1);++i){
if (icontent[ii] == 0 ) break; if (icontent[i] == 0 ){
ii = i;
break;
}
} }
for(ia=0; ia < (ii+1);++ia){ for(int i=0; i < (ii+1);++i){
if (icontent[ia] == idbeg) break; if (icontent[i] == idbeg){
ia = i;
break;
}
} }
for(ib=0; ib < (ii+1);++ib){ for(int i=0; i < (ii+1);++i){
if (icontent[ib] == idend) break; if (icontent[i] == idend){
ib = i;
break;
}
}
if (ia == -1 || ib == -1){
printf("startdate %d or enddate %d do not exist in data\n", idbeg, idend);
return 1;
}
if (ia > ib ){
printf("startdate %d is bigger than enddate %d \n", idbeg, idend);
return 1;
} }
//printf("%ld\t%d\t%d\t%d\n",(nline -1),ii,ia,ib);
for (int i=ia; i <= ib;++i){ for (int i=ia; i <= ib;++i){
printf("%d\t%f\n",icontent[i],fcontent[i]); printf("%d\t%f\n",icontent[i],fcontent[i]);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment