Index: flexpart_code/fpmetbinary_mod.F90
===================================================================
--- flexpart_code/fpmetbinary_mod.F90	(revision 7e5f1dcd1d6ed995a0ff78b1dadaf5538559c8ea)
+++ flexpart_code/fpmetbinary_mod.F90	(revision 41a29817193fafc3b7cc0ca24286bd374ef4fc47)
@@ -44,5 +44,6 @@
     USE com_mod
     USE conv_mod
-    USE par_mod, ONLY : nxmax, nymax, nzmax, nuvzmax, nwzmax, numclass, maxspec
+    USE par_mod, ONLY : nxmax, nymax, nzmax, nuvzmax, nwzmax, numclass, maxspec, &
+&                       maxnests, nxmaxn, nymaxn
 
     USE netcdf
@@ -306,5 +307,6 @@
         INTEGER :: ncvarid          ! NetCDF variable ID
 
-        INTEGER :: nxmax_dimid, nymax_dimid, nzmax_dimid, nuvzmax_dimid, nwzmax_dimid
+        INTEGER :: nxmax_dimid, nymax_dimid, nzmax_dimid, nuvzmax_dimid, nwzmax_dimid, &
+&                  maxnests_dimid, nxmaxn_dimid, nymaxn_dimid
 
         INTEGER, DIMENSION(1) :: dim1dids    ! Dimension IDs for 1D arrays
@@ -314,10 +316,12 @@
         ! These are used when loading in dimensions from NC file
         CHARACTER(LEN=NF90_MAX_NAME) :: nxmax_dimname, nymax_dimname, nzmax_dimname, &
-&                                       nuvzmax_dimname, nwzmax_dimname
+&                                       nuvzmax_dimname, nwzmax_dimname,&
+&                                       maxnests_dimname, nxmaxn_dimname, nymaxn_dimname
 
         ! These are temporary variables, used in the LOAD option, for 
         ! comparing against the current values in FLEXPART of nxmax, nymax, ...
         INTEGER :: temp_nxmax, temp_nymax, temp_nzmax, &
-&                  temp_nuvzmax, temp_nwzmax
+&                  temp_nuvzmax, temp_nwzmax, &
+&                   temp_maxnests, temp_nxmaxn, temp_nymaxn
 
         CHARACTER(LEN=12) :: temp_preproc_format_version_str
@@ -936,4 +940,12 @@
             ! Getting ready to add in nested code
 
+            ! These are compiled max dimensions from par_mod - these are
+            ! not meant to be reassigned during a LOAD, but used as "header"
+            ! information to provide the structure of arrays
+            ncret = nf90_def_dim(ncid, 'maxnests', maxnests, maxnests_dimid)
+            ncret = nf90_def_dim(ncid, 'nxmaxn', nxmaxn, nxmaxn_dimid)
+            ncret = nf90_def_dim(ncid, 'nymaxn', nymaxn, nymaxn_dimid)
+
+
 
             ! Nested, scalar values (for each nest)
@@ -1091,4 +1103,6 @@
 
 
+
+
             ! Scalar values
             READ(iounit) nx, ny, nxmin1, nymin1, nxfield
@@ -1387,4 +1401,38 @@
 
 
+            ! Now the nested input grid variables
+            ! Get the compiled values that were written into the FP file, and
+            ! make sure they are equal to the current compiled values, to make
+            ! sure we are working with consistent arrays
+            ncret = nf90_inq_dimid(ncid, 'maxnests', maxnests_dimid)
+            ncret = nf90_inquire_dimension(ncid, maxnests_dimid, maxnests_dimname, &
+&                                                temp_maxnests)
+            PRINT *, 'temp_maxnests: ', temp_maxnests
+
+            ncret = nf90_inq_dimid(ncid, 'nxmaxn', nxmaxn_dimid)
+            ncret = nf90_inquire_dimension(ncid, nxmaxn_dimid, nxmaxn_dimname, &
+&                                                temp_nxmaxn)
+            PRINT *, 'temp_nxmaxn: ', temp_nxmaxn
+
+            ncret = nf90_inq_dimid(ncid, 'nymaxn', nymaxn_dimid)
+            ncret = nf90_inquire_dimension(ncid, nymaxn_dimid, nymaxn_dimname, &
+&                                                temp_nymaxn)
+            PRINT *, 'temp_nymaxn: ', temp_nymaxn
+
+
+            IF ( (temp_nxmaxn == nxmaxn) .AND. (temp_nymaxn == nymaxn) .AND. &
+&                   (temp_maxnests == maxnests) ) THEN
+                CONTINUE
+            ELSE
+                PRINT *, 'Incompatible dimensions between fp file and current FLEXPART!'
+                ! PRINT *, ''
+                PRINT *, '                  FP file     Compiled FP'
+                PRINT *, 'nxmaxn:     ', temp_nxmaxn, '    ', nxmaxn
+                PRINT *, 'nymaxn:     ', temp_nymaxn, '    ', nymaxn
+                PRINT *, 'maxnests:     ', temp_maxnests, '    ', maxnests
+                STOP
+            END IF
+
+
 
             ! Nested, scalar values (for each nest)
