Changeset b9970e3 in flexpart.git
- Timestamp:
- Dec 15, 2016, 5:28:20 PM (7 years ago)
- Branches:
- fp9.3.1-20161214-nc4
- Children:
- 929ae37
- Parents:
- 5b3cc42
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
flexpart_code/fpmetbinary_mod.F90
r5b3cc42 rb9970e3 92 92 INTEGER millisecs_start, millisecs_stop, count_rate, count_max 93 93 94 INTEGER ncretval, ncid94 INTEGER :: ncretval, ncid ! NetCDF func return value, file id 95 95 96 96 CALL SYSTEM_CLOCK(millisecs_start, count_rate, count_max) … … 109 109 110 110 111 CALL fpio(IOUNIT_DUMP, 'DUMP', cm_index)111 CALL fpio(IOUNIT_DUMP, ncid, 'DUMP', cm_index) 112 112 CLOSE(IOUNIT_DUMP) 113 113 … … 126 126 ! Should be 1 or 2 127 127 128 INTEGER :: ncretval, ncid ! NetCDF func return value, file id 129 128 130 INTEGER millisecs_start, millisecs_stop, count_rate, count_max 129 131 130 132 CALL SYSTEM_CLOCK(millisecs_start, count_rate, count_max) 133 134 print *, "Opening nc file for reading" 135 ncretval = nf90_open(filename // ".nc4", NF90_NOWRITE, ncid) 136 137 138 131 139 OPEN(IOUNIT_LOAD, file=filename, action='READ', status='OLD', form="unformatted", access="stream") 132 CALL fpio(IOUNIT_LOAD, 'LOAD', cm_index)140 CALL fpio(IOUNIT_LOAD, ncid, 'LOAD', cm_index) 133 141 CLOSE(IOUNIT_LOAD) 134 142 CALL SYSTEM_CLOCK(millisecs_stop, count_rate, count_max) … … 283 291 END SUBROUTINE fpmetbinary_zero 284 292 285 SUBROUTINE fpio(iounit, op, cm_index)293 SUBROUTINE fpio(iounit, ncid, op, cm_index) 286 294 IMPLICIT NONE 295 INTEGER, INTENT(IN) :: ncid ! NetCDF file id 287 296 INTEGER, INTENT(IN) :: iounit 288 297 CHARACTER(LEN=4), INTENT(IN) :: op ! Operation - DUMP or LOAD … … 291 300 ! Should be 1 or 2 292 301 302 303 INTEGER :: ncret ! Return value from NetCDF calls 304 INTEGER :: nxmax_dimid, nymax_dimid, nzmax_dimid, nuvzmax_dimid, nwzmax_dimid 305 306 ! These are used when loading in dimensions from NC file 307 CHARACTER(LEN=NF90_MAX_NAME) :: nxmax_dimname, nymax_dimname, nzmax_dimname, & 308 & nuvzmax_dimname, nwzmax_dimname 309 293 310 ! These are temporary variables, used in the LOAD option, for 294 311 ! comparing against the current values in FLEXPART of nxmax, nymax, ... … … 310 327 ! information to provide the structure of arrays 311 328 WRITE (iounit) nxmax, nymax, nzmax, nuvzmax, nwzmax 329 330 ncret = nf90_def_dim(ncid, 'nxmax', nxmax, nxmax_dimid) 331 ncret = nf90_def_dim(ncid, 'nymax', nymax, nymax_dimid) 332 ncret = nf90_def_dim(ncid, 'nzmax', nzmax, nzmax_dimid) 333 ncret = nf90_def_dim(ncid, 'nuvzmax', nuvzmax, nuvzmax_dimid) 334 ncret = nf90_def_dim(ncid, 'nwzmax', nwzmax, nwzmax_dimid) 335 336 337 338 312 339 313 340 ! Scalar values … … 474 501 & temp_nuvzmax, temp_nwzmax 475 502 503 ! Get dimensions 504 ncret = nf90_inq_dimid(ncid, 'nxmax', nxmax_dimid) 505 ncret = nf90_inquire_dimension(ncid, nxmax_dimid, nxmax_dimname, & 506 & temp_nxmax) 507 PRINT *, 'temp_nxmax: ', temp_nxmax 508 509 ncret = nf90_inq_dimid(ncid, 'nymax', nymax_dimid) 510 ncret = nf90_inquire_dimension(ncid, nymax_dimid, nymax_dimname, & 511 & temp_nymax) 512 PRINT *, 'temp_nymax: ', temp_nymax 513 514 ncret = nf90_inq_dimid(ncid, 'nzmax', nzmax_dimid) 515 ncret = nf90_inquire_dimension(ncid, nzmax_dimid, nzmax_dimname, & 516 & temp_nzmax) 517 PRINT *, 'temp_nzmax: ', temp_nzmax 518 519 ncret = nf90_inq_dimid(ncid, 'nuvzmax', nuvzmax_dimid) 520 ncret = nf90_inquire_dimension(ncid, nuvzmax_dimid, nuvzmax_dimname, & 521 & temp_nuvzmax) 522 PRINT *, 'temp_nuvzmax: ', temp_nuvzmax 523 524 ncret = nf90_inq_dimid(ncid, 'nwzmax', nwzmax_dimid) 525 ncret = nf90_inquire_dimension(ncid, nwzmax_dimid, nwzmax_dimname, & 526 & temp_nwzmax) 527 PRINT *, 'temp_nwzmax: ', temp_nwzmax 528 529 476 530 477 531 IF ( (temp_nxmax == nxmax) .AND. (temp_nymax == nymax) .AND. &
Note: See TracChangeset
for help on using the changeset viewer.