]> henry.ined.fr Git - .git/commitdiff
(Module): Now imach stops if date of birth, at least year of birth, is not given...
authorN. Brouard <brouard@ined.fr>
Thu, 29 Oct 2009 13:18:53 +0000 (13:18 +0000)
committerN. Brouard <brouard@ined.fr>
Thu, 29 Oct 2009 13:18:53 +0000 (13:18 +0000)
src/imach.c

index 165563ba46f03c6996c36e53d33fcc96afe70f89..da7d6974ebc514d414f13cb972754fb6871722eb 100644 (file)
@@ -1,6 +1,9 @@
 /* $Id$
   $State$
   $Log$
+  Revision 1.133  2009/07/06 10:21:25  brouard
+  just nforces
+
   Revision 1.132  2009/07/06 08:22:05  brouard
   Many tings
 
@@ -403,7 +406,7 @@ extern int errno;
 /* $Id$ */
 /* $State$ */
 
-char version[]="Imach version 0.98k, June 2009, INED-EUROREVES-Institut de longevite ";
+char version[]="Imach version 0.98l, October 2009, INED-EUROREVES-Institut de longevite ";
 char fullversion[]="$Revision$ $Date$"; 
 char strstart[80];
 char optionfilext[10], optionfilefiname[FILENAMELENGTH];
@@ -4942,9 +4945,15 @@ run imach with mle=-1 to get a correct template of the parameter file.\n",numlin
       month=99;
       year=9999;
     }else{
-      printf("Error reading data around '%s' at line number %ld %s for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .).  Exiting.\n",strb, linei,i,line,j);
-      fprintf(ficlog,"Error reading data around '%s' at line number %ld %s for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .).  Exiting.\n",strb, linei,i,line,j);fflush(ficlog);
+      printf("Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .).  Exiting.\n",strb, linei,i,line);
+      fprintf(ficlog,"Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .).  Exiting.\n",strb, linei,i,line);fflush(ficlog);
+       goto end;
+    }
+    if (year==9999) {
+      printf("Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy) but at least the year of birth should be given.  Exiting.\n",strb, linei,i,line);
+      fprintf(ficlog,"Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy) but at least the year of birth should be given. Exiting.\n",strb, linei,i,line);fflush(ficlog);
        goto end;
+
     }
     annais[i]=(double)(year);
     moisnais[i]=(double)(month); 
@@ -5169,7 +5178,7 @@ run imach with mle=-1 to get a correct template of the parameter file.\n",numlin
            agev[m][i]=1;
          else if(agev[m][i] <agemin){ 
            agemin=agev[m][i];
-           /*printf(" Min anint[%d][%d]=%.2f annais[%d]=%.2f, agemin=%.2f\n",m,i,anint[m][i], i,annais[i], agemin);*/
+           printf(" Min anint[%d][%d]=%.2f annais[%d]=%.2f, agemin=%.2f\n",m,i,anint[m][i], i,annais[i], agemin);
          }
          else if(agev[m][i] >agemax){
            agemax=agev[m][i];