diff --git a/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90 b/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90
index c0311a90b9d6c22c36874b52fbc0efb4a27ad675..7310461099d350a5ab9d4e2207dbbb1b2bcf3dc1 100644
--- a/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90
+++ b/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90
@@ -276,8 +276,8 @@ CONTAINS
                 END DO
               END IF
             END IF
-           !Add maximum comment size (necessary when writing LFI files because the comment is stored with the field)
-           ileng = ileng + MAXLFICOMMENTLENGTH
+            !Add maximum comment size (necessary when writing LFI files because the comment is stored with the field)
+            leng = leng + MAXLFICOMMENTLENGTH
           END IF
 
           IF (.NOT.tpreclist(ji)%found) THEN