Changeset 7646 for trunk/NEMOGCM/TOOLS/SIREN/src/iom_cdf.f90
- Timestamp:
- 2017-02-06T10:25:03+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/TOOLS/SIREN/src/iom_cdf.f90
r6393 r7646 316 316 !> @author J.Paul 317 317 !> @date November, 2013 - Initial Version 318 !> @date October, 2016 319 !> - define cdf4 as cdf. 318 320 ! 319 321 !> @param[inout] td_file file structure … … 340 342 td_file%c_type='cdf' 341 343 CASE(nf90_format_netcdf4, nf90_format_netcdf4_classic) 342 td_file%c_type='cdf4' 344 !td_file%c_type='cdf4' 345 td_file%c_type='cdf' 343 346 END SELECT 344 347 … … 351 354 !> reorder dimension to ('x', 'y', 'z', 't'). 352 355 !> The dimension structure inside file structure is then completed. 353 ! 354 !> @author J.Paul 355 !> @date November, 2013 - Initial Version 356 ! 356 !> 357 !> @author J.Paul 358 !> @date November, 2013 - Initial Version 359 !> @date October, 2016 360 !> - check unknown dimension 361 !> 357 362 !> @param[inout] td_file file structure 358 363 !------------------------------------------------------------------- … … 375 380 376 381 IF( td_file%i_ndim > 0 )THEN 382 377 383 ii=1 378 384 DO ji = 1, td_file%i_ndim 379 385 ! read dimension information 380 386 tl_dim=iom_cdf_read_dim( td_file, ji) 381 IF( .NOT. dim_is_dummy(tl_dim) )THEN 387 ! sname == 'u' if dimension is unknown (not to be used) 388 IF( TRIM(tl_dim%c_sname) /= 'u' )THEN 382 389 IF( ii > ip_maxdim )THEN 383 390 CALL logger_fatal("IOM CDF OPEN: too much dimension "//& 384 & "to be read. you should remove dummy dimension using"//&391 & "to be read. you could choose dimension to be used. see "//& 385 392 & " configuration file") 386 393 ENDIF … … 395 402 & " IOM CDF GET FILE DIM: there is no unlimited dimension in file "//& 396 403 & TRIM(td_file%c_name)) 397 ELSE398 td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE.404 !ELSE 405 ! td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE. 399 406 ENDIF 400 407 … … 466 473 !> The variable structure inside file structure is then completed. 467 474 !> @note variable value are not read ! 468 ! 475 !> 469 476 !> @author J.Paul 470 477 !> @date November, 2013 - Initial Version … … 473 480 !> @date January, 2016 474 481 !> - increment n3d for 4D variable 475 ! 482 !> @date October, 2016 483 !> - check if variable to be used (variable's dimension allowed and variable 484 !> not "dummy") 485 !> 476 486 !> @param[inout] td_file file structure 477 487 !------------------------------------------------------------------- … … 501 511 il_nvar=td_file%i_nvar 502 512 ALLOCATE(tl_var(il_nvar)) 503 ii=0504 513 DO ji = 1, il_nvar 505 514 ! read variable information 506 515 tl_var(ji)=iom_cdf__read_var_meta( td_file, ji) 507 IF( .NOT. var_is_dummy(tl_var(ji)) )THEN508 ii=ii+1509 ENDIF510 516 ENDDO 511 517 512 518 ! update number of variable used 513 td_file%i_nvar= ii519 td_file%i_nvar=COUNT(tl_var(:)%l_use) 514 520 515 521 ALLOCATE(td_file%t_var(td_file%i_nvar)) … … 517 523 ii=0 518 524 DO ji = 1, il_nvar 519 IF( .NOT. var_is_dummy(tl_var(ji)))THEN525 IF( tl_var(ji)%l_use )THEN 520 526 ii=ii+1 521 527 td_file%t_var(ii)=var_copy(tl_var(ji)) … … 552 558 td_file%i_timeid=ji 553 559 ELSE 560 IF( td_file%i_timeid /= ji )THEN 561 CALL logger_warn("IOM CDF GET FILE VAR: find more "//& 562 & "than one time variable in file "//& 563 & TRIM(td_file%c_name)//". see "//& 564 & "dummy.cfg configuration file to"//& 565 & " not used dummy variables.") 566 ENDIF 554 567 il_attid=0 555 568 IF( ASSOCIATED(td_file%t_var(ii)%t_att) )THEN … … 558 571 IF( il_attid /= 0 )THEN 559 572 td_file%i_timeid=ji 560 !ELSE561 ! CALL logger_error("IOM CDF GET FILE VAR: find more "//&562 ! & "than one time variable in file "//&563 ! & TRIM(td_file%c_name) )564 573 ENDIF 565 574 ENDIF … … 652 661 & " IOM CDF READ DIM: no id associated to file "//TRIM(td_file%c_name)) 653 662 654 ELSE 663 ELSE 655 664 656 665 CALL logger_trace( & … … 1413 1422 ENDDO 1414 1423 1424 !! check if variable is dummy 1425 IF( var_is_dummy(iom_cdf__read_var_meta) )THEN 1426 iom_cdf__read_var_meta%l_use=.FALSE. 1427 ENDIF 1428 1429 !! check if all dimensions are allowed 1430 DO ji=1,il_ndim 1431 IF( ALL(td_file%t_dim(:)%i_id /= il_dimid(ji)) )THEN 1432 iom_cdf__read_var_meta%l_use=.FALSE. 1433 ENDIF 1434 ENDDO 1435 1415 1436 ! clean 1416 1437 CALL dim_clean(tl_dim(:)) … … 1484 1505 ELSE IF( id_ndim > 0 )THEN 1485 1506 1486 1487 1507 ii=1 1488 1508 DO ji = 1, id_ndim 1489 1509 1490 ! !! check no dummy dimension to be used1510 ! check if dimension to be used, is allowed 1491 1511 IF( ANY(td_file%t_dim(:)%i_id == id_dimid(ji)) )THEN 1492 1512 IF( ii > ip_maxdim )THEN … … 1500 1520 1501 1521 il_xyzt2(ii)=td_file%t_dim(id_dimid(ji))%i_xyzt2 1502 1522 1503 1523 ! read dimension information 1504 1524 tl_dim(ii) = dim_init( td_file%t_dim(il_xyzt2(ii))%c_name, & 1505 1525 & td_file%t_dim(il_xyzt2(ii))%i_len ) 1506 1526 1507 1527 ii=ii+1 1508 1528 ELSE … … 2080 2100 & 'gcost','gcosu','gcosv','gcosf', & 2081 2101 & 'gsint','gsinu','gsinv','gsinf', & 2082 & 'mbathy','misf','isf_draft', &2102 & 'mbathy','misf','isf_draft','isfdraft', & 2083 2103 & 'hbatt','hbatu','hbatv','hbatf', & 2084 2104 & 'gsigt','gsigu','gsigv','gsigf', & … … 2189 2209 CALL iom_cdf__check(il_status,"IOM CDF WRITE VAR DEF: ") 2190 2210 ENDIF 2211 CALL logger_debug("IOM CDF WRITE VAR DEF: type = "//TRIM(fct_str(tl_var%i_type))) 2191 2212 2192 2213 ! remove unuseful attribute
Note: See TracChangeset
for help on using the changeset viewer.