--- imach/src/imach.c 2003/05/02 18:51:41 1.74 +++ imach/src/imach.c 2003/05/03 01:18:24 1.75 @@ -1,4 +1,4 @@ -/* $Id: imach.c,v 1.74 2003/05/02 18:51:41 brouard Exp $ +/* $Id: imach.c,v 1.75 2003/05/03 01:18:24 brouard Exp $ Interpolated Markov Chain Short summary of the programme: @@ -119,7 +119,7 @@ #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 anpr 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 anpr 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 anpr 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], age 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') {