Changeset 493 for palm/trunk/SOURCE/data_output_3d.f90
- Timestamp:
- Mar 1, 2010 8:30:24 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/data_output_3d.f90
r392 r493 76 76 !-- Open output file. 77 77 !-- Also creates coordinate and fld-file for AVS. 78 !-- In case of a run on more than one PE, each PE opens its own file and 78 !-- For classic or 64bit NetCDF output or output of other (old) data formats, 79 !-- for a run on more than one PE, each PE opens its own file and 79 80 !-- writes the data of its subdomain in binary format (regardless of the format 80 81 !-- the user has requested). After the run, these files are combined to one 81 82 !-- file by combine_plot_fields in the format requested by the user (netcdf 82 !-- and/or avs). 83 IF ( avs_output .OR. ( numprocs > 1 ) ) CALL check_open( 30 ) 84 85 #if defined( __netcdf ) 86 IF ( myid == 0 .AND. netcdf_output ) CALL check_open( 106+av*10 ) 87 #endif 83 !-- and/or avs). 84 !-- For NetCDF4/HDF5 output, data is written in parallel into one file. 85 IF ( netcdf_output ) THEN 86 IF ( netcdf_data_format < 3 ) THEN 87 CALL check_open( 30 ) 88 IF ( myid == 0 ) CALL check_open( 106+av*10 ) 89 ELSE 90 CALL check_open( 106+av*10 ) 91 ENDIF 92 ELSE 93 IF ( avs_output .OR. ( numprocs > 1 ) ) CALL check_open( 30 ) 94 ENDIF 88 95 89 96 ! … … 94 101 !-- Update the NetCDF time axis 95 102 #if defined( __netcdf ) 96 do3d_time_count(av) = do3d_time_count(av) + 1 97 IF ( myid == 0 .AND. netcdf_output ) THEN 98 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_time_3d(av), & 99 (/ time_since_reference_point /), & 100 start = (/ do3d_time_count(av) /), & 101 count = (/ 1 /) ) 102 CALL handle_netcdf_error( 'data_output_3d', 376 ) 103 IF ( myid == 0 .OR. netcdf_data_format > 2 ) THEN 104 do3d_time_count(av) = do3d_time_count(av) + 1 105 IF ( netcdf_output ) THEN 106 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_time_3d(av), & 107 (/ time_since_reference_point /), & 108 start = (/ do3d_time_count(av) /), & 109 count = (/ 1 /) ) 110 CALL handle_netcdf_error( 'data_output_3d', 376 ) 111 ENDIF 103 112 ENDIF 104 113 #endif … … 376 385 !-- Uncompressed output. 377 386 #if defined( __parallel ) 378 IF ( netcdf_output .AND. myid == 0 ) THEN 379 WRITE ( 30 ) simulated_time, do3d_time_count(av), av 387 IF ( netcdf_output ) THEN 388 IF ( netcdf_data_format < 3 ) THEN 389 ! 390 !-- Classic or 64bit format. Data is output in parallel in FORTRAN 391 !-- binary format here, and later collected into one file by 392 !-- combine_plot_fields 393 IF ( myid == 0 ) THEN 394 WRITE ( 30 ) simulated_time, do3d_time_count(av), av 395 ENDIF 396 WRITE ( 30 ) nxl-1, nxr+1, nys-1, nyn+1, nzb, nz_do3d 397 WRITE ( 30 ) local_pf 398 399 ELSE 400 ! 401 !-- Output in NetCDF4/HDF5 format. 402 !-- Do not output redundant ghost point data except for the 403 !-- boundaries of the total domain. 404 IF ( nxr == nx .AND. nyn /= ny ) THEN 405 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 406 local_pf(nxl:nxr+1,nys:nyn,nzb:nz_do3d), & 407 start = (/ nxl+1, nys+1, nzb+1, do3d_time_count(av) /), & 408 count = (/ nxr-nxl+2, nyn-nys+1, nz_do3d-nzb+1, 1 /) ) 409 ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN 410 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 411 local_pf(nxl:nxr,nys:nyn+1,nzb:nz_do3d), & 412 start = (/ nxl+1, nys+1, nzb+1, do3d_time_count(av) /), & 413 count = (/ nxr-nxl+1, nyn-nys+2, nz_do3d-nzb+1, 1 /) ) 414 ELSEIF ( nxr == nx .AND. nyn == ny ) THEN 415 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 416 local_pf(nxl:nxr+1,nys:nyn+1,nzb:nz_do3d), & 417 start = (/ nxl+1, nys+1, nzb+1, do3d_time_count(av) /), & 418 count = (/ nxr-nxl+2, nyn-nys+2, nz_do3d-nzb+1, 1 /) ) 419 ELSE 420 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 421 local_pf(nxl:nxr,nys:nyn,nzb:nz_do3d), & 422 start = (/ nxl+1, nys+1, nzb+1, do3d_time_count(av) /), & 423 count = (/ nxr-nxl+1, nyn-nys+1, nz_do3d-nzb+1, 1 /) ) 424 ENDIF 425 CALL handle_netcdf_error( 'data_output_3d', 386 ) 426 ENDIF 380 427 ENDIF 381 WRITE ( 30 ) nxl-1, nxr+1, nys-1, nyn+1, nzb, nz_do3d382 WRITE ( 30 ) local_pf383 428 #else 384 429 IF ( avs_output ) THEN … … 387 432 #if defined( __netcdf ) 388 433 IF ( netcdf_output ) THEN 389 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 390 local_pf(nxl:nxr+1,nys:nyn+1,nzb:nz_do3d), & 391 start = (/ 1, 1, 1, do3d_time_count(av) /), & 392 count = (/ nx+2, ny+2, nz_do3d-nzb+1, 1 /) ) 393 CALL handle_netcdf_error( 'data_output_3d', 386 ) 434 435 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 436 local_pf(nxl:nxr+1,nys:nyn+1,nzb:nz_do3d), & 437 start = (/ 1, 1, 1, do3d_time_count(av) /), & 438 count = (/ nx+2, ny+2, nz_do3d-nzb+1, 1 /) ) 439 CALL handle_netcdf_error( 'data_output_3d', 446 ) 440 394 441 ENDIF 395 442 #endif
Note: See TracChangeset
for help on using the changeset viewer.