lfi2cdf: BUG corrections: uninitialised variables + incorrect conversion
authorPhilippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Tue, 22 Sep 2015 07:48:00 +0000 (09:48 +0200)
committerPhilippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Mon, 2 May 2016 10:23:53 +0000 (12:23 +0200)
tools/lfi2cdf/src/fieldtype.f90
tools/lfi2cdf/src/lfi2cdf.f90
tools/lfi2cdf/src/mode_dimlist.f90
tools/lfi2cdf/src/newmain.c

index daa8cbb..62a1b73 100644 (file)
@@ -297,8 +297,6 @@ END SUBROUTINE init_sysfield
        END IF
     END DO
 
-    write(clevel,'(I4.4)') level
-
     IF (.NOT. found) THEN
        ! Next, search in user field tab
        IF (ALLOCATED(userfield)) THEN
@@ -331,6 +329,7 @@ END SUBROUTINE init_sysfield
                 ELSE IF (level>-1) THEN
                   !Maybe it is a z-level splitted field
                   !Warning: false positives are possible (but should be rare)
+                  write(clevel,'(I4.4)') level
                   iposx = INDEX(hfname,clevel)
                   IF (iposx /= 0) THEN
                     IF (hfname(:iposx-1)==sysfield(ji)%name) THEN
index ca153fb..b4039b4 100644 (file)
@@ -59,6 +59,7 @@ subroutine  LFI2CDFMAIN(hinfile,iiflen,ooutname,houtfile,ioflen,hvarlist,ivlen,o
         ! by counting commas, = and +
         nbvar_tbr  = 0
         nbvar_calc = 0
+        nbvar_tbw = 0
         DO ji=1,ivlen
            IF (hvarlist(ji:ji) == ',' .OR.hvarlist(ji:ji) == '+') THEN
               nbvar_tbr = nbvar_tbr+1
index 6c6ffe3..d497713 100644 (file)
@@ -72,6 +72,7 @@ CONTAINS
     !
     IF (len /= 1) THEN 
        IF (gforce) THEN
+         count = 0
          NULLIFY(tmp)
        ELSE 
          count = 1
index 5eba51d..6f56531 100644 (file)
@@ -53,10 +53,13 @@ int main(int argc, char **argv)
     cmd++;
   l2c_flag = strcmp(cmd, "lfi2cdf") == 0 ? 1 : 0;
 
+  compress_flag = 0;
   list_flag = 0;
   hdf5_flag = 0;
+  help_flag = 0;
+  outname_flag = 0;
   reduceprecision_flag = 0;
-  compress_flag = 0;
+  split_flag = 0;
   p = buff;
   *p = '\0';