]> henry.ined.fr Git - .git/commitdiff
Some cleaning
authorN. Brouard <brouard@ined.fr>
Sat, 3 May 2003 01:18:24 +0000 (01:18 +0000)
committerN. Brouard <brouard@ined.fr>
Sat, 3 May 2003 01:18:24 +0000 (01:18 +0000)
src/imach.c

index e0f121e49692c5010df869c29308c37b5f7ef2d0..244d5f415acfcbeed3adbd0f89fbfdb7ffbce089 100644 (file)
 #define ODIRSEPARATOR '\\'
 #endif
 
-char version[80]="Imach version 0.95, February 2003, INED-EUROREVES ";
+char version[80]="Imach version 0.95, May 2003, INED-EUROREVES ";
 int erreur; /* Error number */
 int nvar;
 int cptcovn=0, cptcovage=0, cptcoveff=0,cptcov;
@@ -3138,6 +3138,7 @@ prevforecast(char fileres[], double anproj1, double mproj1, double jproj1, doubl
   
   fprintf(ficresf,"#****** Routine prevforecast **\n");
 
+/*           if (h==(int)(YEARM*yearp)){ */
   for(cptcov=1, k=0;cptcov<=i1;cptcov++){
     for(cptcod=1;cptcod<=ncodemax[cptcoveff];cptcod++){
       k=k+1;
@@ -3164,7 +3165,7 @@ prevforecast(char fileres[], double anproj1, double mproj1, double jproj1, doubl
          hpxij(p3mat,nhstepm,agec,hstepm,p,nlstate,stepm,oldm,savm, k);  
        
          for (h=0; h<=nhstepm; h++){
-           if (h==(int) (YEARM*yearp)) {
+           if (h*hstepm/YEARM*stepm ==yearp) {
               fprintf(ficresf,"\n");
               for(j=1;j<=cptcoveff;j++) 
                 fprintf(ficresf,"%d %d ",Tvaraff[j],nbcode[Tvaraff[j]][codtab[k][j]]);
@@ -3178,19 +3179,20 @@ prevforecast(char fileres[], double anproj1, double mproj1, double jproj1, doubl
                else {
                  ppij=ppij+p3mat[i][j][h]*probs[(int)(agec)][i][cptcod];
                }
-               if (h==(int)(YEARM*yearp))
+               if (h*hstepm/YEARM*stepm== yearp) {
                  fprintf(ficresf," %.3f", p3mat[i][j][h]);
-             }
-             if (h==(int)(YEARM*yearp)){
+               }
+             } /* end i */
+             if (h*hstepm/YEARM*stepm==yearp) {
                fprintf(ficresf," %.3f", ppij);
              }
-           }
-         }
+           }/* end j */
+         } /* end h */
          free_ma3x(p3mat,1,nlstate+ndeath,1, nlstate+ndeath, 0,nhstepm);
-       }
-      }
-    }
-  }
+       } /* end agec */
+      } /* end yearp */
+    } /* end cptcod */
+  } /* end  cptcov */
        
   if (mobilav!=0) free_ma3x(mobaverage,1, AGESUP,1,NCOVMAX, 1,NCOVMAX);
 
@@ -4468,8 +4470,9 @@ ageminpar, agemax, s[lastpass][imx], agev[lastpass][imx], nlstate, imx, mint[las
   strcpy(plotcmd,GNUPLOTPROGRAM);
   strcat(plotcmd," ");
   strcat(plotcmd,optionfilegnuplot);
-  printf("Starting: %s\n",plotcmd);fflush(stdout);
+  printf("Starting graphs with: %s",plotcmd);fflush(stdout);
   system(plotcmd);
+  printf(" Wait...");
 
  /*#ifdef windows*/
   while (z[0] != 'q') {