Opened 3 years ago

Closed 3 years ago

#161 closed Enhancement (fixed)

Add a dimensions check to FPv9.3.1 when reading preprocessed files

Reported by: donaldjmorton Owned by:
Priority: minor Milestone:
Component: FP other Version: FLEXPART 9.3
Keywords: Cc:


Currently, the output and input of preprocessed met files (referred to as "fp files") is accomplished with raw binary dumps of scalars and arrays - this is done for efficiency. However, this requires that the GRIB2FLEXPART that generated the fp files is compiled with exactly the same dimensions as the FLEXPART that reads the fp files. This is not unreasonable, especially since the two binaries are generated with a single Makefile.

However, in one case, a user unknowingly generated fp files with the z-dimension set to 138, and then read them with a FLEXPART where the z-dimension was 140. In this case, the program ran for a quite a while, then bombed, wasting a lot of time.

Therefore, I'm going to implement a check in FLEXPART so that when it reads an fp file for input, it will insure that the dimensions written into the fp file are the same as the dimension with with FLEXPART was compiled. If this is not the case, FLEXPART will simply abort with an informative message.

For anybody who reads this, please note that at this point, we're still trying to determine whether the "raw binary dump" is the best format for the fp files, or if we should switch to something like NetCDF4.

Change History (4)

comment:1 Changed 3 years ago by donaldjmorton

The game plan:

  • Create temporary branch fp9.3.1-fpdimcheck
  • In fpmetbinary_mod.F90:fpmetbinary_load() - before calling fpio(),
    • open file and read in the first values of the file (dimensions) to temporary variables,
    • check that the important dimensions are equal to the dimensions compiled into FLEXPART
    • if all is good, close the file, then open it and continue on with call to fpio() (alternatively, just REWIND the file pointer). Otherwise, abort the program with an informative message
  • Test
  • Merge the temporary branch into branch FPv9.3.1
  • Tag as FPv9.3.1d
Last edited 3 years ago by donaldjmorton (previous) (diff)

comment:2 Changed 3 years ago by donaldjmorton

As usual, more complex than I had wanted it to be. The dimensions I'm currently dumping include nx, ny, nz, etc. from com_mod.f90, and I should not be comparing those against the nxmax, nymax, nzmax, etc. found in par_mod.F90.

So, I will first need to insure that when dumping, fp files have, as their first values, nxmax, nymax, nzmax, nuvzmax, nwzmax.

Then, upon loading, I will read those same values into temporary variables, compare against the par_mod.F90 values, and then react accordingly.

Last edited 3 years ago by donaldjmorton (previous) (diff)

comment:3 Changed 3 years ago by donaldjmorton

The above changes have been accomplished. All changes were made in fpmetbinary_mod.F90:fpio().

Tested to assure preprocessing, followed by use of preprocessed files, still worked, and then tested by running with a FLEXPART in which the vertical dimensions were set to 140 rather than 138, assuring that program aborted as designed.

Merged back into branch FPv9.3.1 and created tag FPv9.3.1d.

Whoever has authority to close this ticket may close it now.

comment:4 Changed 3 years ago by admin

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
hosted by ZAMG