Changeset 515b21c in flexpart.git


Ignore:
Timestamp:
Apr 16, 2017, 10:14:27 AM (7 years ago)
Author:
Don Morton <Don.Morton@…>
Branches:
fp9.3.1-20161214-nc4
Children:
b398fb6
Parents:
5f50284
Message:

Brang fp9.3.1-20161214-nc4,
Added check of preproc format string, started cleaning up

Location:
flexpart_code
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • flexpart_code/fpgridcheck.F90

    r5f50284 r515b21c  
    4545    fpfname = TRIM(path(3)) // TRIM(wfname(ifn))
    4646  endif
    47   print *, 'fpgridcheck(): LOADING.... ',  TRIM(fpfname)
    4847
    4948  ! The second argument of this call indicates which index (1 or 2)
     
    5453
    5554
    56 PRINT *, 'fpgridcheck(): fpfname:', fpfname
    5755  CALL fpmetbinary_load(TRIM(fpfname), 1)
    5856
  • flexpart_code/fpmetbinary_mod.F90

    r5f50284 r515b21c  
    5555    INTEGER, PARAMETER :: IOUNIT_DUMP = 33, IOUNIT_LOAD = 34, &
    5656                          IOUNIT_TEXTOUT = 35
     57                         
     58                   
     59    INTEGER, PARAMETER :: PREPROC_FMT_STR_DIM = 11
    5760
    5861    ! When a change is made to the format of the preprocessed file, such that
    5962    ! this routine will not be able to read a previous version, this version
    6063    ! string should be modified
    61     CHARACTER(LEN=12), PARAMETER :: PREPROC_FORMAT_VERSION_STR = 'FP_p-9.3.1'//char(0)
     64
     65
     66    ! WARNING - for now, for NC4 compatability, make sure that the PREPROC_FMT_STR_DIM
     67    ! defined above is exactly the length of the string PLUS the null character added
     68    ! I've had a hell of a time making it all compatible with NC4 (DJM)
     69    CHARACTER(LEN=PREPROC_FMT_STR_DIM), PARAMETER :: PREPROC_FORMAT_VERSION_STR = 'FP_p-9.3.1'//char(0)
    6270
    6371    PRIVATE IOUNIT_DUMP, IOUNIT_LOAD, IOUNIT_TEXTOUT, fpio,    &
     
    331339&                  maxspec_dimid, numclass_dimid, maxnests_dimid, nxmaxn_dimid, nymaxn_dimid, &
    332340&                  zero_to_nzmax_dimid, zero_to_maxnests_dimid, polemap_dimid, &
    333 &                  nconvlevmax_dimid, na_dimid
     341&                  nconvlevmax_dimid, na_dimid, preproc_fmt_str_dimid
    334342
    335343
     
    349357&                                       maxnests_dimname, nxmaxn_dimname, nymaxn_dimname, &
    350358&                                       zero_to_nzmax_dimname, zero_to_maxnests_dimname, &
    351 &                                       polemap_dimname, nconvlevmax_dimname, na_dimname
     359&                                       polemap_dimname, nconvlevmax_dimname, na_dimname, &
     360&                                       preproc_fmt_str_dimname
    352361
    353362        ! These are temporary variables, used in the LOAD option, for
     
    356365&                  temp_nuvzmax, temp_nwzmax, &
    357366&                  temp_maxspec, temp_numclass,&
    358 &                  temp_maxnests, temp_nxmaxn, temp_nymaxn
    359 
    360         CHARACTER(LEN=12) :: temp_preproc_format_version_str
     367&                  temp_maxnests, temp_nxmaxn, temp_nymaxn, temp_preproc_fmt_str_dim
     368
     369        CHARACTER(LEN=PREPROC_FMT_STR_DIM) :: temp_preproc_format_version_str
    361370
    362371        CHARACTER(LEN=128) :: errmesg
     
    385394
    386395
     396            ! Dimension for the preprocessing format string
     397            ncret = nf90_def_dim(ncid, 'preproc_fmt_str_dim', PREPROC_FMT_STR_DIM, &
     398&                                preproc_fmt_str_dimid)
     399            call handle_nf90_err(ncret)
     400PRINT *, '1'
     401
     402
    387403            ncret = nf90_def_dim(ncid, 'nxmax', nxmax, nxmax_dimid)
    388404            call handle_nf90_err(ncret)
     
    418434
    419435            ! Scalar values
     436
     437
     438            dim1dids = (/preproc_fmt_str_dimid/)
     439            ncret = nf90_def_var(ncid, 'preproc_fmt_str', NF90_CHAR, &
     440&                                       dim1dids, ncvarid)
     441            call handle_nf90_err(ncret)
     442            ncret = nf90_def_var_deflate(ncid, ncvarid,   &
     443&                                        shuffle=0,     &
     444&                                        deflate=1,     &
     445&                                        deflate_level=DEF_LEVEL)
     446            call handle_nf90_err(ncret)
     447            ncret = nf90_put_var(ncid, ncvarid, PREPROC_FORMAT_VERSION_STR(1:preproc_fmt_str_dim))
     448            call handle_nf90_err(ncret)
     449
    420450
    421451
     
    604634            WRITE(iounit) cloudsh(:,:,cm_index)
    605635#endif
    606 
    607636
    608637
     
    833862
    834863
    835 
    836864            dim2dids = (/nxmax_dimid, nymax_dimid/)
    837865
     
    22112239
    22122240
     2241
     2242
     2243
     2244
     2245
    22132246#ifdef RAWBIN
    22142247            READ (iounit) temp_preproc_format_version_str
     2248#endif
     2249
     2250
     2251            ncret = nf90_inq_dimid(ncid, 'preproc_fmt_str_dim', preproc_fmt_str_dimid)
     2252            call handle_nf90_err(ncret)           
     2253            ncret = nf90_inquire_dimension(ncid, preproc_fmt_str_dimid, preproc_fmt_str_dimname, &
     2254&                                                temp_preproc_fmt_str_dim)
     2255            call handle_nf90_err(ncret)
     2256            PRINT *, 'temp_preproc_fmt_str_dim: ', temp_preproc_fmt_str_dim
     2257
     2258            ncret = nf90_inq_varid(ncid, 'preproc_fmt_str', ncvarid)
     2259            call handle_nf90_err(ncret)
     2260            ncret = nf90_get_var(ncid, ncvarid, temp_preproc_format_version_str(1:temp_preproc_fmt_str_dim))
     2261            call handle_nf90_err(ncret)
     2262
     2263
    22152264            PRINT *, 'Reading preprocessed file format version: ', &
    22162265&                    temp_preproc_format_version_str
    2217 
    22182266            IF (TRIM(temp_preproc_format_version_str) == &
    22192267&                                        TRIM(PREPROC_FORMAT_VERSION_STR)) THEN
     
    22272275                STOP
    22282276            END IF
    2229 #endif
     2277
    22302278
    22312279
     
    22472295
    22482296
    2249 PRINT *, 'GET DIMENSIONS'
     2297
    22502298            ! Get dimensions
     2299           
     2300           
     2301
     2302
    22512303            ncret = nf90_inq_dimid(ncid, 'nxmax', nxmax_dimid)
    2252             call handle_nf90_err(ncret)
    2253 PRINT *, 'GOT nxmax_dimid'           
     2304            call handle_nf90_err(ncret)           
    22542305            ncret = nf90_inquire_dimension(ncid, nxmax_dimid, nxmax_dimname, &
    22552306&                                                temp_nxmax)
     
    22572308            PRINT *, 'temp_nxmax: ', temp_nxmax
    22582309
    2259 PRINT *, 'GOT temp_nxmax'
    22602310
    22612311            ncret = nf90_inq_dimid(ncid, 'nymax', nymax_dimid)
     
    23022352
    23032353
    2304 
    2305 PRINT *, 'CHECK DIMENSIONS'
    23062354
    23072355            IF ( (temp_nxmax == nxmax) .AND. (temp_nymax == nymax) .AND. &
     
    23402388
    23412389
    2342 
    2343 
    2344 PRINT *, 'GET SCALARS'
    23452390
    23462391            ! Get the varid , then read into scalar variable
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG