Changeset 5cef1eb in flexpart.git


Ignore:
Timestamp:
Oct 5, 2016, 10:21:23 AM (8 years ago)
Author:
Don Morton <Don.Morton@…>
Branches:
FPv9.3.1, FPv9.3.2, fp9.3.1-20161214-nc4, grib2nc4_repair
Children:
403dde7
Parents:
da10dc8
Message:

Modified preproc file structure so that first string is 8-byte version

See ticket https://www.flexpart.eu/ticket/162

Location:
flexpart_code
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • flexpart_code/.gitignore

    r496c607 r5cef1eb  
    33FLEXPART_GFORTRAN
    44GRIB2FLEXPART_GFORTRAN
     5flexpart_ifort
     6grib2flexpart_ifort
  • flexpart_code/fpmetbinary_mod.F90

    r9cdf8bd r5cef1eb  
    88  !             Delia Arnold (deliona.arnold@gmail.com)                        *
    99  !                                                                            *
    10   !     15 Sep 2015                                                            *
    11   !                                                                            *
    12   !     Currently, the only data being dumped and loaded has data structures   *
    13   !     defined in com_mod.f90.  In the future, perhaps it will be necessary   *
    14   !     to use data structures from other parts of the FLEXPART code system.   *
    15   !                                                                            *
     10  !     07 Oct 2016                                                            *
    1611  !                                                                            *
    1712  !     Most of the data structures from com_mod.f90 that are dumped and       *
     
    2722  !     city.                                                                  *
    2823  !                                                                            *
     24  !     Recent enhancements (07 Oct 2016) DJM:                                 *
     25  !                                                                            *
     26  !     - file format changed so that compiled dimensions are output, and      *
     27  !       during input these same dimensions are compared with the dimensions  *
     28  !       compiled into the flexpart that is reading it.  A discrepancy        *
     29  !       causes abort, so that time isn't wasted reading an incompatible      *
     30  !       file.                                                                *
     31  !                                                                            *
     32  !     - file format changed so that first item is an 8-character string      *
     33  !       depicting the version of the preprocessed file format.               *
     34  !       An inconsistency between a detected and expected string results      *
     35  !       in program abort.                                                    *
     36  !                                                                            *
     37  !       *** IMPORTANT *** - when the format of the preprocessed output is    *
     38  !       modified in any way, be sure to change the version string below,     *
     39  !       PREPROC_FORMAT_VERSION_STR, so that attempts to read the output      *
     40  !       with a different format version will cause an abort.                 *
     41  !                                                                            *
    2942  !*****************************************************************************
    3043
     
    3952    INTEGER, PARAMETER :: IOUNIT_DUMP = 33, IOUNIT_LOAD = 34, &
    4053                          IOUNIT_TEXTOUT = 35
    41     PRIVATE IOUNIT_DUMP, IOUNIT_LOAD, IOUNIT_TEXTOUT, fpio
     54
     55    ! When a change is made to the format of the preprocessed file, such that
     56    ! this routine will not be able to read a previous version, this version
     57    ! string should be modified
     58    CHARACTER(LEN=8), PARAMETER :: PREPROC_FORMAT_VERSION_STR = '9.3.1e  '
     59
     60    PRIVATE IOUNIT_DUMP, IOUNIT_LOAD, IOUNIT_TEXTOUT, fpio,    &
     61&           PREPROC_FORMAT_VERSION_STR
    4262
    4363
     
    255275&                  temp_nuvzmax, temp_nwzmax
    256276
     277        CHARACTER(LEN=8) :: temp_preproc_format_version_str
     278
    257279        CHARACTER(LEN=128) :: errmesg
    258280
    259281        if (op == 'DUMP') THEN
     282
     283
     284            ! Write the preprocessing format version string
     285            WRITE (iounit) PREPROC_FORMAT_VERSION_STR
    260286
    261287            ! Write the compiled max dimensions from par_mod - these are
     
    402428        ELSE IF (op == 'LOAD') THEN
    403429
     430            ! Read the preprocessed format version string and insure it
     431            ! matches this version
     432            READ (iounit) temp_preproc_format_version_str
     433            PRINT *, 'Reading preprocessed file format version: ', &
     434&                    temp_preproc_format_version_str
     435
     436            IF (TRIM(temp_preproc_format_version_str) == &
     437&                                        TRIM(PREPROC_FORMAT_VERSION_STR)) THEN
     438                CONTINUE
     439            ELSE
     440                PRINT *, ''
     441                PRINT *, 'Inconsistent preprocessing format version'
     442                PRINT *, 'Expected Version: ', PREPROC_FORMAT_VERSION_STR
     443                PRINT *, 'Detected Version: ', temp_preproc_format_version_str
     444                PRINT *, ''
     445                STOP
     446            END IF
     447
    404448            ! Read the compiled max dimensions that were dumped from par_mod
    405449            ! when creating the fp file, so that we can compare against
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG