[1] | 1 | SUBROUTINE data_output_3d( av ) |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
[254] | 4 | ! Current revisions: |
---|
[1] | 5 | ! ----------------- |
---|
[791] | 6 | ! |
---|
[674] | 7 | ! |
---|
[392] | 8 | ! Former revisions: |
---|
| 9 | ! ----------------- |
---|
| 10 | ! $Id: data_output_3d.f90 791 2011-11-29 03:33:42Z raasch $ |
---|
| 11 | ! |
---|
[791] | 12 | ! 790 2011-11-29 03:11:20Z raasch |
---|
| 13 | ! bugfix: calculation of 'pr' must depend on the particle weighting factor, |
---|
| 14 | ! nzt+1 replaced by nz_do3d for 'pr' |
---|
| 15 | ! |
---|
[772] | 16 | ! 771 2011-10-27 10:56:21Z heinze |
---|
| 17 | ! +lpt |
---|
| 18 | ! |
---|
[760] | 19 | ! 759 2011-09-15 13:58:31Z raasch |
---|
| 20 | ! Splitting of parallel I/O |
---|
| 21 | ! |
---|
[728] | 22 | ! 727 2011-04-20 20:05:25Z suehring |
---|
| 23 | ! Exchange ghost layers also for p_av. |
---|
| 24 | ! |
---|
[726] | 25 | ! 725 2011-04-11 09:37:01Z suehring |
---|
| 26 | ! Exchange ghost layers for p regardless of used pressure solver (except SOR). |
---|
| 27 | ! |
---|
[692] | 28 | ! 691 2011-03-04 08:45:30Z maronga |
---|
| 29 | ! Replaced simulated_time by time_since_reference_point |
---|
| 30 | ! |
---|
[674] | 31 | ! 673 2011-01-18 16:19:48Z suehring |
---|
| 32 | ! When using Multigrid or SOR solver an additional CALL exchange_horiz is |
---|
| 33 | ! is needed for pressure output. |
---|
| 34 | ! |
---|
[668] | 35 | ! 667 2010-12-23 12:06:00Z suehring/gryschka |
---|
| 36 | ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng in loops and |
---|
| 37 | ! allocation of arrays. Calls of exchange_horiz are modified. |
---|
| 38 | ! Skip-value skip_do_avs changed to a dynamic adaption of ghost points. |
---|
| 39 | ! |
---|
[647] | 40 | ! 646 2010-12-15 13:03:52Z raasch |
---|
| 41 | ! bugfix: missing define statements for netcdf added |
---|
| 42 | ! |
---|
[494] | 43 | ! 493 2010-03-01 08:30:24Z raasch |
---|
| 44 | ! NetCDF4 support (parallel output) |
---|
| 45 | ! |
---|
[392] | 46 | ! 355 2009-07-17 01:03:01Z letzel |
---|
[291] | 47 | ! simulated_time in NetCDF output replaced by time_since_reference_point. |
---|
[263] | 48 | ! Output of NetCDF messages with aid of message handling routine. |
---|
[254] | 49 | ! Output of messages replaced by message handling routine. |
---|
[355] | 50 | ! Bugfix: to_be_resorted => s_av for time-averaged scalars |
---|
[1] | 51 | ! |
---|
[98] | 52 | ! 96 2007-06-04 08:07:41Z raasch |
---|
| 53 | ! Output of density and salinity |
---|
| 54 | ! |
---|
[77] | 55 | ! 75 2007-03-22 09:54:05Z raasch |
---|
| 56 | ! 2nd+3rd argument removed from exchange horiz |
---|
| 57 | ! |
---|
[3] | 58 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 59 | ! |
---|
[1] | 60 | ! Revision 1.3 2006/06/02 15:18:59 raasch |
---|
| 61 | ! +argument "found", -argument grid in call of routine user_data_output_3d |
---|
| 62 | ! |
---|
| 63 | ! Revision 1.2 2006/02/23 10:23:07 raasch |
---|
| 64 | ! Former subroutine plot_3d renamed data_output_3d, pl.. renamed do.., |
---|
| 65 | ! .._anz renamed .._n, |
---|
| 66 | ! output extended to (almost) all quantities, output of user-defined quantities |
---|
| 67 | ! |
---|
| 68 | ! Revision 1.1 1997/09/03 06:29:36 raasch |
---|
| 69 | ! Initial revision |
---|
| 70 | ! |
---|
| 71 | ! |
---|
| 72 | ! Description: |
---|
| 73 | ! ------------ |
---|
| 74 | ! Output of the 3D-arrays in NetCDF and/or AVS format. |
---|
| 75 | !------------------------------------------------------------------------------! |
---|
| 76 | |
---|
| 77 | USE array_kind |
---|
| 78 | USE arrays_3d |
---|
| 79 | USE averaging |
---|
| 80 | USE cloud_parameters |
---|
| 81 | USE control_parameters |
---|
| 82 | USE cpulog |
---|
| 83 | USE indices |
---|
| 84 | USE interfaces |
---|
| 85 | USE netcdf_control |
---|
| 86 | USE particle_attributes |
---|
| 87 | USE pegrid |
---|
| 88 | |
---|
| 89 | IMPLICIT NONE |
---|
| 90 | |
---|
| 91 | CHARACTER (LEN=9) :: simulated_time_mod |
---|
| 92 | |
---|
[559] | 93 | INTEGER :: av, i, if, j, k, n, pos, prec, psi |
---|
[1] | 94 | |
---|
| 95 | LOGICAL :: found, resorted |
---|
| 96 | |
---|
| 97 | REAL :: mean_r, s_r3, s_r4 |
---|
| 98 | |
---|
| 99 | REAL(spk), DIMENSION(:,:,:), ALLOCATABLE :: local_pf |
---|
| 100 | |
---|
| 101 | REAL, DIMENSION(:,:,:), POINTER :: to_be_resorted |
---|
| 102 | |
---|
| 103 | ! |
---|
| 104 | !-- Return, if nothing to output |
---|
| 105 | IF ( do3d_no(av) == 0 ) RETURN |
---|
| 106 | |
---|
| 107 | CALL cpu_log (log_point(14),'data_output_3d','start') |
---|
| 108 | |
---|
| 109 | ! |
---|
| 110 | !-- Open output file. |
---|
| 111 | !-- Also creates coordinate and fld-file for AVS. |
---|
[493] | 112 | !-- For classic or 64bit NetCDF output or output of other (old) data formats, |
---|
| 113 | !-- for a run on more than one PE, each PE opens its own file and |
---|
[1] | 114 | !-- writes the data of its subdomain in binary format (regardless of the format |
---|
| 115 | !-- the user has requested). After the run, these files are combined to one |
---|
| 116 | !-- file by combine_plot_fields in the format requested by the user (netcdf |
---|
[493] | 117 | !-- and/or avs). |
---|
| 118 | !-- For NetCDF4/HDF5 output, data is written in parallel into one file. |
---|
| 119 | IF ( netcdf_output ) THEN |
---|
| 120 | IF ( netcdf_data_format < 3 ) THEN |
---|
| 121 | CALL check_open( 30 ) |
---|
| 122 | IF ( myid == 0 ) CALL check_open( 106+av*10 ) |
---|
| 123 | ELSE |
---|
| 124 | CALL check_open( 106+av*10 ) |
---|
| 125 | ENDIF |
---|
| 126 | ELSE |
---|
| 127 | IF ( avs_output .OR. ( numprocs > 1 ) ) CALL check_open( 30 ) |
---|
| 128 | ENDIF |
---|
[1] | 129 | |
---|
| 130 | ! |
---|
| 131 | !-- Allocate a temporary array with the desired output dimensions. |
---|
[667] | 132 | ALLOCATE( local_pf(nxlg:nxrg,nysg:nyng,nzb:nz_do3d) ) |
---|
[1] | 133 | |
---|
| 134 | ! |
---|
| 135 | !-- Update the NetCDF time axis |
---|
| 136 | #if defined( __netcdf ) |
---|
[493] | 137 | IF ( myid == 0 .OR. netcdf_data_format > 2 ) THEN |
---|
| 138 | do3d_time_count(av) = do3d_time_count(av) + 1 |
---|
| 139 | IF ( netcdf_output ) THEN |
---|
| 140 | nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_time_3d(av), & |
---|
| 141 | (/ time_since_reference_point /), & |
---|
| 142 | start = (/ do3d_time_count(av) /), & |
---|
| 143 | count = (/ 1 /) ) |
---|
| 144 | CALL handle_netcdf_error( 'data_output_3d', 376 ) |
---|
| 145 | ENDIF |
---|
[1] | 146 | ENDIF |
---|
| 147 | #endif |
---|
| 148 | |
---|
| 149 | ! |
---|
| 150 | !-- Loop over all variables to be written. |
---|
| 151 | if = 1 |
---|
| 152 | |
---|
| 153 | DO WHILE ( do3d(av,if)(1:1) /= ' ' ) |
---|
| 154 | ! |
---|
| 155 | !-- Set the precision for data compression. |
---|
| 156 | IF ( do3d_compress ) THEN |
---|
| 157 | DO i = 1, 100 |
---|
| 158 | IF ( plot_3d_precision(i)%variable == do3d(av,if) ) THEN |
---|
| 159 | prec = plot_3d_precision(i)%precision |
---|
| 160 | EXIT |
---|
| 161 | ENDIF |
---|
| 162 | ENDDO |
---|
| 163 | ENDIF |
---|
| 164 | |
---|
| 165 | ! |
---|
| 166 | !-- Store the array chosen on the temporary array. |
---|
| 167 | resorted = .FALSE. |
---|
| 168 | SELECT CASE ( TRIM( do3d(av,if) ) ) |
---|
| 169 | |
---|
| 170 | CASE ( 'e' ) |
---|
| 171 | IF ( av == 0 ) THEN |
---|
| 172 | to_be_resorted => e |
---|
| 173 | ELSE |
---|
| 174 | to_be_resorted => e_av |
---|
| 175 | ENDIF |
---|
| 176 | |
---|
[771] | 177 | CASE ( 'lpt' ) |
---|
| 178 | IF ( av == 0 ) THEN |
---|
| 179 | to_be_resorted => pt |
---|
| 180 | ELSE |
---|
| 181 | to_be_resorted => lpt_av |
---|
| 182 | ENDIF |
---|
| 183 | |
---|
[1] | 184 | CASE ( 'p' ) |
---|
| 185 | IF ( av == 0 ) THEN |
---|
[727] | 186 | IF ( psolver /= 'sor' ) CALL exchange_horiz( p, nbgp ) |
---|
[1] | 187 | to_be_resorted => p |
---|
| 188 | ELSE |
---|
[727] | 189 | IF ( psolver /= 'sor' ) CALL exchange_horiz( p_av, nbgp ) |
---|
[1] | 190 | to_be_resorted => p_av |
---|
| 191 | ENDIF |
---|
| 192 | |
---|
| 193 | CASE ( 'pc' ) ! particle concentration (requires ghostpoint exchange) |
---|
| 194 | IF ( av == 0 ) THEN |
---|
| 195 | tend = prt_count |
---|
[667] | 196 | CALL exchange_horiz( tend, nbgp ) |
---|
| 197 | DO i = nxlg, nxrg |
---|
| 198 | DO j = nysg, nyng |
---|
[1] | 199 | DO k = nzb, nz_do3d |
---|
| 200 | local_pf(i,j,k) = tend(k,j,i) |
---|
| 201 | ENDDO |
---|
| 202 | ENDDO |
---|
| 203 | ENDDO |
---|
| 204 | resorted = .TRUE. |
---|
| 205 | ELSE |
---|
[667] | 206 | CALL exchange_horiz( pc_av, nbgp ) |
---|
[1] | 207 | to_be_resorted => pc_av |
---|
| 208 | ENDIF |
---|
| 209 | |
---|
| 210 | CASE ( 'pr' ) ! mean particle radius |
---|
| 211 | IF ( av == 0 ) THEN |
---|
| 212 | DO i = nxl, nxr |
---|
| 213 | DO j = nys, nyn |
---|
[790] | 214 | DO k = nzb, nz_do3d |
---|
[1] | 215 | psi = prt_start_index(k,j,i) |
---|
| 216 | s_r3 = 0.0 |
---|
| 217 | s_r4 = 0.0 |
---|
| 218 | DO n = psi, psi+prt_count(k,j,i)-1 |
---|
[790] | 219 | s_r3 = s_r3 + particles(n)%radius**3 * & |
---|
| 220 | particles(n)%weight_factor |
---|
| 221 | s_r4 = s_r4 + particles(n)%radius**4 * & |
---|
| 222 | particles(n)%weight_factor |
---|
[1] | 223 | ENDDO |
---|
| 224 | IF ( s_r3 /= 0.0 ) THEN |
---|
| 225 | mean_r = s_r4 / s_r3 |
---|
| 226 | ELSE |
---|
| 227 | mean_r = 0.0 |
---|
| 228 | ENDIF |
---|
| 229 | tend(k,j,i) = mean_r |
---|
| 230 | ENDDO |
---|
| 231 | ENDDO |
---|
| 232 | ENDDO |
---|
[667] | 233 | CALL exchange_horiz( tend, nbgp ) |
---|
| 234 | DO i = nxlg, nxrg |
---|
| 235 | DO j = nysg, nyng |
---|
[790] | 236 | DO k = nzb, nz_do3d |
---|
[1] | 237 | local_pf(i,j,k) = tend(k,j,i) |
---|
| 238 | ENDDO |
---|
| 239 | ENDDO |
---|
| 240 | ENDDO |
---|
| 241 | resorted = .TRUE. |
---|
| 242 | ELSE |
---|
[667] | 243 | CALL exchange_horiz( pr_av, nbgp ) |
---|
[1] | 244 | to_be_resorted => pr_av |
---|
| 245 | ENDIF |
---|
| 246 | |
---|
| 247 | CASE ( 'pt' ) |
---|
| 248 | IF ( av == 0 ) THEN |
---|
| 249 | IF ( .NOT. cloud_physics ) THEN |
---|
| 250 | to_be_resorted => pt |
---|
| 251 | ELSE |
---|
[667] | 252 | DO i = nxlg, nxrg |
---|
| 253 | DO j = nysg, nyng |
---|
[1] | 254 | DO k = nzb, nz_do3d |
---|
| 255 | local_pf(i,j,k) = pt(k,j,i) + l_d_cp * & |
---|
| 256 | pt_d_t(k) * & |
---|
| 257 | ql(k,j,i) |
---|
| 258 | ENDDO |
---|
| 259 | ENDDO |
---|
| 260 | ENDDO |
---|
| 261 | resorted = .TRUE. |
---|
| 262 | ENDIF |
---|
| 263 | ELSE |
---|
| 264 | to_be_resorted => pt_av |
---|
| 265 | ENDIF |
---|
| 266 | |
---|
| 267 | CASE ( 'q' ) |
---|
| 268 | IF ( av == 0 ) THEN |
---|
| 269 | to_be_resorted => q |
---|
| 270 | ELSE |
---|
| 271 | to_be_resorted => q_av |
---|
| 272 | ENDIF |
---|
[691] | 273 | |
---|
[1] | 274 | CASE ( 'ql' ) |
---|
| 275 | IF ( av == 0 ) THEN |
---|
| 276 | to_be_resorted => ql |
---|
| 277 | ELSE |
---|
| 278 | to_be_resorted => ql_av |
---|
| 279 | ENDIF |
---|
| 280 | |
---|
| 281 | CASE ( 'ql_c' ) |
---|
| 282 | IF ( av == 0 ) THEN |
---|
| 283 | to_be_resorted => ql_c |
---|
| 284 | ELSE |
---|
| 285 | to_be_resorted => ql_c_av |
---|
| 286 | ENDIF |
---|
| 287 | |
---|
| 288 | CASE ( 'ql_v' ) |
---|
| 289 | IF ( av == 0 ) THEN |
---|
| 290 | to_be_resorted => ql_v |
---|
| 291 | ELSE |
---|
| 292 | to_be_resorted => ql_v_av |
---|
| 293 | ENDIF |
---|
| 294 | |
---|
| 295 | CASE ( 'ql_vp' ) |
---|
| 296 | IF ( av == 0 ) THEN |
---|
| 297 | to_be_resorted => ql_vp |
---|
| 298 | ELSE |
---|
| 299 | to_be_resorted => ql_vp_av |
---|
| 300 | ENDIF |
---|
| 301 | |
---|
| 302 | CASE ( 'qv' ) |
---|
| 303 | IF ( av == 0 ) THEN |
---|
[667] | 304 | DO i = nxlg, nxrg |
---|
| 305 | DO j = nysg, nyng |
---|
[1] | 306 | DO k = nzb, nz_do3d |
---|
| 307 | local_pf(i,j,k) = q(k,j,i) - ql(k,j,i) |
---|
| 308 | ENDDO |
---|
| 309 | ENDDO |
---|
| 310 | ENDDO |
---|
| 311 | resorted = .TRUE. |
---|
| 312 | ELSE |
---|
| 313 | to_be_resorted => qv_av |
---|
| 314 | ENDIF |
---|
| 315 | |
---|
[96] | 316 | CASE ( 'rho' ) |
---|
| 317 | IF ( av == 0 ) THEN |
---|
| 318 | to_be_resorted => rho |
---|
| 319 | ELSE |
---|
| 320 | to_be_resorted => rho_av |
---|
| 321 | ENDIF |
---|
[691] | 322 | |
---|
[1] | 323 | CASE ( 's' ) |
---|
| 324 | IF ( av == 0 ) THEN |
---|
| 325 | to_be_resorted => q |
---|
| 326 | ELSE |
---|
[355] | 327 | to_be_resorted => s_av |
---|
[1] | 328 | ENDIF |
---|
[691] | 329 | |
---|
[96] | 330 | CASE ( 'sa' ) |
---|
| 331 | IF ( av == 0 ) THEN |
---|
| 332 | to_be_resorted => sa |
---|
| 333 | ELSE |
---|
| 334 | to_be_resorted => sa_av |
---|
| 335 | ENDIF |
---|
[691] | 336 | |
---|
[1] | 337 | CASE ( 'u' ) |
---|
| 338 | IF ( av == 0 ) THEN |
---|
| 339 | to_be_resorted => u |
---|
| 340 | ELSE |
---|
| 341 | to_be_resorted => u_av |
---|
| 342 | ENDIF |
---|
| 343 | |
---|
| 344 | CASE ( 'v' ) |
---|
| 345 | IF ( av == 0 ) THEN |
---|
| 346 | to_be_resorted => v |
---|
| 347 | ELSE |
---|
| 348 | to_be_resorted => v_av |
---|
| 349 | ENDIF |
---|
| 350 | |
---|
| 351 | CASE ( 'vpt' ) |
---|
| 352 | IF ( av == 0 ) THEN |
---|
| 353 | to_be_resorted => vpt |
---|
| 354 | ELSE |
---|
| 355 | to_be_resorted => vpt_av |
---|
| 356 | ENDIF |
---|
| 357 | |
---|
| 358 | CASE ( 'w' ) |
---|
| 359 | IF ( av == 0 ) THEN |
---|
| 360 | to_be_resorted => w |
---|
| 361 | ELSE |
---|
| 362 | to_be_resorted => w_av |
---|
| 363 | ENDIF |
---|
| 364 | |
---|
| 365 | CASE DEFAULT |
---|
| 366 | ! |
---|
| 367 | !-- User defined quantity |
---|
| 368 | CALL user_data_output_3d( av, do3d(av,if), found, local_pf, & |
---|
| 369 | nz_do3d ) |
---|
| 370 | resorted = .TRUE. |
---|
| 371 | |
---|
[254] | 372 | IF ( .NOT. found ) THEN |
---|
[274] | 373 | message_string = 'no output available for: ' // & |
---|
| 374 | TRIM( do3d(av,if) ) |
---|
[254] | 375 | CALL message( 'data_output_3d', 'PA0182', 0, 0, 0, 6, 0 ) |
---|
[1] | 376 | ENDIF |
---|
| 377 | |
---|
| 378 | END SELECT |
---|
| 379 | |
---|
| 380 | ! |
---|
| 381 | !-- Resort the array to be output, if not done above |
---|
| 382 | IF ( .NOT. resorted ) THEN |
---|
[667] | 383 | DO i = nxlg, nxrg |
---|
| 384 | DO j = nysg, nyng |
---|
[1] | 385 | DO k = nzb, nz_do3d |
---|
| 386 | local_pf(i,j,k) = to_be_resorted(k,j,i) |
---|
| 387 | ENDDO |
---|
| 388 | ENDDO |
---|
| 389 | ENDDO |
---|
| 390 | ENDIF |
---|
| 391 | |
---|
| 392 | ! |
---|
| 393 | !-- Output of the volume data information for the AVS-FLD-file. |
---|
| 394 | do3d_avs_n = do3d_avs_n + 1 |
---|
| 395 | IF ( myid == 0 .AND. avs_output ) THEN |
---|
| 396 | ! |
---|
| 397 | !-- AVS-labels must not contain any colons. Hence they must be removed |
---|
| 398 | !-- from the time character string. |
---|
| 399 | simulated_time_mod = simulated_time_chr |
---|
| 400 | DO WHILE ( SCAN( simulated_time_mod, ':' ) /= 0 ) |
---|
| 401 | pos = SCAN( simulated_time_mod, ':' ) |
---|
| 402 | simulated_time_mod(pos:pos) = '/' |
---|
| 403 | ENDDO |
---|
| 404 | |
---|
| 405 | IF ( av == 0 ) THEN |
---|
| 406 | WRITE ( 33, 3300 ) do3d_avs_n, TRIM( avs_data_file ), & |
---|
| 407 | skip_do_avs, TRIM( do3d(av,if) ), & |
---|
| 408 | TRIM( simulated_time_mod ) |
---|
| 409 | ELSE |
---|
| 410 | WRITE ( 33, 3300 ) do3d_avs_n, TRIM( avs_data_file ), & |
---|
| 411 | skip_do_avs, TRIM( do3d(av,if) ) // & |
---|
| 412 | ' averaged', TRIM( simulated_time_mod ) |
---|
| 413 | ENDIF |
---|
| 414 | ! |
---|
| 415 | !-- Determine the Skip-value for the next array. Record end and start |
---|
| 416 | !-- require 4 byte each. |
---|
[759] | 417 | skip_do_avs = skip_do_avs + ( ( ( nx+2*nbgp ) * ( ny+2*nbgp ) * & |
---|
| 418 | ( nz_do3d+1 ) ) * 4 + 8 ) |
---|
[1] | 419 | ENDIF |
---|
| 420 | |
---|
| 421 | ! |
---|
| 422 | !-- Output of the 3D-array. (compressed/uncompressed) |
---|
| 423 | IF ( do3d_compress ) THEN |
---|
| 424 | ! |
---|
| 425 | !-- Compression, output of compression information on FLD-file and output |
---|
| 426 | !-- of compressed data. |
---|
[559] | 427 | CALL write_compressed( local_pf, 30, 33, myid, nxl, nxr, nyn, nys, & |
---|
[667] | 428 | nzb, nz_do3d, prec, nbgp ) |
---|
[1] | 429 | ELSE |
---|
| 430 | ! |
---|
| 431 | !-- Uncompressed output. |
---|
| 432 | #if defined( __parallel ) |
---|
[493] | 433 | IF ( netcdf_output ) THEN |
---|
| 434 | IF ( netcdf_data_format < 3 ) THEN |
---|
| 435 | ! |
---|
| 436 | !-- Classic or 64bit format. Data is output in parallel in FORTRAN |
---|
| 437 | !-- binary format here, and later collected into one file by |
---|
| 438 | !-- combine_plot_fields |
---|
| 439 | IF ( myid == 0 ) THEN |
---|
[691] | 440 | WRITE ( 30 ) time_since_reference_point, & |
---|
| 441 | do3d_time_count(av), av |
---|
[493] | 442 | ENDIF |
---|
[759] | 443 | DO i = 0, io_blocks-1 |
---|
| 444 | IF ( i == io_group ) THEN |
---|
| 445 | WRITE ( 30 ) nxlg, nxrg, nysg, nyng, nzb, nz_do3d |
---|
| 446 | WRITE ( 30 ) local_pf |
---|
| 447 | ENDIF |
---|
| 448 | #if defined( __parallel ) |
---|
| 449 | CALL MPI_BARRIER( comm2d, ierr ) |
---|
| 450 | #endif |
---|
| 451 | ENDDO |
---|
[559] | 452 | |
---|
[493] | 453 | ELSE |
---|
[646] | 454 | #if defined( __netcdf ) |
---|
[493] | 455 | ! |
---|
| 456 | !-- Output in NetCDF4/HDF5 format. |
---|
| 457 | !-- Do not output redundant ghost point data except for the |
---|
| 458 | !-- boundaries of the total domain. |
---|
| 459 | IF ( nxr == nx .AND. nyn /= ny ) THEN |
---|
| 460 | nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & |
---|
[667] | 461 | local_pf(nxl:nxrg,nys:nyn,nzb:nz_do3d), & |
---|
[493] | 462 | start = (/ nxl+1, nys+1, nzb+1, do3d_time_count(av) /), & |
---|
[667] | 463 | count = (/ nxr-nxl+1+nbgp, nyn-nys+1, nz_do3d-nzb+1, 1 /) ) |
---|
[493] | 464 | ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN |
---|
| 465 | nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & |
---|
[667] | 466 | local_pf(nxl:nxr,nys:nyng,nzb:nz_do3d), & |
---|
[493] | 467 | start = (/ nxl+1, nys+1, nzb+1, do3d_time_count(av) /), & |
---|
[667] | 468 | count = (/ nxr-nxl+1, nyn-nys+1+nbgp, nz_do3d-nzb+1, 1 /) ) |
---|
[493] | 469 | ELSEIF ( nxr == nx .AND. nyn == ny ) THEN |
---|
| 470 | nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & |
---|
[667] | 471 | local_pf(nxl:nxrg,nys:nyng,nzb:nz_do3d), & |
---|
[493] | 472 | start = (/ nxl+1, nys+1, nzb+1, do3d_time_count(av) /), & |
---|
[667] | 473 | count = (/ nxr-nxl+1+nbgp, nyn-nys+1+nbgp, nz_do3d-nzb+1, 1 /) ) |
---|
[493] | 474 | ELSE |
---|
| 475 | nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & |
---|
| 476 | local_pf(nxl:nxr,nys:nyn,nzb:nz_do3d), & |
---|
| 477 | start = (/ nxl+1, nys+1, nzb+1, do3d_time_count(av) /), & |
---|
| 478 | count = (/ nxr-nxl+1, nyn-nys+1, nz_do3d-nzb+1, 1 /) ) |
---|
| 479 | ENDIF |
---|
| 480 | CALL handle_netcdf_error( 'data_output_3d', 386 ) |
---|
[646] | 481 | #endif |
---|
[493] | 482 | ENDIF |
---|
[1] | 483 | ENDIF |
---|
| 484 | #else |
---|
| 485 | IF ( avs_output ) THEN |
---|
| 486 | WRITE ( 30 ) local_pf(nxl:nxr+1,nys:nyn+1,:) |
---|
| 487 | ENDIF |
---|
| 488 | #if defined( __netcdf ) |
---|
| 489 | IF ( netcdf_output ) THEN |
---|
[493] | 490 | |
---|
| 491 | nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & |
---|
| 492 | local_pf(nxl:nxr+1,nys:nyn+1,nzb:nz_do3d), & |
---|
| 493 | start = (/ 1, 1, 1, do3d_time_count(av) /), & |
---|
| 494 | count = (/ nx+2, ny+2, nz_do3d-nzb+1, 1 /) ) |
---|
| 495 | CALL handle_netcdf_error( 'data_output_3d', 446 ) |
---|
| 496 | |
---|
[1] | 497 | ENDIF |
---|
| 498 | #endif |
---|
| 499 | #endif |
---|
| 500 | ENDIF |
---|
| 501 | |
---|
| 502 | if = if + 1 |
---|
| 503 | |
---|
| 504 | ENDDO |
---|
| 505 | |
---|
| 506 | ! |
---|
| 507 | !-- Deallocate temporary array. |
---|
| 508 | DEALLOCATE( local_pf ) |
---|
| 509 | |
---|
| 510 | |
---|
| 511 | CALL cpu_log (log_point(14),'data_output_3d','stop','nobarrier') |
---|
| 512 | |
---|
| 513 | ! |
---|
| 514 | !-- Formats. |
---|
| 515 | 3300 FORMAT ('variable ',I4,' file=',A,' filetype=unformatted skip=',I12/ & |
---|
| 516 | 'label = ',A,A) |
---|
| 517 | |
---|
| 518 | END SUBROUTINE data_output_3d |
---|