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