- Timestamp:
- Apr 27, 2018 12:33:25 PM (7 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/average_3d_data.f90
r2817 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Further allocation checks implemented, case z0q* added 28 ! 29 ! 2885 2018-03-14 11:02:46Z Giersch 27 30 ! Preliminary gust module interface implemented 28 31 ! … … 201 204 202 205 CASE ( 'e' ) 203 DO i = nxlg, nxrg 204 DO j = nysg, nyng 205 DO k = nzb, nzt+1 206 e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 207 ENDDO 208 ENDDO 209 ENDDO 206 IF ( ALLOCATED( e_av ) ) THEN 207 DO i = nxlg, nxrg 208 DO j = nysg, nyng 209 DO k = nzb, nzt+1 210 e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 211 ENDDO 212 ENDDO 213 ENDDO 214 ENDIF 210 215 211 216 CASE ( 'ghf*' ) 212 DO i = nxl, nxr 213 DO j = nys, nyn 214 ghf_av(j,i) = ghf_av(j,i) & 215 / REAL( average_count_3d, KIND=wp ) 216 ENDDO 217 ENDDO 218 CALL exchange_horiz_2d( ghf_av, nbgp ) 217 IF ( ALLOCATED( ghf_av ) ) THEN 218 DO i = nxl, nxr 219 DO j = nys, nyn 220 ghf_av(j,i) = ghf_av(j,i) & 221 / REAL( average_count_3d, KIND=wp ) 222 ENDDO 223 ENDDO 224 CALL exchange_horiz_2d( ghf_av, nbgp ) 225 ENDIF 219 226 220 227 CASE ( 'qsws*' ) 221 DO i = nxlg, nxrg 222 DO j = nysg, nyng 223 qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d, KIND=wp ) 224 ENDDO 225 ENDDO 226 CALL exchange_horiz_2d( qsws_av, nbgp ) 228 IF ( ALLOCATED( qsws_av ) ) THEN 229 DO i = nxlg, nxrg 230 DO j = nysg, nyng 231 qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d, KIND=wp ) 232 ENDDO 233 ENDDO 234 CALL exchange_horiz_2d( qsws_av, nbgp ) 235 ENDIF 227 236 228 237 CASE ( 'lpt' ) 229 DO i = nxlg, nxrg 230 DO j = nysg, nyng 231 DO k = nzb, nzt+1 232 lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 233 ENDDO 234 ENDDO 235 ENDDO 238 IF ( ALLOCATED( lpt_av ) ) THEN 239 DO i = nxlg, nxrg 240 DO j = nysg, nyng 241 DO k = nzb, nzt+1 242 lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 243 ENDDO 244 ENDDO 245 ENDDO 246 ENDIF 236 247 237 248 CASE ( 'lwp*' ) 238 DO i = nxlg, nxrg 239 DO j = nysg, nyng 240 lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d, KIND=wp ) 241 ENDDO 242 ENDDO 249 IF ( ALLOCATED( lwp_av ) ) THEN 250 DO i = nxlg, nxrg 251 DO j = nysg, nyng 252 lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d, KIND=wp ) 253 ENDDO 254 ENDDO 255 ENDIF 243 256 244 257 CASE ( 'nc' ) 245 DO i = nxlg, nxrg 246 DO j = nysg, nyng 247 DO k = nzb, nzt+1 248 nc_av(k,j,i) = nc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 249 ENDDO 250 ENDDO 251 ENDDO 258 IF ( ALLOCATED( nc_av ) ) THEN 259 DO i = nxlg, nxrg 260 DO j = nysg, nyng 261 DO k = nzb, nzt+1 262 nc_av(k,j,i) = nc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 263 ENDDO 264 ENDDO 265 ENDDO 266 ENDIF 252 267 253 268 CASE ( 'nr' ) 254 DO i = nxlg, nxrg 255 DO j = nysg, nyng 256 DO k = nzb, nzt+1 257 nr_av(k,j,i) = nr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 258 ENDDO 259 ENDDO 260 ENDDO 269 IF ( ALLOCATED( nr_av ) ) THEN 270 DO i = nxlg, nxrg 271 DO j = nysg, nyng 272 DO k = nzb, nzt+1 273 nr_av(k,j,i) = nr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 274 ENDDO 275 ENDDO 276 ENDDO 277 ENDIF 261 278 262 279 CASE ( 'ol*' ) 263 DO i = nxlg, nxrg 264 DO j = nysg, nyng 265 ol_av(j,i) = ol_av(j,i) / REAL( average_count_3d, KIND=wp ) 266 ENDDO 267 ENDDO 268 CALL exchange_horiz_2d( ol_av, nbgp ) 280 IF ( ALLOCATED( ol_av ) ) THEN 281 DO i = nxlg, nxrg 282 DO j = nysg, nyng 283 ol_av(j,i) = ol_av(j,i) / REAL( average_count_3d, KIND=wp ) 284 ENDDO 285 ENDDO 286 CALL exchange_horiz_2d( ol_av, nbgp ) 287 ENDIF 269 288 270 289 CASE ( 'p' ) 271 DO i = nxlg, nxrg 272 DO j = nysg, nyng 273 DO k = nzb, nzt+1 274 p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 275 ENDDO 276 ENDDO 277 ENDDO 290 IF ( ALLOCATED( p_av ) ) THEN 291 DO i = nxlg, nxrg 292 DO j = nysg, nyng 293 DO k = nzb, nzt+1 294 p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 295 ENDDO 296 ENDDO 297 ENDDO 298 ENDIF 278 299 279 300 CASE ( 'pc' ) 280 DO i = nxl, nxr 281 DO j = nys, nyn 282 DO k = nzb, nzt+1 283 pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 284 ENDDO 285 ENDDO 286 ENDDO 301 IF ( ALLOCATED( pc_av ) ) THEN 302 DO i = nxl, nxr 303 DO j = nys, nyn 304 DO k = nzb, nzt+1 305 pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 306 ENDDO 307 ENDDO 308 ENDDO 309 ENDIF 287 310 288 311 CASE ( 'pr' ) 289 DO i = nxl, nxr 290 DO j = nys, nyn 291 DO k = nzb, nzt+1 292 pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 293 ENDDO 294 ENDDO 295 ENDDO 296 297 CASE ( 'prr*' ) 298 DO i = nxlg, nxrg 299 DO j = nysg, nyng 300 precipitation_rate_av(j,i) = precipitation_rate_av(j,i) / & 301 REAL( average_count_3d, KIND=wp ) 302 ENDDO 303 ENDDO 312 IF ( ALLOCATED( pr_av ) ) THEN 313 DO i = nxl, nxr 314 DO j = nys, nyn 315 DO k = nzb, nzt+1 316 pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 317 ENDDO 318 ENDDO 319 ENDDO 320 ENDIF 321 322 CASE ( 'prr' ) 323 IF ( ALLOCATED( prr_av ) ) THEN 324 DO i = nxlg, nxrg 325 DO j = nysg, nyng 326 DO k = nzb, nzt+1 327 prr_av(k,j,i) = prr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 328 ENDDO 329 ENDDO 330 ENDDO 331 ENDIF 304 332 305 333 CASE ( 'pt' ) 306 DO i = nxlg, nxrg 307 DO j = nysg, nyng 308 DO k = nzb, nzt+1 309 pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 310 ENDDO 311 ENDDO 312 ENDDO 334 IF ( ALLOCATED( pt_av ) ) THEN 335 DO i = nxlg, nxrg 336 DO j = nysg, nyng 337 DO k = nzb, nzt+1 338 pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 339 ENDDO 340 ENDDO 341 ENDDO 342 ENDIF 313 343 314 344 CASE ( 'q' ) 315 DO i = nxlg, nxrg 316 DO j = nysg, nyng 317 DO k = nzb, nzt+1 318 q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 319 ENDDO 320 ENDDO 321 ENDDO 345 IF ( ALLOCATED( q_av ) ) THEN 346 DO i = nxlg, nxrg 347 DO j = nysg, nyng 348 DO k = nzb, nzt+1 349 q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 350 ENDDO 351 ENDDO 352 ENDDO 353 ENDIF 322 354 323 355 CASE ( 'qc' ) 324 DO i = nxlg, nxrg 325 DO j = nysg, nyng 326 DO k = nzb, nzt+1 327 qc_av(k,j,i) = qc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 328 ENDDO 329 ENDDO 330 ENDDO 356 IF ( ALLOCATED( qc_av ) ) THEN 357 DO i = nxlg, nxrg 358 DO j = nysg, nyng 359 DO k = nzb, nzt+1 360 qc_av(k,j,i) = qc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 361 ENDDO 362 ENDDO 363 ENDDO 364 ENDIF 331 365 332 366 CASE ( 'ql' ) 333 DO i = nxlg, nxrg 334 DO j = nysg, nyng 335 DO k = nzb, nzt+1 336 ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 337 ENDDO 338 ENDDO 339 ENDDO 367 IF ( ALLOCATED( ql_av ) ) THEN 368 DO i = nxlg, nxrg 369 DO j = nysg, nyng 370 DO k = nzb, nzt+1 371 ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 372 ENDDO 373 ENDDO 374 ENDDO 375 ENDIF 340 376 341 377 CASE ( 'ql_c' ) 342 DO i = nxlg, nxrg 343 DO j = nysg, nyng 344 DO k = nzb, nzt+1 345 ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 346 ENDDO 347 ENDDO 348 ENDDO 378 IF ( ALLOCATED( ql_c_av ) ) THEN 379 DO i = nxlg, nxrg 380 DO j = nysg, nyng 381 DO k = nzb, nzt+1 382 ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 383 ENDDO 384 ENDDO 385 ENDDO 386 ENDIF 349 387 350 388 CASE ( 'ql_v' ) 351 DO i = nxlg, nxrg 352 DO j = nysg, nyng 353 DO k = nzb, nzt+1 354 ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 355 ENDDO 356 ENDDO 357 ENDDO 389 IF ( ALLOCATED( ql_v_av ) ) THEN 390 DO i = nxlg, nxrg 391 DO j = nysg, nyng 392 DO k = nzb, nzt+1 393 ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 394 ENDDO 395 ENDDO 396 ENDDO 397 ENDIF 358 398 359 399 CASE ( 'ql_vp' ) 360 DO i = nxlg, nxrg 361 DO j = nysg, nyng 362 DO k = nzb, nzt+1 363 ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & 364 REAL( average_count_3d, KIND=wp ) 365 ENDDO 366 ENDDO 367 ENDDO 400 IF ( ALLOCATED( ql_vp_av ) ) THEN 401 DO i = nxlg, nxrg 402 DO j = nysg, nyng 403 DO k = nzb, nzt+1 404 ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & 405 REAL( average_count_3d, KIND=wp ) 406 ENDDO 407 ENDDO 408 ENDDO 409 ENDIF 368 410 369 411 CASE ( 'qr' ) 370 DO i = nxlg, nxrg 371 DO j = nysg, nyng 372 DO k = nzb, nzt+1 373 qr_av(k,j,i) = qr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 374 ENDDO 375 ENDDO 376 ENDDO 412 IF ( ALLOCATED( qr_av ) ) THEN 413 DO i = nxlg, nxrg 414 DO j = nysg, nyng 415 DO k = nzb, nzt+1 416 qr_av(k,j,i) = qr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 417 ENDDO 418 ENDDO 419 ENDDO 420 ENDIF 377 421 378 422 CASE ( 'qv' ) 379 DO i = nxlg, nxrg 380 DO j = nysg, nyng 381 DO k = nzb, nzt+1 382 qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 383 ENDDO 384 ENDDO 385 ENDDO 423 IF ( ALLOCATED( qv_av ) ) THEN 424 DO i = nxlg, nxrg 425 DO j = nysg, nyng 426 DO k = nzb, nzt+1 427 qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 428 ENDDO 429 ENDDO 430 ENDDO 431 ENDIF 386 432 387 433 CASE ( 'r_a*' ) 388 DO i = nxlg, nxrg 389 DO j = nysg, nyng 390 r_a_av(j,i) = r_a_av(j,i) / REAL( average_count_3d, KIND=wp ) 391 ENDDO 392 ENDDO 393 CALL exchange_horiz_2d( r_a_av, nbgp ) 434 IF ( ALLOCATED( r_a_av ) ) THEN 435 DO i = nxlg, nxrg 436 DO j = nysg, nyng 437 r_a_av(j,i) = r_a_av(j,i) / REAL( average_count_3d, KIND=wp ) 438 ENDDO 439 ENDDO 440 CALL exchange_horiz_2d( r_a_av, nbgp ) 441 ENDIF 394 442 395 443 CASE ( 'rho_ocean' ) 396 DO i = nxlg, nxrg 397 DO j = nysg, nyng 398 DO k = nzb, nzt+1 399 rho_ocean_av(k,j,i) = rho_ocean_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 400 ENDDO 401 ENDDO 402 ENDDO 444 IF ( ALLOCATED( rho_ocean_av ) ) THEN 445 DO i = nxlg, nxrg 446 DO j = nysg, nyng 447 DO k = nzb, nzt+1 448 rho_ocean_av(k,j,i) = rho_ocean_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 449 ENDDO 450 ENDDO 451 ENDDO 452 ENDIF 403 453 404 454 CASE ( 's' ) 405 DO i = nxlg, nxrg 406 DO j = nysg, nyng 407 DO k = nzb, nzt+1 408 s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 409 ENDDO 410 ENDDO 411 ENDDO 455 IF ( ALLOCATED( s_av ) ) THEN 456 DO i = nxlg, nxrg 457 DO j = nysg, nyng 458 DO k = nzb, nzt+1 459 s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 460 ENDDO 461 ENDDO 462 ENDDO 463 ENDIF 412 464 413 465 CASE ( 'sa' ) 414 DO i = nxlg, nxrg 415 DO j = nysg, nyng 416 DO k = nzb, nzt+1 417 sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 418 ENDDO 419 ENDDO 420 ENDDO 466 IF ( ALLOCATED( sa_av ) ) THEN 467 DO i = nxlg, nxrg 468 DO j = nysg, nyng 469 DO k = nzb, nzt+1 470 sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 471 ENDDO 472 ENDDO 473 ENDDO 474 ENDIF 421 475 422 476 CASE ( 'shf*' ) 423 DO i = nxlg, nxrg 424 DO j = nysg, nyng 425 shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d, KIND=wp ) 426 ENDDO 427 ENDDO 428 CALL exchange_horiz_2d( shf_av, nbgp ) 477 IF ( ALLOCATED( shf_av ) ) THEN 478 DO i = nxlg, nxrg 479 DO j = nysg, nyng 480 shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d, KIND=wp ) 481 ENDDO 482 ENDDO 483 CALL exchange_horiz_2d( shf_av, nbgp ) 484 ENDIF 429 485 430 486 CASE ( 'ssws*' ) 431 DO i = nxlg, nxrg 432 DO j = nysg, nyng 433 ssws_av(j,i) = ssws_av(j,i) / REAL( average_count_3d, KIND=wp ) 434 ENDDO 435 ENDDO 436 CALL exchange_horiz_2d( ssws_av, nbgp ) 487 IF ( ALLOCATED( ssws_av ) ) THEN 488 DO i = nxlg, nxrg 489 DO j = nysg, nyng 490 ssws_av(j,i) = ssws_av(j,i) / REAL( average_count_3d, KIND=wp ) 491 ENDDO 492 ENDDO 493 CALL exchange_horiz_2d( ssws_av, nbgp ) 494 ENDIF 437 495 438 496 CASE ( 't*' ) 439 DO i = nxlg, nxrg 440 DO j = nysg, nyng 441 ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d, KIND=wp ) 442 ENDDO 443 ENDDO 444 CALL exchange_horiz_2d( ts_av, nbgp ) 497 IF ( ALLOCATED( ts_av ) ) THEN 498 DO i = nxlg, nxrg 499 DO j = nysg, nyng 500 ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d, KIND=wp ) 501 ENDDO 502 ENDDO 503 CALL exchange_horiz_2d( ts_av, nbgp ) 504 ENDIF 445 505 446 506 CASE ( 'tsurf*' ) 447 DO i = nxlg, nxrg 448 DO j = nysg, nyng 449 tsurf_av(j,i) = tsurf_av(j,i) / REAL( average_count_3d, KIND=wp ) 450 ENDDO 451 ENDDO 452 CALL exchange_horiz_2d( tsurf_av, nbgp ) 507 IF ( ALLOCATED( tsurf_av ) ) THEN 508 DO i = nxlg, nxrg 509 DO j = nysg, nyng 510 tsurf_av(j,i) = tsurf_av(j,i) / REAL( average_count_3d, KIND=wp ) 511 ENDDO 512 ENDDO 513 CALL exchange_horiz_2d( tsurf_av, nbgp ) 514 ENDIF 453 515 454 516 CASE ( 'u' ) 455 DO i = nxlg, nxrg 456 DO j = nysg, nyng 457 DO k = nzb, nzt+1 458 u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 459 ENDDO 460 ENDDO 461 ENDDO 517 IF ( ALLOCATED( u_av ) ) THEN 518 DO i = nxlg, nxrg 519 DO j = nysg, nyng 520 DO k = nzb, nzt+1 521 u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 522 ENDDO 523 ENDDO 524 ENDDO 525 ENDIF 462 526 463 527 CASE ( 'u*' ) 464 DO i = nxlg, nxrg 465 DO j = nysg, nyng 466 us_av(j,i) = us_av(j,i) / REAL( average_count_3d, KIND=wp ) 467 ENDDO 468 ENDDO 469 CALL exchange_horiz_2d( us_av, nbgp ) 528 IF ( ALLOCATED( us_av ) ) THEN 529 DO i = nxlg, nxrg 530 DO j = nysg, nyng 531 us_av(j,i) = us_av(j,i) / REAL( average_count_3d, KIND=wp ) 532 ENDDO 533 ENDDO 534 CALL exchange_horiz_2d( us_av, nbgp ) 535 ENDIF 470 536 471 537 CASE ( 'v' ) 472 DO i = nxlg, nxrg 473 DO j = nysg, nyng 474 DO k = nzb, nzt+1 475 v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 476 ENDDO 477 ENDDO 478 ENDDO 538 IF ( ALLOCATED( v_av ) ) THEN 539 DO i = nxlg, nxrg 540 DO j = nysg, nyng 541 DO k = nzb, nzt+1 542 v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 543 ENDDO 544 ENDDO 545 ENDDO 546 ENDIF 479 547 480 548 CASE ( 'vpt' ) 481 DO i = nxlg, nxrg 482 DO j = nysg, nyng 483 DO k = nzb, nzt+1 484 vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 485 ENDDO 486 ENDDO 487 ENDDO 549 IF ( ALLOCATED( vpt_av ) ) THEN 550 DO i = nxlg, nxrg 551 DO j = nysg, nyng 552 DO k = nzb, nzt+1 553 vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 554 ENDDO 555 ENDDO 556 ENDDO 557 ENDIF 488 558 489 559 CASE ( 'w' ) 490 DO i = nxlg, nxrg 491 DO j = nysg, nyng 492 DO k = nzb, nzt+1 493 w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 494 ENDDO 495 ENDDO 496 ENDDO 560 IF ( ALLOCATED( w_av ) ) THEN 561 DO i = nxlg, nxrg 562 DO j = nysg, nyng 563 DO k = nzb, nzt+1 564 w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 565 ENDDO 566 ENDDO 567 ENDDO 568 ENDIF 497 569 498 570 CASE ( 'z0*' ) 499 DO i = nxlg, nxrg 500 DO j = nysg, nyng 501 z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d, KIND=wp ) 502 ENDDO 503 ENDDO 504 CALL exchange_horiz_2d( z0_av, nbgp ) 571 IF ( ALLOCATED( z0_av ) ) THEN 572 DO i = nxlg, nxrg 573 DO j = nysg, nyng 574 z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d, KIND=wp ) 575 ENDDO 576 ENDDO 577 CALL exchange_horiz_2d( z0_av, nbgp ) 578 ENDIF 505 579 506 580 CASE ( 'z0h*' ) 507 DO i = nxlg, nxrg 508 DO j = nysg, nyng 509 z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d, KIND=wp ) 510 ENDDO 511 ENDDO 512 CALL exchange_horiz_2d( z0h_av, nbgp ) 581 IF ( ALLOCATED( z0h_av ) ) THEN 582 DO i = nxlg, nxrg 583 DO j = nysg, nyng 584 z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d, KIND=wp ) 585 ENDDO 586 ENDDO 587 CALL exchange_horiz_2d( z0h_av, nbgp ) 588 ENDIF 589 590 CASE ( 'z0q*' ) 591 IF ( ALLOCATED( z0q_av ) ) THEN 592 DO i = nxlg, nxrg 593 DO j = nysg, nyng 594 z0q_av(j,i) = z0q_av(j,i) / REAL( average_count_3d, KIND=wp ) 595 ENDDO 596 ENDDO 597 CALL exchange_horiz_2d( z0q_av, nbgp ) 598 ENDIF 599 513 600 ! 514 601 !-- Block of urban surface model outputs -
palm/trunk/SOURCE/chemistry_model_mod.f90
r2932 r3004 27 27 ! ----------------- 28 28 ! $Id$ 29 ! Comment concerning averaged data output added 30 ! 31 ! 2932 2018-03-26 09:39:22Z maronga 29 32 ! renamed chemistry_par to chemistry_parameters 30 33 ! … … 1219 1222 ! Description: 1220 1223 ! ------------ 1221 !> Subroutine for averaging 3D data of chemical species 1224 !> Subroutine for averaging 3D data of chemical species. Due to the fact that 1225 !> the averaged chem arrays are allocated in chem_init, no if-query concerning 1226 !> the allocation is required (in any mode). Attention: If you just specify an 1227 !> averaged output quantity in the _p3dr file during restarts the first output 1228 !> includes the time between the beginning of the restart run and the first 1229 !> output time (not necessarily the whole averaging_interval you have 1230 !> specified in your _p3d/_p3dr file ) 1222 1231 !------------------------------------------------------------------------------! 1223 1232 -
palm/trunk/SOURCE/data_output_2d.f90
r2963 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! precipitation_rate removed, case prr*_xy removed, to_be_resorted have to point 28 ! to ql_vp_av and not to ql_vp, allocation checks implemented (averaged data 29 ! will be assigned to fill values if no allocation happened so far) 30 ! 31 ! 2963 2018-04-12 14:47:44Z suehring 27 32 ! Introduce index for vegetation/wall, pavement/green-wall and water/window 28 33 ! surfaces, for clearer access of surface fraction, albedo, emissivity, etc. . … … 211 216 USE arrays_3d, & 212 217 ONLY: dzw, e, heatflux_output_conversion, nc, nr, p, pt, & 213 precipitation_amount, pr ecipitation_rate,&214 prr, q, qc, ql, ql_c, ql_v, ql_vp, qr, rho_ocean, s, sa,&215 tend, u, v, vpt, w, zu, zw,waterflux_output_conversion218 precipitation_amount, prr, q, qc, ql, ql_c, ql_v, ql_vp, qr, & 219 rho_ocean, s, sa, tend, u, v, vpt, w, zu, zw, & 220 waterflux_output_conversion 216 221 217 222 USE averaging … … 241 246 242 247 USE indices, & 243 ONLY: nbgp, nx, nxl, nxr, ny, nyn, nys, nz, nzb, nzt, wall_flags_0 248 ONLY: nbgp, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nz, & 249 nzb, nzt, wall_flags_0 244 250 245 251 USE kinds … … 516 522 to_be_resorted => e 517 523 ELSE 524 IF ( .NOT. ALLOCATED( e_av ) ) THEN 525 ALLOCATE( e_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 526 e_av = REAL( fill_value, KIND = wp ) 527 ENDIF 518 528 to_be_resorted => e_av 519 529 ENDIF … … 524 534 to_be_resorted => pt 525 535 ELSE 536 IF ( .NOT. ALLOCATED( lpt_av ) ) THEN 537 ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 538 lpt_av = REAL( fill_value, KIND = wp ) 539 ENDIF 526 540 to_be_resorted => lpt_av 527 541 ENDIF … … 537 551 ENDDO 538 552 ELSE 553 IF ( .NOT. ALLOCATED( lwp_av ) ) THEN 554 ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) 555 lwp_av = REAL( fill_value, KIND = wp ) 556 ENDIF 539 557 DO i = nxl, nxr 540 558 DO j = nys, nyn … … 551 569 to_be_resorted => nc 552 570 ELSE 571 IF ( .NOT. ALLOCATED( nc_av ) ) THEN 572 ALLOCATE( nc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 573 nc_av = REAL( fill_value, KIND = wp ) 574 ENDIF 553 575 to_be_resorted => nc_av 554 576 ENDIF … … 559 581 to_be_resorted => nr 560 582 ELSE 583 IF ( .NOT. ALLOCATED( nr_av ) ) THEN 584 ALLOCATE( nr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 585 nr_av = REAL( fill_value, KIND = wp ) 586 ENDIF 561 587 to_be_resorted => nr_av 562 588 ENDIF … … 581 607 ENDDO 582 608 ELSE 609 IF ( .NOT. ALLOCATED( ghf_av ) ) THEN 610 ALLOCATE( ghf_av(nysg:nyng,nxlg:nxrg) ) 611 ghf_av = REAL( fill_value, KIND = wp ) 612 ENDIF 583 613 DO i = nxl, nxr 584 614 DO j = nys, nyn … … 610 640 ENDDO 611 641 ELSE 642 IF ( .NOT. ALLOCATED( ol_av ) ) THEN 643 ALLOCATE( ol_av(nysg:nyng,nxlg:nxrg) ) 644 ol_av = REAL( fill_value, KIND = wp ) 645 ENDIF 612 646 DO i = nxl, nxr 613 647 DO j = nys, nyn … … 625 659 to_be_resorted => p 626 660 ELSE 661 IF ( .NOT. ALLOCATED( p_av ) ) THEN 662 ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 663 p_av = REAL( fill_value, KIND = wp ) 664 ENDIF 627 665 IF ( psolver /= 'sor' ) CALL exchange_horiz( p_av, nbgp ) 628 666 to_be_resorted => p_av … … 647 685 resorted = .TRUE. 648 686 ELSE 687 IF ( .NOT. ALLOCATED( pc_av ) ) THEN 688 ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 689 pc_av = REAL( fill_value, KIND = wp ) 690 ENDIF 649 691 ! CALL exchange_horiz( pc_av, nbgp ) 650 692 to_be_resorted => pc_av … … 692 734 resorted = .TRUE. 693 735 ELSE 736 IF ( .NOT. ALLOCATED( pr_av ) ) THEN 737 ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 738 pr_av = REAL( fill_value, KIND = wp ) 739 ENDIF 694 740 ! CALL exchange_horiz( pr_av, nbgp ) 695 741 to_be_resorted => pr_av … … 704 750 ENDDO 705 751 precipitation_amount = 0.0_wp ! reset for next integ. interval 706 resorted = .TRUE.707 two_d = .TRUE.708 level_z(nzb+1) = zu(nzb+1)709 710 CASE ( 'prr*_xy' ) ! 2d-array711 IF ( av == 0 ) THEN712 ! CALL exchange_horiz_2d( prr(nzb+1,:,:) )713 DO i = nxl, nxr714 DO j = nys, nyn715 local_pf(i,j,nzb+1) = prr(nzb+1,j,i) * hyrho(nzb+1)716 ENDDO717 ENDDO718 ELSE719 ! CALL exchange_horiz_2d( prr_av(nzb+1,:,:) )720 DO i = nxl, nxr721 DO j = nys, nyn722 local_pf(i,j,nzb+1) = prr_av(nzb+1,j,i) * hyrho(nzb+1)723 ENDDO724 ENDDO725 ENDIF726 752 resorted = .TRUE. 727 753 two_d = .TRUE. … … 739 765 ENDDO 740 766 ELSE 767 IF ( .NOT. ALLOCATED( prr_av ) ) THEN 768 ALLOCATE( prr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 769 prr_av = REAL( fill_value, KIND = wp ) 770 ENDIF 741 771 ! CALL exchange_horiz( prr_av, nbgp ) 742 772 DO i = nxl, nxr … … 768 798 ENDIF 769 799 ELSE 800 IF ( .NOT. ALLOCATED( pt_av ) ) THEN 801 ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 802 pt_av = REAL( fill_value, KIND = wp ) 803 ENDIF 770 804 to_be_resorted => pt_av 771 805 ENDIF … … 776 810 to_be_resorted => q 777 811 ELSE 812 IF ( .NOT. ALLOCATED( q_av ) ) THEN 813 ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 814 q_av = REAL( fill_value, KIND = wp ) 815 ENDIF 778 816 to_be_resorted => q_av 779 817 ENDIF … … 784 822 to_be_resorted => qc 785 823 ELSE 824 IF ( .NOT. ALLOCATED( qc_av ) ) THEN 825 ALLOCATE( qc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 826 qc_av = REAL( fill_value, KIND = wp ) 827 ENDIF 786 828 to_be_resorted => qc_av 787 829 ENDIF … … 792 834 to_be_resorted => ql 793 835 ELSE 836 IF ( .NOT. ALLOCATED( ql_av ) ) THEN 837 ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 838 ql_av = REAL( fill_value, KIND = wp ) 839 ENDIF 794 840 to_be_resorted => ql_av 795 841 ENDIF … … 800 846 to_be_resorted => ql_c 801 847 ELSE 848 IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN 849 ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 850 ql_c_av = REAL( fill_value, KIND = wp ) 851 ENDIF 802 852 to_be_resorted => ql_c_av 803 853 ENDIF … … 808 858 to_be_resorted => ql_v 809 859 ELSE 860 IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN 861 ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 862 ql_v_av = REAL( fill_value, KIND = wp ) 863 ENDIF 810 864 to_be_resorted => ql_v_av 811 865 ENDIF … … 844 898 resorted = .TRUE. 845 899 ELSE 900 IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN 901 ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 902 ql_vp_av = REAL( fill_value, KIND = wp ) 903 ENDIF 846 904 ! CALL exchange_horiz( ql_vp_av, nbgp ) 847 to_be_resorted => ql_vp 905 to_be_resorted => ql_vp_av 848 906 ENDIF 849 907 IF ( mode == 'xy' ) level_z = zu … … 853 911 to_be_resorted => qr 854 912 ELSE 913 IF ( .NOT. ALLOCATED( qr_av ) ) THEN 914 ALLOCATE( qr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 915 qr_av = REAL( fill_value, KIND = wp ) 916 ENDIF 855 917 to_be_resorted => qr_av 856 918 ENDIF … … 883 945 ENDDO 884 946 ELSE 947 IF ( .NOT. ALLOCATED( qsws_av ) ) THEN 948 ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) 949 qsws_av = REAL( fill_value, KIND = wp ) 950 ENDIF 885 951 DO i = nxl, nxr 886 952 DO j = nys, nyn … … 904 970 resorted = .TRUE. 905 971 ELSE 972 IF ( .NOT. ALLOCATED( qv_av ) ) THEN 973 ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 974 qv_av = REAL( fill_value, KIND = wp ) 975 ENDIF 906 976 to_be_resorted => qv_av 907 977 ENDIF … … 928 998 ENDDO 929 999 ELSE 1000 IF ( .NOT. ALLOCATED( r_a_av ) ) THEN 1001 ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) ) 1002 r_a_av = REAL( fill_value, KIND = wp ) 1003 ENDIF 930 1004 DO i = nxl, nxr 931 1005 DO j = nys, nyn … … 942 1016 to_be_resorted => rho_ocean 943 1017 ELSE 1018 IF ( .NOT. ALLOCATED( rho_ocean_av ) ) THEN 1019 ALLOCATE( rho_ocean_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1020 rho_ocean_av = REAL( fill_value, KIND = wp ) 1021 ENDIF 944 1022 to_be_resorted => rho_ocean_av 945 1023 ENDIF … … 949 1027 to_be_resorted => s 950 1028 ELSE 1029 IF ( .NOT. ALLOCATED( s_av ) ) THEN 1030 ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1031 s_av = REAL( fill_value, KIND = wp ) 1032 ENDIF 951 1033 to_be_resorted => s_av 952 1034 ENDIF … … 956 1038 to_be_resorted => sa 957 1039 ELSE 1040 IF ( .NOT. ALLOCATED( sa_av ) ) THEN 1041 ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1042 sa_av = REAL( fill_value, KIND = wp ) 1043 ENDIF 958 1044 to_be_resorted => sa_av 959 1045 ENDIF … … 985 1071 ENDDO 986 1072 ELSE 1073 IF ( .NOT. ALLOCATED( shf_av ) ) THEN 1074 ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) 1075 shf_av = REAL( fill_value, KIND = wp ) 1076 ENDIF 987 1077 DO i = nxl, nxr 988 1078 DO j = nys, nyn … … 1013 1103 ENDDO 1014 1104 ELSE 1105 IF ( .NOT. ALLOCATED( ssws_av ) ) THEN 1106 ALLOCATE( ssws_av(nysg:nyng,nxlg:nxrg) ) 1107 ssws_av = REAL( fill_value, KIND = wp ) 1108 ENDIF 1015 1109 DO i = nxl, nxr 1016 1110 DO j = nys, nyn … … 1041 1135 ENDDO 1042 1136 ELSE 1137 IF ( .NOT. ALLOCATED( ts_av ) ) THEN 1138 ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) 1139 ts_av = REAL( fill_value, KIND = wp ) 1140 ENDIF 1043 1141 DO i = nxl, nxr 1044 1142 DO j = nys, nyn … … 1072 1170 1073 1171 ELSE 1172 IF ( .NOT. ALLOCATED( tsurf_av ) ) THEN 1173 ALLOCATE( tsurf_av(nysg:nyng,nxlg:nxrg) ) 1174 tsurf_av = REAL( fill_value, KIND = wp ) 1175 ENDIF 1074 1176 DO i = nxl, nxr 1075 1177 DO j = nys, nyn … … 1087 1189 to_be_resorted => u 1088 1190 ELSE 1191 IF ( .NOT. ALLOCATED( u_av ) ) THEN 1192 ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1193 u_av = REAL( fill_value, KIND = wp ) 1194 ENDIF 1089 1195 to_be_resorted => u_av 1090 1196 ENDIF … … 1115 1221 ENDDO 1116 1222 ELSE 1223 IF ( .NOT. ALLOCATED( us_av ) ) THEN 1224 ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) 1225 us_av = REAL( fill_value, KIND = wp ) 1226 ENDIF 1117 1227 DO i = nxl, nxr 1118 1228 DO j = nys, nyn … … 1130 1240 to_be_resorted => v 1131 1241 ELSE 1242 IF ( .NOT. ALLOCATED( v_av ) ) THEN 1243 ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1244 v_av = REAL( fill_value, KIND = wp ) 1245 ENDIF 1132 1246 to_be_resorted => v_av 1133 1247 ENDIF … … 1144 1258 to_be_resorted => vpt 1145 1259 ELSE 1260 IF ( .NOT. ALLOCATED( vpt_av ) ) THEN 1261 ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1262 vpt_av = REAL( fill_value, KIND = wp ) 1263 ENDIF 1146 1264 to_be_resorted => vpt_av 1147 1265 ENDIF … … 1153 1271 to_be_resorted => w 1154 1272 ELSE 1273 IF ( .NOT. ALLOCATED( w_av ) ) THEN 1274 ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1275 w_av = REAL( fill_value, KIND = wp ) 1276 ENDIF 1155 1277 to_be_resorted => w_av 1156 1278 ENDIF … … 1175 1297 ENDDO 1176 1298 ELSE 1299 IF ( .NOT. ALLOCATED( z0_av ) ) THEN 1300 ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) 1301 z0_av = REAL( fill_value, KIND = wp ) 1302 ENDIF 1177 1303 DO i = nxl, nxr 1178 1304 DO j = nys, nyn … … 1203 1329 ENDDO 1204 1330 ELSE 1331 IF ( .NOT. ALLOCATED( z0h_av ) ) THEN 1332 ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) 1333 z0h_av = REAL( fill_value, KIND = wp ) 1334 ENDIF 1205 1335 DO i = nxl, nxr 1206 1336 DO j = nys, nyn … … 1231 1361 ENDDO 1232 1362 ELSE 1363 IF ( .NOT. ALLOCATED( z0q_av ) ) THEN 1364 ALLOCATE( z0q_av(nysg:nyng,nxlg:nxrg) ) 1365 z0q_av = REAL( fill_value, KIND = wp ) 1366 ENDIF 1233 1367 DO i = nxl, nxr 1234 1368 DO j = nys, nyn -
palm/trunk/SOURCE/data_output_3d.f90
r2967 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Allocation checks implemented (averaged data will be assigned to fill values 28 ! if no allocation happened so far) 29 ! 30 ! 2967 2018-04-13 11:22:08Z raasch 27 31 ! bugfix: missing parallel cpp-directives added 28 32 ! … … 214 218 215 219 USE indices, & 216 ONLY: nbgp, nx, nxl, nxr, ny, nyn, nys, nzb, wall_flags_0 220 ONLY: nbgp, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nzb, & 221 nzt, wall_flags_0 217 222 218 223 USE kinds … … 366 371 to_be_resorted => e 367 372 ELSE 373 IF ( .NOT. ALLOCATED( e_av ) ) THEN 374 ALLOCATE( e_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 375 e_av = REAL( fill_value, KIND = wp ) 376 ENDIF 368 377 to_be_resorted => e_av 369 378 ENDIF … … 373 382 to_be_resorted => pt 374 383 ELSE 384 IF ( .NOT. ALLOCATED( lpt_av ) ) THEN 385 ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 386 lpt_av = REAL( fill_value, KIND = wp ) 387 ENDIF 375 388 to_be_resorted => lpt_av 376 389 ENDIF … … 380 393 to_be_resorted => nc 381 394 ELSE 395 IF ( .NOT. ALLOCATED( nc_av ) ) THEN 396 ALLOCATE( nc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 397 nc_av = REAL( fill_value, KIND = wp ) 398 ENDIF 382 399 to_be_resorted => nc_av 383 400 ENDIF … … 387 404 to_be_resorted => nr 388 405 ELSE 406 IF ( .NOT. ALLOCATED( nr_av ) ) THEN 407 ALLOCATE( nr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 408 nr_av = REAL( fill_value, KIND = wp ) 409 ENDIF 389 410 to_be_resorted => nr_av 390 411 ENDIF … … 395 416 to_be_resorted => p 396 417 ELSE 418 IF ( .NOT. ALLOCATED( p_av ) ) THEN 419 ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 420 p_av = REAL( fill_value, KIND = wp ) 421 ENDIF 397 422 IF ( psolver /= 'sor' ) CALL exchange_horiz( p_av, nbgp ) 398 423 to_be_resorted => p_av … … 415 440 resorted = .TRUE. 416 441 ELSE 442 IF ( .NOT. ALLOCATED( pc_av ) ) THEN 443 ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 444 pc_av = REAL( fill_value, KIND = wp ) 445 ENDIF 417 446 to_be_resorted => pc_av 418 447 ENDIF … … 458 487 resorted = .TRUE. 459 488 ELSE 489 IF ( .NOT. ALLOCATED( pr_av ) ) THEN 490 ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 491 pr_av = REAL( fill_value, KIND = wp ) 492 ENDIF 460 493 to_be_resorted => pr_av 461 494 ENDIF … … 471 504 ENDDO 472 505 ELSE 506 IF ( .NOT. ALLOCATED( prr_av ) ) THEN 507 ALLOCATE( prr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 508 prr_av = REAL( fill_value, KIND = wp ) 509 ENDIF 473 510 DO i = nxl, nxr 474 511 DO j = nys, nyn … … 498 535 ENDIF 499 536 ELSE 537 IF ( .NOT. ALLOCATED( pt_av ) ) THEN 538 ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 539 pt_av = REAL( fill_value, KIND = wp ) 540 ENDIF 500 541 to_be_resorted => pt_av 501 542 ENDIF … … 505 546 to_be_resorted => q 506 547 ELSE 548 IF ( .NOT. ALLOCATED( q_av ) ) THEN 549 ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 550 q_av = REAL( fill_value, KIND = wp ) 551 ENDIF 507 552 to_be_resorted => q_av 508 553 ENDIF … … 512 557 to_be_resorted => qc 513 558 ELSE 559 IF ( .NOT. ALLOCATED( qc_av ) ) THEN 560 ALLOCATE( qc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 561 qc_av = REAL( fill_value, KIND = wp ) 562 ENDIF 514 563 to_be_resorted => qc_av 515 564 ENDIF … … 519 568 to_be_resorted => ql 520 569 ELSE 570 IF ( .NOT. ALLOCATED( ql_av ) ) THEN 571 ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 572 ql_av = REAL( fill_value, KIND = wp ) 573 ENDIF 521 574 to_be_resorted => ql_av 522 575 ENDIF … … 526 579 to_be_resorted => ql_c 527 580 ELSE 581 IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN 582 ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 583 ql_c_av = REAL( fill_value, KIND = wp ) 584 ENDIF 528 585 to_be_resorted => ql_c_av 529 586 ENDIF … … 533 590 to_be_resorted => ql_v 534 591 ELSE 592 IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN 593 ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 594 ql_v_av = REAL( fill_value, KIND = wp ) 595 ENDIF 535 596 to_be_resorted => ql_v_av 536 597 ENDIF … … 567 628 resorted = .TRUE. 568 629 ELSE 630 IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN 631 ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 632 ql_vp_av = REAL( fill_value, KIND = wp ) 633 ENDIF 569 634 to_be_resorted => ql_vp_av 570 635 ENDIF … … 574 639 to_be_resorted => qr 575 640 ELSE 641 IF ( .NOT. ALLOCATED( qr_av ) ) THEN 642 ALLOCATE( qr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 643 qr_av = REAL( fill_value, KIND = wp ) 644 ENDIF 576 645 to_be_resorted => qr_av 577 646 ENDIF … … 588 657 resorted = .TRUE. 589 658 ELSE 659 IF ( .NOT. ALLOCATED( qv_av ) ) THEN 660 ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 661 qv_av = REAL( fill_value, KIND = wp ) 662 ENDIF 590 663 to_be_resorted => qv_av 591 664 ENDIF … … 595 668 to_be_resorted => rho_ocean 596 669 ELSE 670 IF ( .NOT. ALLOCATED( rho_ocean_av ) ) THEN 671 ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 672 u_av = REAL( fill_value, KIND = wp ) 673 ENDIF 597 674 to_be_resorted => rho_ocean_av 598 675 ENDIF … … 602 679 to_be_resorted => s 603 680 ELSE 681 IF ( .NOT. ALLOCATED( s_av ) ) THEN 682 ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 683 s_av = REAL( fill_value, KIND = wp ) 684 ENDIF 604 685 to_be_resorted => s_av 605 686 ENDIF … … 609 690 to_be_resorted => sa 610 691 ELSE 692 IF ( .NOT. ALLOCATED( sa_av ) ) THEN 693 ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 694 sa_av = REAL( fill_value, KIND = wp ) 695 ENDIF 611 696 to_be_resorted => sa_av 612 697 ENDIF … … 617 702 to_be_resorted => u 618 703 ELSE 704 IF ( .NOT. ALLOCATED( u_av ) ) THEN 705 ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 706 u_av = REAL( fill_value, KIND = wp ) 707 ENDIF 619 708 to_be_resorted => u_av 620 709 ENDIF … … 625 714 to_be_resorted => v 626 715 ELSE 716 IF ( .NOT. ALLOCATED( v_av ) ) THEN 717 ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 718 v_av = REAL( fill_value, KIND = wp ) 719 ENDIF 627 720 to_be_resorted => v_av 628 721 ENDIF … … 632 725 to_be_resorted => vpt 633 726 ELSE 727 IF ( .NOT. ALLOCATED( vpt_av ) ) THEN 728 ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 729 vpt_av = REAL( fill_value, KIND = wp ) 730 ENDIF 634 731 to_be_resorted => vpt_av 635 732 ENDIF … … 640 737 to_be_resorted => w 641 738 ELSE 739 IF ( .NOT. ALLOCATED( w_av ) ) THEN 740 ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 741 w_av = REAL( fill_value, KIND = wp ) 742 ENDIF 642 743 to_be_resorted => w_av 643 744 ENDIF -
palm/trunk/SOURCE/flow_statistics.f90
r3003 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Comments related to the calculation of the inversion height expanded 28 ! 29 ! 3003 2018-04-23 10:22:58Z Giersch 27 30 ! The inversion height will not be calcuated before the first timestep in 28 31 ! case of restarts. … … 2007 2010 !-- The corresponding height is assumed as the boundary layer height, if it 2008 2011 !-- is less than 1.5 times the height where the heat flux becomes negative 2009 !-- (positive) for the first time. 2012 !-- (positive) for the first time. Attention: the resolved vertical sensible 2013 !-- heat flux (hom(:,1,17,sr) = w*pt*) is not known at the beginning because 2014 !-- the calculation happens in advec_s_ws which is called after 2015 !-- flow_statistics. Therefore z_i is directly taken from restart data at 2016 !-- the beginning of restart runs. 2010 2017 IF ( TRIM( initializing_actions ) /= 'read_restart_data' .OR. & 2011 2018 simulated_time_at_begin /= simulated_time ) THEN -
palm/trunk/SOURCE/gust_mod.f90
r2932 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Interfaces concerning data output updated 28 ! 29 ! 27 30 ! renamed gust_par to gust_parameters 28 31 ! … … 403 406 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 404 407 408 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 409 405 410 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< 406 411 … … 427 432 428 433 LOGICAL :: found !< 434 435 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 429 436 430 437 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< -
palm/trunk/SOURCE/init_3d_model.f90
r2995 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! precipitation_rate removed 28 ! 29 ! 2995 2018-04-19 12:13:16Z Giersch 27 30 ! CALL radiation_control is not necessary during initialization because 28 31 ! calculation of radiative fluxes at model start is done in radiation_init … … 724 727 ! 725 728 !-- Precipitation amount and rate (only needed if output is switched) 726 ALLOCATE( precipitation_amount(nysg:nyng,nxlg:nxrg), & 727 precipitation_rate(nysg:nyng,nxlg:nxrg) ) 729 ALLOCATE( precipitation_amount(nysg:nyng,nxlg:nxrg) ) 728 730 729 731 ! -
palm/trunk/SOURCE/land_surface_model_mod.f90
r2968 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Further allocation checks implemented (averaged data will be assigned to fill 28 ! values if no allocation happened so far) 29 ! 30 ! 2968 2018-04-13 11:52:24Z suehring 27 31 ! Bugfix in initialization in case of elevated model surface 28 32 ! … … 5322 5326 5323 5327 CASE ( 'c_liq*' ) 5324 DO m = 1, surf_lsm_h%ns 5325 i = surf_lsm_h%i(m) 5326 j = surf_lsm_h%j(m) 5327 c_liq_av(j,i) = c_liq_av(j,i) + surf_lsm_h%c_liq(m) 5328 ENDDO 5328 IF ( ALLOCATED( c_liq_av ) ) THEN 5329 DO m = 1, surf_lsm_h%ns 5330 i = surf_lsm_h%i(m) 5331 j = surf_lsm_h%j(m) 5332 c_liq_av(j,i) = c_liq_av(j,i) + surf_lsm_h%c_liq(m) 5333 ENDDO 5334 ENDIF 5329 5335 5330 5336 CASE ( 'c_soil*' ) 5331 DO m = 1, surf_lsm_h%ns 5332 i = surf_lsm_h%i(m) 5333 j = surf_lsm_h%j(m) 5334 c_soil_av(j,i) = c_soil_av(j,i) + (1.0 - surf_lsm_h%c_veg(m)) 5335 ENDDO 5337 IF ( ALLOCATED( c_soil_av ) ) THEN 5338 DO m = 1, surf_lsm_h%ns 5339 i = surf_lsm_h%i(m) 5340 j = surf_lsm_h%j(m) 5341 c_soil_av(j,i) = c_soil_av(j,i) + (1.0 - surf_lsm_h%c_veg(m)) 5342 ENDDO 5343 ENDIF 5336 5344 5337 5345 CASE ( 'c_veg*' ) 5338 DO m = 1, surf_lsm_h%ns 5339 i = surf_lsm_h%i(m) 5340 j = surf_lsm_h%j(m) 5341 c_veg_av(j,i) = c_veg_av(j,i) + surf_lsm_h%c_veg(m) 5342 ENDDO 5346 IF ( ALLOCATED( c_veg_av ) ) THEN 5347 DO m = 1, surf_lsm_h%ns 5348 i = surf_lsm_h%i(m) 5349 j = surf_lsm_h%j(m) 5350 c_veg_av(j,i) = c_veg_av(j,i) + surf_lsm_h%c_veg(m) 5351 ENDDO 5352 ENDIF 5343 5353 5344 5354 CASE ( 'lai*' ) 5345 DO m = 1, surf_lsm_h%ns 5346 i = surf_lsm_h%i(m) 5347 j = surf_lsm_h%j(m) 5348 lai_av(j,i) = lai_av(j,i) + surf_lsm_h%lai(m) 5349 ENDDO 5355 IF ( ALLOCATED( lai_av ) ) THEN 5356 DO m = 1, surf_lsm_h%ns 5357 i = surf_lsm_h%i(m) 5358 j = surf_lsm_h%j(m) 5359 lai_av(j,i) = lai_av(j,i) + surf_lsm_h%lai(m) 5360 ENDDO 5361 ENDIF 5350 5362 5351 5363 CASE ( 'm_liq*' ) 5352 DO m = 1, surf_lsm_h%ns 5353 i = surf_lsm_h%i(m) 5354 j = surf_lsm_h%j(m) 5355 m_liq_av(j,i) = m_liq_av(j,i) + m_liq_h%var_1d(m) 5356 ENDDO 5364 IF ( ALLOCATED( m_liq_av ) ) THEN 5365 DO m = 1, surf_lsm_h%ns 5366 i = surf_lsm_h%i(m) 5367 j = surf_lsm_h%j(m) 5368 m_liq_av(j,i) = m_liq_av(j,i) + m_liq_h%var_1d(m) 5369 ENDDO 5370 ENDIF 5357 5371 5358 5372 CASE ( 'm_soil' ) 5359 DO m = 1, surf_lsm_h%ns 5360 i = surf_lsm_h%i(m) 5361 j = surf_lsm_h%j(m) 5362 DO k = nzb_soil, nzt_soil 5363 m_soil_av(k,j,i) = m_soil_av(k,j,i) + m_soil_h%var_2d(k,m) 5373 IF ( ALLOCATED( m_soil_av ) ) THEN 5374 DO m = 1, surf_lsm_h%ns 5375 i = surf_lsm_h%i(m) 5376 j = surf_lsm_h%j(m) 5377 DO k = nzb_soil, nzt_soil 5378 m_soil_av(k,j,i) = m_soil_av(k,j,i) + m_soil_h%var_2d(k,m) 5379 ENDDO 5364 5380 ENDDO 5365 END DO5381 ENDIF 5366 5382 5367 5383 CASE ( 'qsws_liq*' ) 5368 DO m = 1, surf_lsm_h%ns 5369 i = surf_lsm_h%i(m) 5370 j = surf_lsm_h%j(m) 5371 qsws_liq_av(j,i) = qsws_liq_av(j,i) + & 5372 surf_lsm_h%qsws_liq(m) 5373 ENDDO 5384 IF ( ALLOCATED( qsws_liq_av ) ) THEN 5385 DO m = 1, surf_lsm_h%ns 5386 i = surf_lsm_h%i(m) 5387 j = surf_lsm_h%j(m) 5388 qsws_liq_av(j,i) = qsws_liq_av(j,i) + & 5389 surf_lsm_h%qsws_liq(m) 5390 ENDDO 5391 ENDIF 5374 5392 5375 5393 CASE ( 'qsws_soil*' ) 5376 DO m = 1, surf_lsm_h%ns 5377 i = surf_lsm_h%i(m) 5378 j = surf_lsm_h%j(m) 5379 qsws_soil_av(j,i) = qsws_soil_av(j,i) + & 5380 surf_lsm_h%qsws_soil(m) 5381 ENDDO 5394 IF ( ALLOCATED( qsws_soil_av ) ) THEN 5395 DO m = 1, surf_lsm_h%ns 5396 i = surf_lsm_h%i(m) 5397 j = surf_lsm_h%j(m) 5398 qsws_soil_av(j,i) = qsws_soil_av(j,i) + & 5399 surf_lsm_h%qsws_soil(m) 5400 ENDDO 5401 ENDIF 5382 5402 5383 5403 CASE ( 'qsws_veg*' ) 5384 DO m = 1, surf_lsm_h%ns 5385 i = surf_lsm_h%i(m) 5386 j = surf_lsm_h%j(m) 5387 qsws_veg_av(j,i) = qsws_veg_av(j,i) + & 5388 surf_lsm_h%qsws_veg(m) 5389 ENDDO 5404 IF ( ALLOCATED(qsws_veg_av ) ) THEN 5405 DO m = 1, surf_lsm_h%ns 5406 i = surf_lsm_h%i(m) 5407 j = surf_lsm_h%j(m) 5408 qsws_veg_av(j,i) = qsws_veg_av(j,i) + & 5409 surf_lsm_h%qsws_veg(m) 5410 ENDDO 5411 ENDIF 5390 5412 5391 5413 CASE ( 'r_s*' ) 5392 DO m = 1, surf_lsm_h%ns 5393 i = surf_lsm_h%i(m) 5394 j = surf_lsm_h%j(m) 5395 r_s_av(j,i) = r_s_av(j,i) + surf_lsm_h%r_s(m) 5396 ENDDO 5414 IF ( ALLOCATED( r_s_av) ) THEN 5415 DO m = 1, surf_lsm_h%ns 5416 i = surf_lsm_h%i(m) 5417 j = surf_lsm_h%j(m) 5418 r_s_av(j,i) = r_s_av(j,i) + surf_lsm_h%r_s(m) 5419 ENDDO 5420 ENDIF 5397 5421 5398 5422 CASE ( 't_soil' ) 5399 DO m = 1, surf_lsm_h%ns 5400 i = surf_lsm_h%i(m) 5401 j = surf_lsm_h%j(m) 5402 DO k = nzb_soil, nzt_soil 5403 t_soil_av(k,j,i) = t_soil_av(k,j,i) + t_soil_h%var_2d(k,m) 5423 IF ( ALLOCATED( t_soil_av ) ) THEN 5424 DO m = 1, surf_lsm_h%ns 5425 i = surf_lsm_h%i(m) 5426 j = surf_lsm_h%j(m) 5427 DO k = nzb_soil, nzt_soil 5428 t_soil_av(k,j,i) = t_soil_av(k,j,i) + t_soil_h%var_2d(k,m) 5429 ENDDO 5404 5430 ENDDO 5405 END DO5431 ENDIF 5406 5432 5407 5433 CASE DEFAULT … … 5415 5441 5416 5442 CASE ( 'c_liq*' ) 5417 DO i = nxl, nxr 5418 DO j = nys, nyn 5419 c_liq_av(j,i) = c_liq_av(j,i) & 5420 / REAL( average_count_3d, KIND=wp ) 5443 IF ( ALLOCATED( c_liq_av ) ) THEN 5444 DO i = nxl, nxr 5445 DO j = nys, nyn 5446 c_liq_av(j,i) = c_liq_av(j,i) & 5447 / REAL( average_count_3d, KIND=wp ) 5448 ENDDO 5421 5449 ENDDO 5422 END DO5450 ENDIF 5423 5451 5424 5452 CASE ( 'c_soil*' ) 5425 DO i = nxl, nxr 5426 DO j = nys, nyn 5427 c_soil_av(j,i) = c_soil_av(j,i) & 5453 IF ( ALLOCATED( c_soil_av ) ) THEN 5454 DO i = nxl, nxr 5455 DO j = nys, nyn 5456 c_soil_av(j,i) = c_soil_av(j,i) & 5457 / REAL( average_count_3d, KIND=wp ) 5458 ENDDO 5459 ENDDO 5460 ENDIF 5461 5462 CASE ( 'c_veg*' ) 5463 IF ( ALLOCATED( c_veg_av ) ) THEN 5464 DO i = nxl, nxr 5465 DO j = nys, nyn 5466 c_veg_av(j,i) = c_veg_av(j,i) & 5467 / REAL( average_count_3d, KIND=wp ) 5468 ENDDO 5469 ENDDO 5470 ENDIF 5471 5472 CASE ( 'lai*' ) 5473 IF ( ALLOCATED( lai_av ) ) THEN 5474 DO i = nxl, nxr 5475 DO j = nys, nyn 5476 lai_av(j,i) = lai_av(j,i) & 5428 5477 / REAL( average_count_3d, KIND=wp ) 5478 ENDDO 5429 5479 ENDDO 5430 ENDDO 5431 5432 CASE ( 'c_veg*' ) 5433 DO i = nxl, nxr 5434 DO j = nys, nyn 5435 c_veg_av(j,i) = c_veg_av(j,i) & 5436 / REAL( average_count_3d, KIND=wp ) 5480 ENDIF 5481 5482 CASE ( 'm_liq*' ) 5483 IF ( ALLOCATED( m_liq_av ) ) THEN 5484 DO i = nxl, nxr 5485 DO j = nys, nyn 5486 m_liq_av(j,i) = m_liq_av(j,i) & 5487 / REAL( average_count_3d, KIND=wp ) 5488 ENDDO 5437 5489 ENDDO 5438 ENDDO 5439 5440 CASE ( 'lai*' ) 5441 DO i = nxl, nxr 5442 DO j = nys, nyn 5443 lai_av(j,i) = lai_av(j,i) & 5444 / REAL( average_count_3d, KIND=wp ) 5490 ENDIF 5491 5492 CASE ( 'm_soil' ) 5493 IF ( ALLOCATED( m_soil_av ) ) THEN 5494 DO i = nxl, nxr 5495 DO j = nys, nyn 5496 DO k = nzb_soil, nzt_soil 5497 m_soil_av(k,j,i) = m_soil_av(k,j,i) & 5498 / REAL( average_count_3d, KIND=wp ) 5499 ENDDO 5500 ENDDO 5445 5501 ENDDO 5446 ENDDO 5447 5448 CASE ( 'm_liq*' ) 5449 DO i = nxl, nxr 5450 DO j = nys, nyn 5451 m_liq_av(j,i) = m_liq_av(j,i) & 5452 / REAL( average_count_3d, KIND=wp ) 5453 ENDDO 5454 ENDDO 5455 5456 CASE ( 'm_soil' ) 5457 DO i = nxl, nxr 5458 DO j = nys, nyn 5459 DO k = nzb_soil, nzt_soil 5460 m_soil_av(k,j,i) = m_soil_av(k,j,i) & 5502 ENDIF 5503 5504 CASE ( 'qsws_liq*' ) 5505 IF ( ALLOCATED( qsws_liq_av ) ) THEN 5506 DO i = nxl, nxr 5507 DO j = nys, nyn 5508 qsws_liq_av(j,i) = qsws_liq_av(j,i) & 5461 5509 / REAL( average_count_3d, KIND=wp ) 5462 5510 ENDDO 5463 5511 ENDDO 5464 ENDDO 5465 5466 CASE ( 'qsws_liq*' ) 5467 DO i = nxl, nxr 5468 DO j = nys, nyn 5469 qsws_liq_av(j,i) = qsws_liq_av(j,i) & 5470 / REAL( average_count_3d, KIND=wp ) 5512 ENDIF 5513 5514 CASE ( 'qsws_soil*' ) 5515 IF ( ALLOCATED( qsws_soil_av ) ) THEN 5516 DO i = nxl, nxr 5517 DO j = nys, nyn 5518 qsws_soil_av(j,i) = qsws_soil_av(j,i) & 5519 / REAL( average_count_3d, KIND=wp ) 5520 ENDDO 5471 5521 ENDDO 5472 ENDDO 5473 5474 CASE ( 'qsws_soil*' ) 5475 DO i = nxl, nxr 5476 DO j = nys, nyn 5477 qsws_soil_av(j,i) = qsws_soil_av(j,i) & 5478 / REAL( average_count_3d, KIND=wp ) 5479 ENDDO 5480 ENDDO 5522 ENDIF 5481 5523 5482 5524 CASE ( 'qsws_veg*' ) 5483 DO i = nxl, nxr 5484 DO j = nys, nyn 5485 qsws_veg_av(j,i) = qsws_veg_av(j,i) & 5486 / REAL( average_count_3d, KIND=wp ) 5487 ENDDO 5488 ENDDO 5489 5490 CASE ( 'r_s*' ) 5491 DO i = nxl, nxr 5492 DO j = nys, nyn 5493 r_s_av(j,i) = r_s_av(j,i) / REAL( average_count_3d, KIND=wp ) 5494 ENDDO 5495 ENDDO 5496 5497 CASE ( 't_soil' ) 5498 DO i = nxl, nxr 5499 DO j = nys, nyn 5500 DO k = nzb_soil, nzt_soil 5501 t_soil_av(k,j,i) = t_soil_av(k,j,i) & 5525 IF ( ALLOCATED( qsws_veg_av ) ) THEN 5526 DO i = nxl, nxr 5527 DO j = nys, nyn 5528 qsws_veg_av(j,i) = qsws_veg_av(j,i) & 5502 5529 / REAL( average_count_3d, KIND=wp ) 5503 5530 ENDDO 5504 5531 ENDDO 5505 ENDDO 5506 5532 ENDIF 5533 5534 CASE ( 'r_s*' ) 5535 IF ( ALLOCATED( r_s_av ) ) THEN 5536 DO i = nxl, nxr 5537 DO j = nys, nyn 5538 r_s_av(j,i) = r_s_av(j,i) & 5539 / REAL( average_count_3d, KIND=wp ) 5540 ENDDO 5541 ENDDO 5542 ENDIF 5543 5544 CASE ( 't_soil' ) 5545 IF ( ALLOCATED( t_soil_av ) ) THEN 5546 DO i = nxl, nxr 5547 DO j = nys, nyn 5548 DO k = nzb_soil, nzt_soil 5549 t_soil_av(k,j,i) = t_soil_av(k,j,i) & 5550 / REAL( average_count_3d, KIND=wp ) 5551 ENDDO 5552 ENDDO 5553 ENDDO 5554 ENDIF 5507 5555 ! 5508 5556 !-- … … 5581 5629 LOGICAL :: found !< 5582 5630 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 5631 5632 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 5583 5633 5584 5634 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< … … 5599 5649 ENDDO 5600 5650 ELSE 5651 IF ( .NOT. ALLOCATED( c_liq_av ) ) THEN 5652 ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) ) 5653 c_liq_av = REAL( fill_value, KIND = wp ) 5654 ENDIF 5601 5655 DO i = nxl, nxr 5602 5656 DO j = nys, nyn … … 5617 5671 ENDDO 5618 5672 ELSE 5673 IF ( .NOT. ALLOCATED( c_soil_av ) ) THEN 5674 ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) ) 5675 c_soil_av = REAL( fill_value, KIND = wp ) 5676 ENDIF 5619 5677 DO i = nxl, nxr 5620 5678 DO j = nys, nyn … … 5635 5693 ENDDO 5636 5694 ELSE 5695 IF ( .NOT. ALLOCATED( c_veg_av ) ) THEN 5696 ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) ) 5697 c_veg_av = REAL( fill_value, KIND = wp ) 5698 ENDIF 5637 5699 DO i = nxl, nxr 5638 5700 DO j = nys, nyn … … 5653 5715 ENDDO 5654 5716 ELSE 5717 IF ( .NOT. ALLOCATED( lai_av ) ) THEN 5718 ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) ) 5719 lai_av = REAL( fill_value, KIND = wp ) 5720 ENDIF 5655 5721 DO i = nxl, nxr 5656 5722 DO j = nys, nyn … … 5671 5737 ENDDO 5672 5738 ELSE 5739 IF ( .NOT. ALLOCATED( m_liq_av ) ) THEN 5740 ALLOCATE( m_liq_av(nysg:nyng,nxlg:nxrg) ) 5741 m_liq_av = REAL( fill_value, KIND = wp ) 5742 ENDIF 5673 5743 DO i = nxl, nxr 5674 5744 DO j = nys, nyn … … 5691 5761 ENDDO 5692 5762 ELSE 5763 IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN 5764 ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) 5765 m_soil_av = REAL( fill_value, KIND = wp ) 5766 ENDIF 5693 5767 DO i = nxl, nxr 5694 5768 DO j = nys, nyn … … 5713 5787 ENDDO 5714 5788 ELSE 5789 IF ( .NOT. ALLOCATED( qsws_liq_av ) ) THEN 5790 ALLOCATE( qsws_liq_av(nysg:nyng,nxlg:nxrg) ) 5791 qsws_liq_av = REAL( fill_value, KIND = wp ) 5792 ENDIF 5715 5793 DO i = nxl, nxr 5716 5794 DO j = nys, nyn … … 5731 5809 ENDDO 5732 5810 ELSE 5811 IF ( .NOT. ALLOCATED( qsws_soil_av ) ) THEN 5812 ALLOCATE( qsws_soil_av(nysg:nyng,nxlg:nxrg) ) 5813 qsws_soil_av = REAL( fill_value, KIND = wp ) 5814 ENDIF 5733 5815 DO i = nxl, nxr 5734 5816 DO j = nys, nyn … … 5749 5831 ENDDO 5750 5832 ELSE 5833 IF ( .NOT. ALLOCATED( qsws_veg_av ) ) THEN 5834 ALLOCATE( qsws_veg_av(nysg:nyng,nxlg:nxrg) ) 5835 qsws_veg_av = REAL( fill_value, KIND = wp ) 5836 ENDIF 5751 5837 DO i = nxl, nxr 5752 5838 DO j = nys, nyn … … 5768 5854 ENDDO 5769 5855 ELSE 5856 IF ( .NOT. ALLOCATED( r_s_av ) ) THEN 5857 ALLOCATE( r_s_av(nysg:nyng,nxlg:nxrg) ) 5858 r_s_av = REAL( fill_value, KIND = wp ) 5859 ENDIF 5770 5860 DO i = nxl, nxr 5771 5861 DO j = nys, nyn … … 5788 5878 ENDDO 5789 5879 ELSE 5880 IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN 5881 ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) 5882 t_soil_av = REAL( fill_value, KIND = wp ) 5883 ENDIF 5790 5884 DO i = nxl, nxr 5791 5885 DO j = nys, nyn … … 5834 5928 5835 5929 LOGICAL :: found !< 5930 5931 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 5836 5932 5837 5933 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_soil:nzt_soil) :: local_pf !< … … 5856 5952 ENDDO 5857 5953 ELSE 5954 IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN 5955 ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) 5956 m_soil_av = REAL( fill_value, KIND = wp ) 5957 ENDIF 5858 5958 DO i = nxl, nxr 5859 5959 DO j = nys, nyn … … 5876 5976 ENDDO 5877 5977 ELSE 5978 IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN 5979 ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) 5980 t_soil_av = REAL( fill_value, KIND = wp ) 5981 ENDIF 5878 5982 DO i = nxl, nxr 5879 5983 DO j = nys, nyn -
palm/trunk/SOURCE/modules.f90
r3003 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! precipitation_rate removed 28 ! 29 ! 3003 2018-04-23 10:22:58Z Giersch 27 30 ! The inversion height is defined as a global variable now which belongs to the 28 31 ! module statistics … … 689 692 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: mean_inflow_profiles !< used for turbulent inflow (non-cyclic boundary conditions) 690 693 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: precipitation_amount !< precipitation amount due to gravitational settling (bulk microphysics) 691 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: precipitation_rate !< precipitation rate (bulk microphysics)692 694 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: pt_slope_ref !< potential temperature in rotated coordinate system 693 695 !< (in case of sloped surface) … … 923 925 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ghf_av !< avg. ground heat flux 924 926 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: lwp_av !< avg. liquid water path 925 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: precipitation_rate_av !< avg. precipitation rate926 927 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ol_av !< avg. Obukhov length 927 928 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: qsws_av !< avg. surface moisture flux -
palm/trunk/SOURCE/netcdf_interface_mod.f90
r2964 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! .NOT. found in if-query added to account for variables found in tcm 28 ! 29 ! 2964 2018-04-12 16:04:03Z Giersch 27 30 ! Calculation of fixed number of output time levels for parallel netcdf output 28 31 ! has been moved completely to check_parameters … … 1476 1479 ! 1477 1480 !-- Check for land surface quantities 1478 IF ( land_surface ) THEN1481 IF ( .NOT. found .AND. land_surface ) THEN 1479 1482 CALL lsm_define_netcdf_grid( do3d(av,i), found, grid_x, & 1480 1483 grid_y, grid_z ) -
palm/trunk/SOURCE/radiation_model_mod.f90
r2995 r3004 28 28 ! ----------------- 29 29 ! $Id$ 30 ! Further allocation checks implemented (averaged data will be assigned to fill 31 ! values if no allocation happened so far) 32 ! 33 ! 2995 2018-04-19 12:13:16Z Giersch 30 34 ! IF-statement in radiation_init removed so that the calculation of radiative 31 35 ! fluxes at model start is done in any case, bugfix in … … 7323 7327 7324 7328 CASE ( 'rad_net*' ) 7325 DO i = nxl, nxr 7326 DO j = nys, nyn 7327 DO m = surf_lsm_h%start_index(j,i), surf_lsm_h%end_index(j,i) 7328 rad_net_av(j,i) = rad_net_av(j,i) + surf_lsm_h%rad_net(m) 7329 ENDDO 7330 DO m = surf_usm_h%start_index(j,i), surf_usm_h%end_index(j,i) 7331 rad_net_av(j,i) = rad_net_av(j,i) + surf_usm_h%rad_net(m) 7329 IF ( ALLOCATED( rad_net_av ) ) THEN 7330 DO i = nxl, nxr 7331 DO j = nys, nyn 7332 DO m = surf_lsm_h%start_index(j,i), surf_lsm_h%end_index(j,i) 7333 rad_net_av(j,i) = rad_net_av(j,i) + surf_lsm_h%rad_net(m) 7334 ENDDO 7335 DO m = surf_usm_h%start_index(j,i), surf_usm_h%end_index(j,i) 7336 rad_net_av(j,i) = rad_net_av(j,i) + surf_usm_h%rad_net(m) 7337 ENDDO 7332 7338 ENDDO 7333 7339 ENDDO 7334 END DO7340 ENDIF 7335 7341 7336 7342 CASE ( 'rad_lw_in' ) 7337 DO i = nxlg, nxrg 7338 DO j = nysg, nyng 7339 DO k = nzb, nzt+1 7340 rad_lw_in_av(k,j,i) = rad_lw_in_av(k,j,i) + rad_lw_in(k,j,i) 7343 IF ( ALLOCATED( rad_lw_in_av ) ) THEN 7344 DO i = nxlg, nxrg 7345 DO j = nysg, nyng 7346 DO k = nzb, nzt+1 7347 rad_lw_in_av(k,j,i) = rad_lw_in_av(k,j,i) & 7348 + rad_lw_in(k,j,i) 7349 ENDDO 7341 7350 ENDDO 7342 7351 ENDDO 7343 END DO7352 ENDIF 7344 7353 7345 7354 CASE ( 'rad_lw_out' ) 7346 DO i = nxlg, nxrg 7347 DO j = nysg, nyng 7348 DO k = nzb, nzt+1 7349 rad_lw_out_av(k,j,i) = rad_lw_out_av(k,j,i) & 7350 + rad_lw_out(k,j,i) 7355 IF ( ALLOCATED( rad_lw_out_av ) ) THEN 7356 DO i = nxlg, nxrg 7357 DO j = nysg, nyng 7358 DO k = nzb, nzt+1 7359 rad_lw_out_av(k,j,i) = rad_lw_out_av(k,j,i) & 7360 + rad_lw_out(k,j,i) 7361 ENDDO 7351 7362 ENDDO 7352 7363 ENDDO 7353 END DO7364 ENDIF 7354 7365 7355 7366 CASE ( 'rad_lw_cs_hr' ) 7356 DO i = nxlg, nxrg 7357 DO j = nysg, nyng 7358 DO k = nzb, nzt+1 7359 rad_lw_cs_hr_av(k,j,i) = rad_lw_cs_hr_av(k,j,i) & 7360 + rad_lw_cs_hr(k,j,i) 7367 IF ( ALLOCATED( rad_lw_cs_hr_av ) ) THEN 7368 DO i = nxlg, nxrg 7369 DO j = nysg, nyng 7370 DO k = nzb, nzt+1 7371 rad_lw_cs_hr_av(k,j,i) = rad_lw_cs_hr_av(k,j,i) & 7372 + rad_lw_cs_hr(k,j,i) 7373 ENDDO 7361 7374 ENDDO 7362 7375 ENDDO 7363 END DO7376 ENDIF 7364 7377 7365 7378 CASE ( 'rad_lw_hr' ) 7366 DO i = nxlg, nxrg 7367 DO j = nysg, nyng 7368 DO k = nzb, nzt+1 7369 rad_lw_hr_av(k,j,i) = rad_lw_hr_av(k,j,i) & 7370 + rad_lw_hr(k,j,i) 7379 IF ( ALLOCATED( rad_lw_hr_av ) ) THEN 7380 DO i = nxlg, nxrg 7381 DO j = nysg, nyng 7382 DO k = nzb, nzt+1 7383 rad_lw_hr_av(k,j,i) = rad_lw_hr_av(k,j,i) & 7384 + rad_lw_hr(k,j,i) 7385 ENDDO 7371 7386 ENDDO 7372 7387 ENDDO 7373 END DO7388 ENDIF 7374 7389 7375 7390 CASE ( 'rad_sw_in' ) 7376 DO i = nxlg, nxrg 7377 DO j = nysg, nyng 7378 DO k = nzb, nzt+1 7379 rad_sw_in_av(k,j,i) = rad_sw_in_av(k,j,i) & 7380 + rad_sw_in(k,j,i) 7391 IF ( ALLOCATED( rad_sw_in_av ) ) THEN 7392 DO i = nxlg, nxrg 7393 DO j = nysg, nyng 7394 DO k = nzb, nzt+1 7395 rad_sw_in_av(k,j,i) = rad_sw_in_av(k,j,i) & 7396 + rad_sw_in(k,j,i) 7397 ENDDO 7381 7398 ENDDO 7382 7399 ENDDO 7383 END DO7400 ENDIF 7384 7401 7385 7402 CASE ( 'rad_sw_out' ) 7386 DO i = nxlg, nxrg 7387 DO j = nysg, nyng 7388 DO k = nzb, nzt+1 7389 rad_sw_out_av(k,j,i) = rad_sw_out_av(k,j,i) & 7390 + rad_sw_out(k,j,i) 7403 IF ( ALLOCATED( rad_sw_out_av ) ) THEN 7404 DO i = nxlg, nxrg 7405 DO j = nysg, nyng 7406 DO k = nzb, nzt+1 7407 rad_sw_out_av(k,j,i) = rad_sw_out_av(k,j,i) & 7408 + rad_sw_out(k,j,i) 7409 ENDDO 7391 7410 ENDDO 7392 7411 ENDDO 7393 END DO7412 ENDIF 7394 7413 7395 7414 CASE ( 'rad_sw_cs_hr' ) 7396 DO i = nxlg, nxrg 7397 DO j = nysg, nyng 7398 DO k = nzb, nzt+1 7399 rad_sw_cs_hr_av(k,j,i) = rad_sw_cs_hr_av(k,j,i) & 7400 + rad_sw_cs_hr(k,j,i) 7415 IF ( ALLOCATED( rad_sw_cs_hr_av ) ) THEN 7416 DO i = nxlg, nxrg 7417 DO j = nysg, nyng 7418 DO k = nzb, nzt+1 7419 rad_sw_cs_hr_av(k,j,i) = rad_sw_cs_hr_av(k,j,i) & 7420 + rad_sw_cs_hr(k,j,i) 7421 ENDDO 7401 7422 ENDDO 7402 7423 ENDDO 7403 END DO7424 ENDIF 7404 7425 7405 7426 CASE ( 'rad_sw_hr' ) 7406 DO i = nxlg, nxrg 7407 DO j = nysg, nyng 7408 DO k = nzb, nzt+1 7409 rad_sw_hr_av(k,j,i) = rad_sw_hr_av(k,j,i) & 7410 + rad_sw_hr(k,j,i) 7427 IF ( ALLOCATED( rad_sw_hr_av ) ) THEN 7428 DO i = nxlg, nxrg 7429 DO j = nysg, nyng 7430 DO k = nzb, nzt+1 7431 rad_sw_hr_av(k,j,i) = rad_sw_hr_av(k,j,i) & 7432 + rad_sw_hr(k,j,i) 7433 ENDDO 7411 7434 ENDDO 7412 7435 ENDDO 7413 END DO7436 ENDIF 7414 7437 7415 7438 CASE DEFAULT … … 7423 7446 7424 7447 CASE ( 'rad_net*' ) 7425 DO i = nxlg, nxrg 7426 DO j = nysg, nyng 7427 rad_net_av(j,i) = rad_net_av(j,i) / REAL( average_count_3d, & 7428 KIND=wp ) 7429 ENDDO 7430 ENDDO 7431 7432 CASE ( 'rad_lw_in' ) 7433 DO i = nxlg, nxrg 7434 DO j = nysg, nyng 7435 DO k = nzb, nzt+1 7436 rad_lw_in_av(k,j,i) = rad_lw_in_av(k,j,i) & 7437 / REAL( average_count_3d, KIND=wp ) 7448 IF ( ALLOCATED( rad_net_av ) ) THEN 7449 DO i = nxlg, nxrg 7450 DO j = nysg, nyng 7451 rad_net_av(j,i) = rad_net_av(j,i) & 7452 / REAL( average_count_3d, KIND=wp ) 7438 7453 ENDDO 7439 7454 ENDDO 7440 ENDDO 7441 7442 CASE ( 'rad_lw_out' ) 7443 DO i = nxlg, nxrg 7444 DO j = nysg, nyng 7445 DO k = nzb, nzt+1 7446 rad_lw_out_av(k,j,i) = rad_lw_out_av(k,j,i) & 7447 / REAL( average_count_3d, KIND=wp ) 7455 ENDIF 7456 7457 CASE ( 'rad_lw_in' ) 7458 IF ( ALLOCATED( rad_lw_in_av ) ) THEN 7459 DO i = nxlg, nxrg 7460 DO j = nysg, nyng 7461 DO k = nzb, nzt+1 7462 rad_lw_in_av(k,j,i) = rad_lw_in_av(k,j,i) & 7463 / REAL( average_count_3d, KIND=wp ) 7464 ENDDO 7448 7465 ENDDO 7449 7466 ENDDO 7450 ENDDO 7451 7452 CASE ( 'rad_lw_cs_hr' ) 7453 DO i = nxlg, nxrg 7454 DO j = nysg, nyng 7455 DO k = nzb, nzt+1 7456 rad_lw_cs_hr_av(k,j,i) = rad_lw_cs_hr_av(k,j,i) & 7457 / REAL( average_count_3d, KIND=wp ) 7467 ENDIF 7468 7469 CASE ( 'rad_lw_out' ) 7470 IF ( ALLOCATED( rad_lw_out_av ) ) THEN 7471 DO i = nxlg, nxrg 7472 DO j = nysg, nyng 7473 DO k = nzb, nzt+1 7474 rad_lw_out_av(k,j,i) = rad_lw_out_av(k,j,i) & 7475 / REAL( average_count_3d, KIND=wp ) 7476 ENDDO 7458 7477 ENDDO 7459 7478 ENDDO 7460 ENDDO 7461 7462 CASE ( 'rad_lw_hr' ) 7463 DO i = nxlg, nxrg 7464 DO j = nysg, nyng 7465 DO k = nzb, nzt+1 7466 rad_lw_hr_av(k,j,i) = rad_lw_hr_av(k,j,i) & 7467 / REAL( average_count_3d, KIND=wp ) 7479 ENDIF 7480 7481 CASE ( 'rad_lw_cs_hr' ) 7482 IF ( ALLOCATED( rad_lw_cs_hr_av ) ) THEN 7483 DO i = nxlg, nxrg 7484 DO j = nysg, nyng 7485 DO k = nzb, nzt+1 7486 rad_lw_cs_hr_av(k,j,i) = rad_lw_cs_hr_av(k,j,i) & 7487 / REAL( average_count_3d, KIND=wp ) 7488 ENDDO 7468 7489 ENDDO 7469 7490 ENDDO 7470 ENDDO 7471 7472 CASE ( 'rad_sw_in' ) 7473 DO i = nxlg, nxrg 7474 DO j = nysg, nyng 7475 DO k = nzb, nzt+1 7476 rad_sw_in_av(k,j,i) = rad_sw_in_av(k,j,i) & 7477 / REAL( average_count_3d, KIND=wp ) 7491 ENDIF 7492 7493 CASE ( 'rad_lw_hr' ) 7494 IF ( ALLOCATED( rad_lw_hr_av ) ) THEN 7495 DO i = nxlg, nxrg 7496 DO j = nysg, nyng 7497 DO k = nzb, nzt+1 7498 rad_lw_hr_av(k,j,i) = rad_lw_hr_av(k,j,i) & 7499 / REAL( average_count_3d, KIND=wp ) 7500 ENDDO 7478 7501 ENDDO 7479 7502 ENDDO 7480 ENDDO 7481 7482 CASE ( 'rad_sw_out' ) 7483 DO i = nxlg, nxrg 7484 DO j = nysg, nyng 7485 DO k = nzb, nzt+1 7486 rad_sw_out_av(k,j,i) = rad_sw_out_av(k,j,i) & 7487 / REAL( average_count_3d, KIND=wp ) 7503 ENDIF 7504 7505 CASE ( 'rad_sw_in' ) 7506 IF ( ALLOCATED( rad_sw_in_av ) ) THEN 7507 DO i = nxlg, nxrg 7508 DO j = nysg, nyng 7509 DO k = nzb, nzt+1 7510 rad_sw_in_av(k,j,i) = rad_sw_in_av(k,j,i) & 7511 / REAL( average_count_3d, KIND=wp ) 7512 ENDDO 7488 7513 ENDDO 7489 7514 ENDDO 7490 ENDDO 7491 7492 CASE ( 'rad_sw_cs_hr' ) 7493 DO i = nxlg, nxrg 7494 DO j = nysg, nyng 7495 DO k = nzb, nzt+1 7496 rad_sw_cs_hr_av(k,j,i) = rad_sw_cs_hr_av(k,j,i) & 7497 / REAL( average_count_3d, KIND=wp ) 7515 ENDIF 7516 7517 CASE ( 'rad_sw_out' ) 7518 IF ( ALLOCATED( rad_sw_out_av ) ) THEN 7519 DO i = nxlg, nxrg 7520 DO j = nysg, nyng 7521 DO k = nzb, nzt+1 7522 rad_sw_out_av(k,j,i) = rad_sw_out_av(k,j,i) & 7523 / REAL( average_count_3d, KIND=wp ) 7524 ENDDO 7498 7525 ENDDO 7499 7526 ENDDO 7500 ENDDO 7501 7502 CASE ( 'rad_sw_hr' ) 7503 DO i = nxlg, nxrg 7504 DO j = nysg, nyng 7505 DO k = nzb, nzt+1 7506 rad_sw_hr_av(k,j,i) = rad_sw_hr_av(k,j,i) & 7507 / REAL( average_count_3d, KIND=wp ) 7527 ENDIF 7528 7529 CASE ( 'rad_sw_cs_hr' ) 7530 IF ( ALLOCATED( rad_sw_cs_hr_av ) ) THEN 7531 DO i = nxlg, nxrg 7532 DO j = nysg, nyng 7533 DO k = nzb, nzt+1 7534 rad_sw_cs_hr_av(k,j,i) = rad_sw_cs_hr_av(k,j,i) & 7535 / REAL( average_count_3d, KIND=wp ) 7536 ENDDO 7508 7537 ENDDO 7509 7538 ENDDO 7510 ENDDO 7539 ENDIF 7540 7541 CASE ( 'rad_sw_hr' ) 7542 IF ( ALLOCATED( rad_sw_hr_av ) ) THEN 7543 DO i = nxlg, nxrg 7544 DO j = nysg, nyng 7545 DO k = nzb, nzt+1 7546 rad_sw_hr_av(k,j,i) = rad_sw_hr_av(k,j,i) & 7547 / REAL( average_count_3d, KIND=wp ) 7548 ENDDO 7549 ENDDO 7550 ENDDO 7551 ENDIF 7511 7552 7512 7553 END SELECT … … 7598 7639 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 7599 7640 7641 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 7642 7600 7643 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< 7601 7644 … … 7624 7667 ENDDO 7625 7668 ELSE 7669 IF ( .NOT. ALLOCATED( rad_net_av ) ) THEN 7670 ALLOCATE( rad_net_av(nysg:nyng,nxlg:nxrg) ) 7671 rad_net_av = REAL( fill_value, KIND = wp ) 7672 ENDIF 7626 7673 DO i = nxl, nxr 7627 7674 DO j = nys, nyn … … 7644 7691 ENDDO 7645 7692 ELSE 7693 IF ( .NOT. ALLOCATED( rad_lw_in_av ) ) THEN 7694 ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 7695 rad_lw_in_av = REAL( fill_value, KIND = wp ) 7696 ENDIF 7646 7697 DO i = nxl, nxr 7647 7698 DO j = nys, nyn … … 7664 7715 ENDDO 7665 7716 ELSE 7717 IF ( .NOT. ALLOCATED( rad_lw_out_av ) ) THEN 7718 ALLOCATE( rad_lw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 7719 rad_lw_out_av = REAL( fill_value, KIND = wp ) 7720 ENDIF 7666 7721 DO i = nxl, nxr 7667 7722 DO j = nys, nyn … … 7684 7739 ENDDO 7685 7740 ELSE 7741 IF ( .NOT. ALLOCATED( rad_lw_cs_hr_av ) ) THEN 7742 ALLOCATE( rad_lw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 7743 rad_lw_cs_hr_av = REAL( fill_value, KIND = wp ) 7744 ENDIF 7686 7745 DO i = nxl, nxr 7687 7746 DO j = nys, nyn … … 7704 7763 ENDDO 7705 7764 ELSE 7765 IF ( .NOT. ALLOCATED( rad_lw_hr_av ) ) THEN 7766 ALLOCATE( rad_lw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 7767 rad_lw_hr_av= REAL( fill_value, KIND = wp ) 7768 ENDIF 7706 7769 DO i = nxl, nxr 7707 7770 DO j = nys, nyn … … 7724 7787 ENDDO 7725 7788 ELSE 7789 IF ( .NOT. ALLOCATED( rad_sw_in_av ) ) THEN 7790 ALLOCATE( rad_sw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 7791 rad_sw_in_av = REAL( fill_value, KIND = wp ) 7792 ENDIF 7726 7793 DO i = nxl, nxr 7727 7794 DO j = nys, nyn … … 7744 7811 ENDDO 7745 7812 ELSE 7813 IF ( .NOT. ALLOCATED( rad_sw_out_av ) ) THEN 7814 ALLOCATE( rad_sw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 7815 rad_sw_out_av = REAL( fill_value, KIND = wp ) 7816 ENDIF 7746 7817 DO i = nxl, nxr 7747 7818 DO j = nys, nyn … … 7764 7835 ENDDO 7765 7836 ELSE 7837 IF ( .NOT. ALLOCATED( rad_sw_cs_hr_av ) ) THEN 7838 ALLOCATE( rad_sw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 7839 rad_sw_cs_hr_av = REAL( fill_value, KIND = wp ) 7840 ENDIF 7766 7841 DO i = nxl, nxr 7767 7842 DO j = nys, nyn … … 7784 7859 ENDDO 7785 7860 ELSE 7861 IF ( .NOT. ALLOCATED( rad_sw_hr_av ) ) THEN 7862 ALLOCATE( rad_sw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 7863 rad_sw_hr_av = REAL( fill_value, KIND = wp ) 7864 ENDIF 7786 7865 DO i = nxl, nxr 7787 7866 DO j = nys, nyn … … 7827 7906 7828 7907 LOGICAL :: found !< 7908 7909 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 7829 7910 7830 7911 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< … … 7846 7927 ENDDO 7847 7928 ELSE 7929 IF ( .NOT. ALLOCATED( rad_sw_in_av ) ) THEN 7930 ALLOCATE( rad_sw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 7931 rad_sw_in_av = REAL( fill_value, KIND = wp ) 7932 ENDIF 7848 7933 DO i = nxl, nxr 7849 7934 DO j = nys, nyn … … 7865 7950 ENDDO 7866 7951 ELSE 7952 IF ( .NOT. ALLOCATED( rad_sw_out_av ) ) THEN 7953 ALLOCATE( rad_sw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 7954 rad_sw_out_av = REAL( fill_value, KIND = wp ) 7955 ENDIF 7867 7956 DO i = nxl, nxr 7868 7957 DO j = nys, nyn … … 7884 7973 ENDDO 7885 7974 ELSE 7975 IF ( .NOT. ALLOCATED( rad_sw_cs_hr_av ) ) THEN 7976 ALLOCATE( rad_sw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 7977 rad_sw_cs_hr_av = REAL( fill_value, KIND = wp ) 7978 ENDIF 7886 7979 DO i = nxl, nxr 7887 7980 DO j = nys, nyn … … 7903 7996 ENDDO 7904 7997 ELSE 7998 IF ( .NOT. ALLOCATED( rad_sw_hr_av ) ) THEN 7999 ALLOCATE( rad_sw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 8000 rad_sw_hr_av = REAL( fill_value, KIND = wp ) 8001 ENDIF 7905 8002 DO i = nxl, nxr 7906 8003 DO j = nys, nyn … … 7922 8019 ENDDO 7923 8020 ELSE 8021 IF ( .NOT. ALLOCATED( rad_lw_in_av ) ) THEN 8022 ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 8023 rad_lw_in_av = REAL( fill_value, KIND = wp ) 8024 ENDIF 7924 8025 DO i = nxl, nxr 7925 8026 DO j = nys, nyn … … 7941 8042 ENDDO 7942 8043 ELSE 8044 IF ( .NOT. ALLOCATED( rad_lw_out_av ) ) THEN 8045 ALLOCATE( rad_lw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 8046 rad_lw_out_av = REAL( fill_value, KIND = wp ) 8047 ENDIF 7943 8048 DO i = nxl, nxr 7944 8049 DO j = nys, nyn … … 7960 8065 ENDDO 7961 8066 ELSE 8067 IF ( .NOT. ALLOCATED( rad_lw_cs_hr_av ) ) THEN 8068 ALLOCATE( rad_lw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 8069 rad_lw_cs_hr_av = REAL( fill_value, KIND = wp ) 8070 ENDIF 7962 8071 DO i = nxl, nxr 7963 8072 DO j = nys, nyn … … 7979 8088 ENDDO 7980 8089 ELSE 8090 IF ( .NOT. ALLOCATED( rad_lw_hr_av ) ) THEN 8091 ALLOCATE( rad_lw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) 8092 rad_lw_hr_av = REAL( fill_value, KIND = wp ) 8093 ENDIF 7981 8094 DO i = nxl, nxr 7982 8095 DO j = nys, nyn -
palm/trunk/SOURCE/read_restart_data_mod.f90
r3003 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! precipitation_rate_av removed 28 ! 29 ! 3003 2018-04-23 10:22:58Z Giersch 27 30 ! z_i is also read to use the last known inversion height from the 28 31 ! initial run as the first inversion height which is written into the … … 1522 1525 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1523 1526 1524 CASE ( 'precipitation_rate_av' )1525 IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN1526 ALLOCATE( precipitation_rate_av(nysg:nyng,nxlg:nxrg) )1527 ENDIF1528 IF ( k == 1 ) READ ( 13 ) tmp_2d1529 precipitation_rate_av(nysc-nbgp:nync+nbgp, &1530 nxlc-nbgp:nxrc+nbgp) = &1531 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)1532 1533 1527 CASE ( 'pt' ) 1534 1528 IF ( k == 1 ) READ ( 13 ) tmp_3d -
palm/trunk/SOURCE/sum_up_3d_data.f90
r2963 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! prr field added to ONLY-list, prr* case/pr* case/precipitation_rate_av 28 ! removed, further allocation checks implemented 29 ! 30 ! 2963 2018-04-12 14:47:44Z suehring 27 31 ! Introduce index for vegetation/wall, pavement/green-wall and water/window 28 32 ! surfaces, for clearer access of surface fraction, albedo, emissivity, etc. . … … 182 186 183 187 USE arrays_3d, & 184 ONLY: dzw, e, heatflux_output_conversion, nc, nr, p, pt, & 185 precipitation_rate, q, qc, ql, ql_c, & 186 ql_v, qr, rho_ocean, s, sa, u, v, vpt, w, & 188 ONLY: dzw, e, heatflux_output_conversion, nc, nr, p, prr, pt, & 189 q, qc, ql, ql_c, ql_v, qr, rho_ocean, s, sa, u, v, vpt, w, & 187 190 waterflux_output_conversion 188 191 … … 190 193 ONLY: diss_av, e_av, ghf_av, kh_av, km_av, lpt_av, lwp_av, nc_av, & 191 194 nr_av, & 192 ol_av, p_av, pc_av, pr_av, prr_av, precipitation_rate_av, pt_av,& 193 q_av, qc_av, ql_av, ql_c_av, ql_v_av, ql_vp_av, qr_av, qsws_av, & 194 qv_av, r_a_av, rho_ocean_av, s_av, sa_av, shf_av, ssws_av, & 195 ts_av, tsurf_av, u_av, us_av, v_av, vpt_av, w_av, z0_av, z0h_av,& 196 z0q_av 195 ol_av, p_av, pc_av, pr_av, prr_av, pt_av, q_av, qc_av, ql_av, & 196 ql_c_av, ql_v_av, ql_vp_av, qr_av, qsws_av, qv_av, r_a_av, & 197 rho_ocean_av, s_av, sa_av, shf_av, ssws_av, ts_av, tsurf_av, & 198 u_av, us_av, v_av, vpt_av, w_av, z0_av, z0h_av, z0q_av 197 199 USE chemistry_model_mod, & 198 200 ONLY: chem_3d_data_averaging, chem_integrate, chem_species, nspec … … 342 344 prr_av = 0.0_wp 343 345 344 CASE ( 'prr*' )345 IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN346 ALLOCATE( precipitation_rate_av(nysg:nyng,nxlg:nxrg) )347 ENDIF348 precipitation_rate_av = 0.0_wp349 350 346 CASE ( 'pt' ) 351 347 IF ( .NOT. ALLOCATED( pt_av ) ) THEN … … 573 569 574 570 CASE ( 'ghf*' ) 575 DO m = 1, surf_lsm_h%ns 576 i = surf_lsm_h%i(m) 577 j = surf_lsm_h%j(m) 578 ghf_av(j,i) = ghf_av(j,i) + surf_lsm_h%ghf(m) 579 ENDDO 580 581 DO m = 1, surf_usm_h%ns 582 i = surf_usm_h%i(m) 583 j = surf_usm_h%j(m) 584 ghf_av(j,i) = ghf_av(j,i) + surf_usm_h%frac(ind_veg_wall,m) * & 585 surf_usm_h%wghf_eb(m) + & 586 surf_usm_h%frac(ind_pav_green,m) * & 587 surf_usm_h%wghf_eb_green(m) + & 588 surf_usm_h%frac(ind_wat_win,m) * & 589 surf_usm_h%wghf_eb_window(m) 590 ENDDO 571 IF ( ALLOCATED( ghf_av ) ) THEN 572 DO m = 1, surf_lsm_h%ns 573 i = surf_lsm_h%i(m) 574 j = surf_lsm_h%j(m) 575 ghf_av(j,i) = ghf_av(j,i) + surf_lsm_h%ghf(m) 576 ENDDO 577 578 DO m = 1, surf_usm_h%ns 579 i = surf_usm_h%i(m) 580 j = surf_usm_h%j(m) 581 ghf_av(j,i) = ghf_av(j,i) + surf_usm_h%frac(ind_veg_wall,m) * & 582 surf_usm_h%wghf_eb(m) + & 583 surf_usm_h%frac(ind_pav_green,m) * & 584 surf_usm_h%wghf_eb_green(m) + & 585 surf_usm_h%frac(ind_wat_win,m) * & 586 surf_usm_h%wghf_eb_window(m) 587 ENDDO 588 ENDIF 591 589 592 590 CASE ( 'e' ) 593 DO i = nxlg, nxrg 594 DO j = nysg, nyng 595 DO k = nzb, nzt+1 596 e_av(k,j,i) = e_av(k,j,i) + e(k,j,i) 597 ENDDO 598 ENDDO 599 ENDDO 591 IF ( ALLOCATED( e_av ) ) THEN 592 DO i = nxlg, nxrg 593 DO j = nysg, nyng 594 DO k = nzb, nzt+1 595 e_av(k,j,i) = e_av(k,j,i) + e(k,j,i) 596 ENDDO 597 ENDDO 598 ENDDO 599 ENDIF 600 600 601 601 CASE ( 'lpt' ) 602 DO i = nxlg, nxrg 603 DO j = nysg, nyng 604 DO k = nzb, nzt+1 605 lpt_av(k,j,i) = lpt_av(k,j,i) + pt(k,j,i) 606 ENDDO 607 ENDDO 608 ENDDO 602 IF ( ALLOCATED( lpt_av ) ) THEN 603 DO i = nxlg, nxrg 604 DO j = nysg, nyng 605 DO k = nzb, nzt+1 606 lpt_av(k,j,i) = lpt_av(k,j,i) + pt(k,j,i) 607 ENDDO 608 ENDDO 609 ENDDO 610 ENDIF 609 611 610 612 CASE ( 'lwp*' ) 611 DO i = nxlg, nxrg 612 DO j = nysg, nyng 613 lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) & 614 * dzw(1:nzt+1) ) * rho_surface 615 ENDDO 616 ENDDO 613 IF ( ALLOCATED( lwp_av ) ) THEN 614 DO i = nxlg, nxrg 615 DO j = nysg, nyng 616 lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) & 617 * dzw(1:nzt+1) ) * rho_surface 618 ENDDO 619 ENDDO 620 ENDIF 617 621 618 622 CASE ( 'nc' ) 619 DO i = nxlg, nxrg 620 DO j = nysg, nyng 621 DO k = nzb, nzt+1 622 nc_av(k,j,i) = nc_av(k,j,i) + nc(k,j,i) 623 ENDDO 624 ENDDO 625 ENDDO 623 IF ( ALLOCATED( nc_av ) ) THEN 624 DO i = nxlg, nxrg 625 DO j = nysg, nyng 626 DO k = nzb, nzt+1 627 nc_av(k,j,i) = nc_av(k,j,i) + nc(k,j,i) 628 ENDDO 629 ENDDO 630 ENDDO 631 ENDIF 626 632 627 633 CASE ( 'nr' ) 628 DO i = nxlg, nxrg 629 DO j = nysg, nyng 630 DO k = nzb, nzt+1 631 nr_av(k,j,i) = nr_av(k,j,i) + nr(k,j,i) 632 ENDDO 633 ENDDO 634 ENDDO 634 IF ( ALLOCATED( nr_av ) ) THEN 635 DO i = nxlg, nxrg 636 DO j = nysg, nyng 637 DO k = nzb, nzt+1 638 nr_av(k,j,i) = nr_av(k,j,i) + nr(k,j,i) 639 ENDDO 640 ENDDO 641 ENDDO 642 ENDIF 635 643 636 644 CASE ( 'ol*' ) 637 DO m = 1, surf_def_h(0)%ns 638 i = surf_def_h(0)%i(m) 639 j = surf_def_h(0)%j(m) 640 ol_av(j,i) = ol_av(j,i) + surf_def_h(0)%ol(m) 641 ENDDO 642 DO m = 1, surf_lsm_h%ns 643 i = surf_lsm_h%i(m) 644 j = surf_lsm_h%j(m) 645 ol_av(j,i) = ol_av(j,i) + surf_lsm_h%ol(m) 646 ENDDO 647 DO m = 1, surf_usm_h%ns 648 i = surf_usm_h%i(m) 649 j = surf_usm_h%j(m) 650 ol_av(j,i) = ol_av(j,i) + surf_usm_h%ol(m) 651 ENDDO 645 IF ( ALLOCATED( ol_av ) ) THEN 646 DO m = 1, surf_def_h(0)%ns 647 i = surf_def_h(0)%i(m) 648 j = surf_def_h(0)%j(m) 649 ol_av(j,i) = ol_av(j,i) + surf_def_h(0)%ol(m) 650 ENDDO 651 DO m = 1, surf_lsm_h%ns 652 i = surf_lsm_h%i(m) 653 j = surf_lsm_h%j(m) 654 ol_av(j,i) = ol_av(j,i) + surf_lsm_h%ol(m) 655 ENDDO 656 DO m = 1, surf_usm_h%ns 657 i = surf_usm_h%i(m) 658 j = surf_usm_h%j(m) 659 ol_av(j,i) = ol_av(j,i) + surf_usm_h%ol(m) 660 ENDDO 661 ENDIF 652 662 653 663 CASE ( 'p' ) 654 DO i = nxlg, nxrg 655 DO j = nysg, nyng 656 DO k = nzb, nzt+1 657 p_av(k,j,i) = p_av(k,j,i) + p(k,j,i) 658 ENDDO 659 ENDDO 660 ENDDO 664 IF ( ALLOCATED( p_av ) ) THEN 665 DO i = nxlg, nxrg 666 DO j = nysg, nyng 667 DO k = nzb, nzt+1 668 p_av(k,j,i) = p_av(k,j,i) + p(k,j,i) 669 ENDDO 670 ENDDO 671 ENDDO 672 ENDIF 661 673 662 674 CASE ( 'pc' ) 663 DO i = nxl, nxr 664 DO j = nys, nyn 665 DO k = nzb, nzt+1 666 pc_av(k,j,i) = pc_av(k,j,i) + prt_count(k,j,i) 667 ENDDO 668 ENDDO 669 ENDDO 675 IF ( ALLOCATED( pc_av ) ) THEN 676 DO i = nxl, nxr 677 DO j = nys, nyn 678 DO k = nzb, nzt+1 679 pc_av(k,j,i) = pc_av(k,j,i) + prt_count(k,j,i) 680 ENDDO 681 ENDDO 682 ENDDO 683 ENDIF 670 684 671 685 CASE ( 'pr' ) 672 DO i = nxl, nxr 673 DO j = nys, nyn 674 DO k = nzb, nzt+1 675 number_of_particles = prt_count(k,j,i) 676 IF ( number_of_particles <= 0 ) CYCLE 677 particles => grid_particles(k,j,i)%particles(1:number_of_particles) 678 s_r2 = 0.0_wp 679 s_r3 = 0.0_wp 680 681 DO n = 1, number_of_particles 682 IF ( particles(n)%particle_mask ) THEN 683 s_r2 = s_r2 + particles(n)%radius**2 * & 684 particles(n)%weight_factor 685 s_r3 = s_r3 + particles(n)%radius**3 * & 686 particles(n)%weight_factor 686 IF ( ALLOCATED( pr_av ) ) THEN 687 DO i = nxl, nxr 688 DO j = nys, nyn 689 DO k = nzb, nzt+1 690 number_of_particles = prt_count(k,j,i) 691 IF ( number_of_particles <= 0 ) CYCLE 692 particles => & 693 grid_particles(k,j,i)%particles(1:number_of_particles) 694 s_r2 = 0.0_wp 695 s_r3 = 0.0_wp 696 697 DO n = 1, number_of_particles 698 IF ( particles(n)%particle_mask ) THEN 699 s_r2 = s_r2 + particles(n)%radius**2 * & 700 particles(n)%weight_factor 701 s_r3 = s_r3 + particles(n)%radius**3 * & 702 particles(n)%weight_factor 703 ENDIF 704 ENDDO 705 706 IF ( s_r2 > 0.0_wp ) THEN 707 mean_r = s_r3 / s_r2 708 ELSE 709 mean_r = 0.0_wp 687 710 ENDIF 688 ENDDO 689 690 IF ( s_r2 > 0.0_wp ) THEN 691 mean_r = s_r3 / s_r2 692 ELSE 693 mean_r = 0.0_wp 694 ENDIF 695 pr_av(k,j,i) = pr_av(k,j,i) + mean_r 696 ENDDO 697 ENDDO 698 ENDDO 699 700 701 CASE ( 'pr*' ) 702 DO i = nxlg, nxrg 703 DO j = nysg, nyng 704 precipitation_rate_av(j,i) = precipitation_rate_av(j,i) + & 705 precipitation_rate(j,i) 706 ENDDO 707 ENDDO 711 pr_av(k,j,i) = pr_av(k,j,i) + mean_r 712 ENDDO 713 ENDDO 714 ENDDO 715 ENDIF 716 717 CASE ( 'prr' ) 718 IF ( ALLOCATED( prr_av ) ) THEN 719 DO i = nxlg, nxrg 720 DO j = nysg, nyng 721 DO k = nzb, nzt+1 722 prr_av(k,j,i) = prr_av(k,j,i) + prr(k,j,i) 723 ENDDO 724 ENDDO 725 ENDDO 726 ENDIF 708 727 709 728 CASE ( 'pt' ) 710 IF ( .NOT. cloud_physics ) THEN 711 DO i = nxlg, nxrg 712 DO j = nysg, nyng 713 DO k = nzb, nzt+1 714 pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) 715 ENDDO 716 ENDDO 717 ENDDO 718 ELSE 719 DO i = nxlg, nxrg 720 DO j = nysg, nyng 721 DO k = nzb, nzt+1 722 pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) + l_d_cp * & 723 pt_d_t(k) * ql(k,j,i) 724 ENDDO 725 ENDDO 726 ENDDO 729 IF ( ALLOCATED( pt_av ) ) THEN 730 IF ( .NOT. cloud_physics ) THEN 731 DO i = nxlg, nxrg 732 DO j = nysg, nyng 733 DO k = nzb, nzt+1 734 pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) 735 ENDDO 736 ENDDO 737 ENDDO 738 ELSE 739 DO i = nxlg, nxrg 740 DO j = nysg, nyng 741 DO k = nzb, nzt+1 742 pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) + l_d_cp * & 743 pt_d_t(k) * ql(k,j,i) 744 ENDDO 745 ENDDO 746 ENDDO 747 ENDIF 727 748 ENDIF 728 749 729 750 CASE ( 'q' ) 730 DO i = nxlg, nxrg 731 DO j = nysg, nyng 732 DO k = nzb, nzt+1 733 q_av(k,j,i) = q_av(k,j,i) + q(k,j,i) 734 ENDDO 735 ENDDO 736 ENDDO 751 IF ( ALLOCATED( q_av ) ) THEN 752 DO i = nxlg, nxrg 753 DO j = nysg, nyng 754 DO k = nzb, nzt+1 755 q_av(k,j,i) = q_av(k,j,i) + q(k,j,i) 756 ENDDO 757 ENDDO 758 ENDDO 759 ENDIF 737 760 738 761 CASE ( 'qc' ) 739 DO i = nxlg, nxrg 740 DO j = nysg, nyng 741 DO k = nzb, nzt+1 742 qc_av(k,j,i) = qc_av(k,j,i) + qc(k,j,i) 743 ENDDO 744 ENDDO 745 ENDDO 762 IF ( ALLOCATED( qc_av ) ) THEN 763 DO i = nxlg, nxrg 764 DO j = nysg, nyng 765 DO k = nzb, nzt+1 766 qc_av(k,j,i) = qc_av(k,j,i) + qc(k,j,i) 767 ENDDO 768 ENDDO 769 ENDDO 770 ENDIF 746 771 747 772 CASE ( 'ql' ) 748 DO i = nxlg, nxrg 749 DO j = nysg, nyng 750 DO k = nzb, nzt+1 751 ql_av(k,j,i) = ql_av(k,j,i) + ql(k,j,i) 752 ENDDO 753 ENDDO 754 ENDDO 773 IF ( ALLOCATED( ql_av ) ) THEN 774 DO i = nxlg, nxrg 775 DO j = nysg, nyng 776 DO k = nzb, nzt+1 777 ql_av(k,j,i) = ql_av(k,j,i) + ql(k,j,i) 778 ENDDO 779 ENDDO 780 ENDDO 781 ENDIF 755 782 756 783 CASE ( 'ql_c' ) 757 DO i = nxlg, nxrg 758 DO j = nysg, nyng 759 DO k = nzb, nzt+1 760 ql_c_av(k,j,i) = ql_c_av(k,j,i) + ql_c(k,j,i) 761 ENDDO 762 ENDDO 763 ENDDO 784 IF ( ALLOCATED( ql_c_av ) ) THEN 785 DO i = nxlg, nxrg 786 DO j = nysg, nyng 787 DO k = nzb, nzt+1 788 ql_c_av(k,j,i) = ql_c_av(k,j,i) + ql_c(k,j,i) 789 ENDDO 790 ENDDO 791 ENDDO 792 ENDIF 764 793 765 794 CASE ( 'ql_v' ) 766 DO i = nxlg, nxrg 767 DO j = nysg, nyng 768 DO k = nzb, nzt+1 769 ql_v_av(k,j,i) = ql_v_av(k,j,i) + ql_v(k,j,i) 770 ENDDO 771 ENDDO 772 ENDDO 795 IF ( ALLOCATED( ql_v_av ) ) THEN 796 DO i = nxlg, nxrg 797 DO j = nysg, nyng 798 DO k = nzb, nzt+1 799 ql_v_av(k,j,i) = ql_v_av(k,j,i) + ql_v(k,j,i) 800 ENDDO 801 ENDDO 802 ENDDO 803 ENDIF 773 804 774 805 CASE ( 'ql_vp' ) 775 DO i = nxl, nxr 776 DO j = nys, nyn 777 DO k = nzb, nzt+1 778 number_of_particles = prt_count(k,j,i) 779 IF ( number_of_particles <= 0 ) CYCLE 780 particles => grid_particles(k,j,i)%particles(1:number_of_particles) 781 DO n = 1, number_of_particles 782 IF ( particles(n)%particle_mask ) THEN 783 ql_vp_av(k,j,i) = ql_vp_av(k,j,i) + & 784 particles(n)%weight_factor / & 785 number_of_particles 786 ENDIF 787 ENDDO 788 ENDDO 789 ENDDO 790 ENDDO 806 IF ( ALLOCATED( ql_vp_av ) ) THEN 807 DO i = nxl, nxr 808 DO j = nys, nyn 809 DO k = nzb, nzt+1 810 number_of_particles = prt_count(k,j,i) 811 IF ( number_of_particles <= 0 ) CYCLE 812 particles => & 813 grid_particles(k,j,i)%particles(1:number_of_particles) 814 DO n = 1, number_of_particles 815 IF ( particles(n)%particle_mask ) THEN 816 ql_vp_av(k,j,i) = ql_vp_av(k,j,i) + & 817 particles(n)%weight_factor / & 818 number_of_particles 819 ENDIF 820 ENDDO 821 ENDDO 822 ENDDO 823 ENDDO 824 ENDIF 791 825 792 826 CASE ( 'qr' ) 793 DO i = nxlg, nxrg 794 DO j = nysg, nyng 795 DO k = nzb, nzt+1 796 qr_av(k,j,i) = qr_av(k,j,i) + qr(k,j,i) 797 ENDDO 798 ENDDO 799 ENDDO 827 IF ( ALLOCATED( qr_av ) ) THEN 828 DO i = nxlg, nxrg 829 DO j = nysg, nyng 830 DO k = nzb, nzt+1 831 qr_av(k,j,i) = qr_av(k,j,i) + qr(k,j,i) 832 ENDDO 833 ENDDO 834 ENDDO 835 ENDIF 800 836 801 837 CASE ( 'qsws*' ) … … 804 840 !-- In case of land- and urban-surfaces, convert fluxes into 805 841 !-- dynamic units. 806 DO m = 1, surf_def_h(0)%ns 807 i = surf_def_h(0)%i(m) 808 j = surf_def_h(0)%j(m) 809 k = surf_def_h(0)%k(m) 810 qsws_av(j,i) = qsws_av(j,i) + surf_def_h(0)%qsws(m) * & 811 waterflux_output_conversion(k) 812 ENDDO 813 DO m = 1, surf_lsm_h%ns 814 i = surf_lsm_h%i(m) 815 j = surf_lsm_h%j(m) 816 qsws_av(j,i) = qsws_av(j,i) + surf_lsm_h%qsws(m) * l_v 817 ENDDO 818 DO m = 1, surf_usm_h%ns 819 i = surf_usm_h%i(m) 820 j = surf_usm_h%j(m) 821 qsws_av(j,i) = qsws_av(j,i) + surf_usm_h%qsws(m) * l_v 822 ENDDO 842 IF ( ALLOCATED( qsws_av ) ) THEN 843 DO m = 1, surf_def_h(0)%ns 844 i = surf_def_h(0)%i(m) 845 j = surf_def_h(0)%j(m) 846 k = surf_def_h(0)%k(m) 847 qsws_av(j,i) = qsws_av(j,i) + surf_def_h(0)%qsws(m) * & 848 waterflux_output_conversion(k) 849 ENDDO 850 DO m = 1, surf_lsm_h%ns 851 i = surf_lsm_h%i(m) 852 j = surf_lsm_h%j(m) 853 qsws_av(j,i) = qsws_av(j,i) + surf_lsm_h%qsws(m) * l_v 854 ENDDO 855 DO m = 1, surf_usm_h%ns 856 i = surf_usm_h%i(m) 857 j = surf_usm_h%j(m) 858 qsws_av(j,i) = qsws_av(j,i) + surf_usm_h%qsws(m) * l_v 859 ENDDO 860 ENDIF 823 861 824 862 CASE ( 'qv' ) 825 DO i = nxlg, nxrg 826 DO j = nysg, nyng 827 DO k = nzb, nzt+1 828 qv_av(k,j,i) = qv_av(k,j,i) + q(k,j,i) - ql(k,j,i) 829 ENDDO 830 ENDDO 831 ENDDO 863 IF ( ALLOCATED( qv_av ) ) THEN 864 DO i = nxlg, nxrg 865 DO j = nysg, nyng 866 DO k = nzb, nzt+1 867 qv_av(k,j,i) = qv_av(k,j,i) + q(k,j,i) - ql(k,j,i) 868 ENDDO 869 ENDDO 870 ENDDO 871 ENDIF 832 872 833 873 CASE ( 'r_a*' ) 834 DO m = 1, surf_lsm_h%ns 835 i = surf_lsm_h%i(m) 836 j = surf_lsm_h%j(m) 837 r_a_av(j,i) = r_a_av(j,i) + surf_lsm_h%r_a(m) 838 ENDDO 839 ! 840 !-- Please note, resistance is also applied at urban-type surfaces, 841 !-- and is output only as a single variable. Here, tile approach is 842 !-- already implemented, so for each surface fraction resistance 843 !-- need to be summed-up. 844 DO m = 1, surf_usm_h%ns 845 i = surf_usm_h%i(m) 846 j = surf_usm_h%j(m) 847 r_a_av(j,i) = r_a_av(j,i) + & 848 ( surf_usm_h%frac(ind_veg_wall,m) * & 849 surf_usm_h%r_a(m) + & 850 surf_usm_h%frac(ind_pav_green,m) * & 851 surf_usm_h%r_a_green(m) + & 852 surf_usm_h%frac(ind_wat_win,m) * & 853 surf_usm_h%r_a_window(m) ) 854 ENDDO 874 IF ( ALLOCATED( r_a_av ) ) THEN 875 DO m = 1, surf_lsm_h%ns 876 i = surf_lsm_h%i(m) 877 j = surf_lsm_h%j(m) 878 r_a_av(j,i) = r_a_av(j,i) + surf_lsm_h%r_a(m) 879 ENDDO 880 ! 881 !-- Please note, resistance is also applied at urban-type surfaces, 882 !-- and is output only as a single variable. Here, tile approach is 883 !-- already implemented, so for each surface fraction resistance 884 !-- need to be summed-up. 885 DO m = 1, surf_usm_h%ns 886 i = surf_usm_h%i(m) 887 j = surf_usm_h%j(m) 888 r_a_av(j,i) = r_a_av(j,i) + & 889 ( surf_usm_h%frac(ind_veg_wall,m) * & 890 surf_usm_h%r_a(m) + & 891 surf_usm_h%frac(ind_pav_green,m) * & 892 surf_usm_h%r_a_green(m) + & 893 surf_usm_h%frac(ind_wat_win,m) * & 894 surf_usm_h%r_a_window(m) ) 895 ENDDO 896 ENDIF 855 897 856 898 CASE ( 'rho_ocean' ) 857 DO i = nxlg, nxrg 858 DO j = nysg, nyng 859 DO k = nzb, nzt+1 860 rho_ocean_av(k,j,i) = rho_ocean_av(k,j,i) + rho_ocean(k,j,i) 861 ENDDO 862 ENDDO 863 ENDDO 899 IF ( ALLOCATED( rho_ocean_av ) ) THEN 900 DO i = nxlg, nxrg 901 DO j = nysg, nyng 902 DO k = nzb, nzt+1 903 rho_ocean_av(k,j,i) = rho_ocean_av(k,j,i) + rho_ocean(k,j,i) 904 ENDDO 905 ENDDO 906 ENDDO 907 ENDIF 864 908 865 909 CASE ( 's' ) 866 DO i = nxlg, nxrg 867 DO j = nysg, nyng 868 DO k = nzb, nzt+1 869 s_av(k,j,i) = s_av(k,j,i) + s(k,j,i) 870 ENDDO 871 ENDDO 872 ENDDO 910 IF ( ALLOCATED( s_av ) ) THEN 911 DO i = nxlg, nxrg 912 DO j = nysg, nyng 913 DO k = nzb, nzt+1 914 s_av(k,j,i) = s_av(k,j,i) + s(k,j,i) 915 ENDDO 916 ENDDO 917 ENDDO 918 ENDIF 873 919 874 920 CASE ( 'sa' ) 875 DO i = nxlg, nxrg 876 DO j = nysg, nyng 877 DO k = nzb, nzt+1 878 sa_av(k,j,i) = sa_av(k,j,i) + sa(k,j,i) 879 ENDDO 880 ENDDO 881 ENDDO 921 IF ( ALLOCATED( sa_av ) ) THEN 922 DO i = nxlg, nxrg 923 DO j = nysg, nyng 924 DO k = nzb, nzt+1 925 sa_av(k,j,i) = sa_av(k,j,i) + sa(k,j,i) 926 ENDDO 927 ENDDO 928 ENDDO 929 ENDIF 882 930 883 931 CASE ( 'shf*' ) … … 886 934 !-- In case of land- and urban-surfaces, convert fluxes into 887 935 !-- dynamic units. 888 DO m = 1, surf_def_h(0)%ns 889 i = surf_def_h(0)%i(m) 890 j = surf_def_h(0)%j(m) 891 k = surf_def_h(0)%k(m) 892 shf_av(j,i) = shf_av(j,i) + surf_def_h(0)%shf(m) * & 893 heatflux_output_conversion(k) 894 ENDDO 895 DO m = 1, surf_lsm_h%ns 896 i = surf_lsm_h%i(m) 897 j = surf_lsm_h%j(m) 898 shf_av(j,i) = shf_av(j,i) + surf_lsm_h%shf(m) * cp 899 ENDDO 900 DO m = 1, surf_usm_h%ns 901 i = surf_usm_h%i(m) 902 j = surf_usm_h%j(m) 903 shf_av(j,i) = shf_av(j,i) + surf_usm_h%shf(m) * cp 904 ENDDO 936 IF ( ALLOCATED( shf_av ) ) THEN 937 DO m = 1, surf_def_h(0)%ns 938 i = surf_def_h(0)%i(m) 939 j = surf_def_h(0)%j(m) 940 k = surf_def_h(0)%k(m) 941 shf_av(j,i) = shf_av(j,i) + surf_def_h(0)%shf(m) * & 942 heatflux_output_conversion(k) 943 ENDDO 944 DO m = 1, surf_lsm_h%ns 945 i = surf_lsm_h%i(m) 946 j = surf_lsm_h%j(m) 947 shf_av(j,i) = shf_av(j,i) + surf_lsm_h%shf(m) * cp 948 ENDDO 949 DO m = 1, surf_usm_h%ns 950 i = surf_usm_h%i(m) 951 j = surf_usm_h%j(m) 952 shf_av(j,i) = shf_av(j,i) + surf_usm_h%shf(m) * cp 953 ENDDO 954 ENDIF 905 955 906 956 CASE ( 'ssws*' ) 907 DO m = 1, surf_def_h(0)%ns 908 i = surf_def_h(0)%i(m) 909 j = surf_def_h(0)%j(m) 910 ssws_av(j,i) = ssws_av(j,i) + surf_def_h(0)%ssws(m) 911 ENDDO 912 DO m = 1, surf_lsm_h%ns 913 i = surf_lsm_h%i(m) 914 j = surf_lsm_h%j(m) 915 ssws_av(j,i) = ssws_av(j,i) + surf_lsm_h%ssws(m) 916 ENDDO 917 DO m = 1, surf_usm_h%ns 918 i = surf_usm_h%i(m) 919 j = surf_usm_h%j(m) 920 ssws_av(j,i) = ssws_av(j,i) + surf_usm_h%ssws(m) 921 ENDDO 957 IF ( ALLOCATED( ssws_av ) ) THEN 958 DO m = 1, surf_def_h(0)%ns 959 i = surf_def_h(0)%i(m) 960 j = surf_def_h(0)%j(m) 961 ssws_av(j,i) = ssws_av(j,i) + surf_def_h(0)%ssws(m) 962 ENDDO 963 DO m = 1, surf_lsm_h%ns 964 i = surf_lsm_h%i(m) 965 j = surf_lsm_h%j(m) 966 ssws_av(j,i) = ssws_av(j,i) + surf_lsm_h%ssws(m) 967 ENDDO 968 DO m = 1, surf_usm_h%ns 969 i = surf_usm_h%i(m) 970 j = surf_usm_h%j(m) 971 ssws_av(j,i) = ssws_av(j,i) + surf_usm_h%ssws(m) 972 ENDDO 973 ENDIF 922 974 923 975 CASE ( 't*' ) 924 DO m = 1, surf_def_h(0)%ns 925 i = surf_def_h(0)%i(m) 926 j = surf_def_h(0)%j(m) 927 ts_av(j,i) = ts_av(j,i) + surf_def_h(0)%ts(m) 928 ENDDO 929 DO m = 1, surf_lsm_h%ns 930 i = surf_lsm_h%i(m) 931 j = surf_lsm_h%j(m) 932 ts_av(j,i) = ts_av(j,i) + surf_lsm_h%ts(m) 933 ENDDO 934 DO m = 1, surf_usm_h%ns 935 i = surf_usm_h%i(m) 936 j = surf_usm_h%j(m) 937 ts_av(j,i) = ts_av(j,i) + surf_usm_h%ts(m) 938 ENDDO 976 IF ( ALLOCATED( ts_av ) ) THEN 977 DO m = 1, surf_def_h(0)%ns 978 i = surf_def_h(0)%i(m) 979 j = surf_def_h(0)%j(m) 980 ts_av(j,i) = ts_av(j,i) + surf_def_h(0)%ts(m) 981 ENDDO 982 DO m = 1, surf_lsm_h%ns 983 i = surf_lsm_h%i(m) 984 j = surf_lsm_h%j(m) 985 ts_av(j,i) = ts_av(j,i) + surf_lsm_h%ts(m) 986 ENDDO 987 DO m = 1, surf_usm_h%ns 988 i = surf_usm_h%i(m) 989 j = surf_usm_h%j(m) 990 ts_av(j,i) = ts_av(j,i) + surf_usm_h%ts(m) 991 ENDDO 992 ENDIF 939 993 940 994 CASE ( 'tsurf*' ) 941 DO m = 1, surf_def_h(0)%ns 942 i = surf_def_h(0)%i(m) 943 j = surf_def_h(0)%j(m) 944 tsurf_av(j,i) = tsurf_av(j,i) + surf_def_h(0)%pt_surface(m) 945 ENDDO 946 947 DO m = 1, surf_lsm_h%ns 948 i = surf_lsm_h%i(m) 949 j = surf_lsm_h%j(m) 950 tsurf_av(j,i) = tsurf_av(j,i) + surf_lsm_h%pt_surface(m) 951 ENDDO 952 953 DO m = 1, surf_usm_h%ns 954 i = surf_usm_h%i(m) 955 j = surf_usm_h%j(m) 956 tsurf_av(j,i) = tsurf_av(j,i) + surf_usm_h%pt_surface(m) 957 ENDDO 995 IF ( ALLOCATED( tsurf_av ) ) THEN 996 DO m = 1, surf_def_h(0)%ns 997 i = surf_def_h(0)%i(m) 998 j = surf_def_h(0)%j(m) 999 tsurf_av(j,i) = tsurf_av(j,i) + surf_def_h(0)%pt_surface(m) 1000 ENDDO 1001 1002 DO m = 1, surf_lsm_h%ns 1003 i = surf_lsm_h%i(m) 1004 j = surf_lsm_h%j(m) 1005 tsurf_av(j,i) = tsurf_av(j,i) + surf_lsm_h%pt_surface(m) 1006 ENDDO 1007 1008 DO m = 1, surf_usm_h%ns 1009 i = surf_usm_h%i(m) 1010 j = surf_usm_h%j(m) 1011 tsurf_av(j,i) = tsurf_av(j,i) + surf_usm_h%pt_surface(m) 1012 ENDDO 1013 ENDIF 958 1014 959 1015 CASE ( 'u' ) 960 DO i = nxlg, nxrg 961 DO j = nysg, nyng 962 DO k = nzb, nzt+1 963 u_av(k,j,i) = u_av(k,j,i) + u(k,j,i) 964 ENDDO 965 ENDDO 966 ENDDO 1016 IF ( ALLOCATED( u_av ) ) THEN 1017 DO i = nxlg, nxrg 1018 DO j = nysg, nyng 1019 DO k = nzb, nzt+1 1020 u_av(k,j,i) = u_av(k,j,i) + u(k,j,i) 1021 ENDDO 1022 ENDDO 1023 ENDDO 1024 ENDIF 967 1025 968 1026 CASE ( 'u*' ) 969 DO m = 1, surf_def_h(0)%ns 970 i = surf_def_h(0)%i(m) 971 j = surf_def_h(0)%j(m) 972 us_av(j,i) = us_av(j,i) + surf_def_h(0)%us(m) 973 ENDDO 974 DO m = 1, surf_lsm_h%ns 975 i = surf_lsm_h%i(m) 976 j = surf_lsm_h%j(m) 977 us_av(j,i) = us_av(j,i) + surf_lsm_h%us(m) 978 ENDDO 979 DO m = 1, surf_usm_h%ns 980 i = surf_usm_h%i(m) 981 j = surf_usm_h%j(m) 982 us_av(j,i) = us_av(j,i) + surf_usm_h%us(m) 983 ENDDO 1027 IF ( ALLOCATED( us_av ) ) THEN 1028 DO m = 1, surf_def_h(0)%ns 1029 i = surf_def_h(0)%i(m) 1030 j = surf_def_h(0)%j(m) 1031 us_av(j,i) = us_av(j,i) + surf_def_h(0)%us(m) 1032 ENDDO 1033 DO m = 1, surf_lsm_h%ns 1034 i = surf_lsm_h%i(m) 1035 j = surf_lsm_h%j(m) 1036 us_av(j,i) = us_av(j,i) + surf_lsm_h%us(m) 1037 ENDDO 1038 DO m = 1, surf_usm_h%ns 1039 i = surf_usm_h%i(m) 1040 j = surf_usm_h%j(m) 1041 us_av(j,i) = us_av(j,i) + surf_usm_h%us(m) 1042 ENDDO 1043 ENDIF 984 1044 985 1045 CASE ( 'v' ) 986 DO i = nxlg, nxrg 987 DO j = nysg, nyng 988 DO k = nzb, nzt+1 989 v_av(k,j,i) = v_av(k,j,i) + v(k,j,i) 990 ENDDO 991 ENDDO 992 ENDDO 1046 IF ( ALLOCATED( v_av ) ) THEN 1047 DO i = nxlg, nxrg 1048 DO j = nysg, nyng 1049 DO k = nzb, nzt+1 1050 v_av(k,j,i) = v_av(k,j,i) + v(k,j,i) 1051 ENDDO 1052 ENDDO 1053 ENDDO 1054 ENDIF 993 1055 994 1056 CASE ( 'vpt' ) 995 DO i = nxlg, nxrg 996 DO j = nysg, nyng 997 DO k = nzb, nzt+1 998 vpt_av(k,j,i) = vpt_av(k,j,i) + vpt(k,j,i) 999 ENDDO 1000 ENDDO 1001 ENDDO 1057 IF ( ALLOCATED( vpt_av ) ) THEN 1058 DO i = nxlg, nxrg 1059 DO j = nysg, nyng 1060 DO k = nzb, nzt+1 1061 vpt_av(k,j,i) = vpt_av(k,j,i) + vpt(k,j,i) 1062 ENDDO 1063 ENDDO 1064 ENDDO 1065 ENDIF 1002 1066 1003 1067 CASE ( 'w' ) 1004 DO i = nxlg, nxrg 1005 DO j = nysg, nyng 1006 DO k = nzb, nzt+1 1007 w_av(k,j,i) = w_av(k,j,i) + w(k,j,i) 1008 ENDDO 1009 ENDDO 1010 ENDDO 1068 IF ( ALLOCATED( w_av ) ) THEN 1069 DO i = nxlg, nxrg 1070 DO j = nysg, nyng 1071 DO k = nzb, nzt+1 1072 w_av(k,j,i) = w_av(k,j,i) + w(k,j,i) 1073 ENDDO 1074 ENDDO 1075 ENDDO 1076 ENDIF 1011 1077 1012 1078 CASE ( 'z0*' ) 1013 DO m = 1, surf_def_h(0)%ns 1014 i = surf_def_h(0)%i(m) 1015 j = surf_def_h(0)%j(m) 1016 z0_av(j,i) = z0_av(j,i) + surf_def_h(0)%z0(m) 1017 ENDDO 1018 DO m = 1, surf_lsm_h%ns 1019 i = surf_lsm_h%i(m) 1020 j = surf_lsm_h%j(m) 1021 z0_av(j,i) = z0_av(j,i) + surf_lsm_h%z0(m) 1022 ENDDO 1023 DO m = 1, surf_usm_h%ns 1024 i = surf_usm_h%i(m) 1025 j = surf_usm_h%j(m) 1026 z0_av(j,i) = z0_av(j,i) + surf_usm_h%z0(m) 1027 ENDDO 1079 IF ( ALLOCATED( z0_av ) ) THEN 1080 DO m = 1, surf_def_h(0)%ns 1081 i = surf_def_h(0)%i(m) 1082 j = surf_def_h(0)%j(m) 1083 z0_av(j,i) = z0_av(j,i) + surf_def_h(0)%z0(m) 1084 ENDDO 1085 DO m = 1, surf_lsm_h%ns 1086 i = surf_lsm_h%i(m) 1087 j = surf_lsm_h%j(m) 1088 z0_av(j,i) = z0_av(j,i) + surf_lsm_h%z0(m) 1089 ENDDO 1090 DO m = 1, surf_usm_h%ns 1091 i = surf_usm_h%i(m) 1092 j = surf_usm_h%j(m) 1093 z0_av(j,i) = z0_av(j,i) + surf_usm_h%z0(m) 1094 ENDDO 1095 ENDIF 1028 1096 1029 1097 CASE ( 'z0h*' ) 1030 DO m = 1, surf_def_h(0)%ns 1031 i = surf_def_h(0)%i(m) 1032 j = surf_def_h(0)%j(m) 1033 z0h_av(j,i) = z0h_av(j,i) + surf_def_h(0)%z0h(m) 1034 ENDDO 1035 DO m = 1, surf_lsm_h%ns 1036 i = surf_lsm_h%i(m) 1037 j = surf_lsm_h%j(m) 1038 z0h_av(j,i) = z0h_av(j,i) + surf_lsm_h%z0h(m) 1039 ENDDO 1040 DO m = 1, surf_usm_h%ns 1041 i = surf_usm_h%i(m) 1042 j = surf_usm_h%j(m) 1043 z0h_av(j,i) = z0h_av(j,i) + surf_usm_h%z0h(m) 1044 ENDDO 1045 1098 IF ( ALLOCATED( z0h_av ) ) THEN 1099 DO m = 1, surf_def_h(0)%ns 1100 i = surf_def_h(0)%i(m) 1101 j = surf_def_h(0)%j(m) 1102 z0h_av(j,i) = z0h_av(j,i) + surf_def_h(0)%z0h(m) 1103 ENDDO 1104 DO m = 1, surf_lsm_h%ns 1105 i = surf_lsm_h%i(m) 1106 j = surf_lsm_h%j(m) 1107 z0h_av(j,i) = z0h_av(j,i) + surf_lsm_h%z0h(m) 1108 ENDDO 1109 DO m = 1, surf_usm_h%ns 1110 i = surf_usm_h%i(m) 1111 j = surf_usm_h%j(m) 1112 z0h_av(j,i) = z0h_av(j,i) + surf_usm_h%z0h(m) 1113 ENDDO 1114 ENDIF 1115 1046 1116 CASE ( 'z0q*' ) 1047 DO m = 1, surf_def_h(0)%ns 1048 i = surf_def_h(0)%i(m) 1049 j = surf_def_h(0)%j(m) 1050 z0q_av(j,i) = z0q_av(j,i) + surf_def_h(0)%z0q(m) 1051 ENDDO 1052 DO m = 1, surf_lsm_h%ns 1053 i = surf_lsm_h%i(m) 1054 j = surf_lsm_h%j(m) 1055 z0q_av(j,i) = z0q_av(j,i) + surf_lsm_h%z0q(m) 1056 ENDDO 1057 DO m = 1, surf_usm_h%ns 1058 i = surf_usm_h%i(m) 1059 j = surf_usm_h%j(m) 1060 z0q_av(j,i) = z0q_av(j,i) + surf_usm_h%z0q(m) 1061 ENDDO 1117 IF ( ALLOCATED( z0q_av ) ) THEN 1118 DO m = 1, surf_def_h(0)%ns 1119 i = surf_def_h(0)%i(m) 1120 j = surf_def_h(0)%j(m) 1121 z0q_av(j,i) = z0q_av(j,i) + surf_def_h(0)%z0q(m) 1122 ENDDO 1123 DO m = 1, surf_lsm_h%ns 1124 i = surf_lsm_h%i(m) 1125 j = surf_lsm_h%j(m) 1126 z0q_av(j,i) = z0q_av(j,i) + surf_lsm_h%z0q(m) 1127 ENDDO 1128 DO m = 1, surf_usm_h%ns 1129 i = surf_usm_h%i(m) 1130 j = surf_usm_h%j(m) 1131 z0q_av(j,i) = z0q_av(j,i) + surf_usm_h%z0q(m) 1132 ENDDO 1133 ENDIF 1062 1134 ! 1063 1135 !-- Block of urban surface model outputs. 1064 1136 !-- In case of urban surface variables it should be always checked 1065 1137 !-- if respective arrays are allocated, at least in case of a restart 1066 !-- run, as usm arrays are not read from file at the moment.1138 !-- run, as averaged usm arrays are not read from file at the moment. 1067 1139 CASE ( 'usm_output' ) 1068 1140 CALL usm_average_3d_data( 'allocate', doav(ii) ) -
palm/trunk/SOURCE/time_integration.f90
r2984 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! First call of flow_statistics has been removed. It is already called in 28 ! run_control itself 29 ! 30 ! 2984 2018-04-18 11:51:30Z hellstea 27 31 ! CALL pmci_ensure_nest_mass_conservation is removed (so far only commented out) 28 32 ! as seemingly unnecessary. … … 507 511 !-- Determine and print out the run control quantities before the first time 508 512 !-- step of this run. For the initial run, some statistics (e.g. divergence) 509 !-- need to be determined first .510 IF ( simulated_time == 0.0_wp ) CALL flow_statistics 513 !-- need to be determined first --> CALL flow_statistics at the beginning of 514 !-- run_control 511 515 CALL run_control 512 516 ! -
palm/trunk/SOURCE/turbulence_closure_mod.f90
r2938 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Further allocation checks implemented 28 ! 29 ! 2938 2018-03-27 15:52:42Z suehring 27 30 ! Further todo's 28 31 ! … … 510 513 511 514 CASE ( 'diss' ) 512 DO i = nxlg, nxrg 513 DO j = nysg, nyng 514 DO k = nzb, nzt+1 515 diss_av(k,j,i) = diss_av(k,j,i) + diss(k,j,i) 515 IF ( ALLOCATED( diss_av ) ) THEN 516 DO i = nxlg, nxrg 517 DO j = nysg, nyng 518 DO k = nzb, nzt+1 519 diss_av(k,j,i) = diss_av(k,j,i) + diss(k,j,i) 520 ENDDO 516 521 ENDDO 517 522 ENDDO 518 END DO523 ENDIF 519 524 520 525 CASE ( 'kh' ) 521 DO i = nxlg, nxrg 522 DO j = nysg, nyng 523 DO k = nzb, nzt+1 524 kh_av(k,j,i) = kh_av(k,j,i) + kh(k,j,i) 526 IF ( ALLOCATED( kh_av ) ) THEN 527 DO i = nxlg, nxrg 528 DO j = nysg, nyng 529 DO k = nzb, nzt+1 530 kh_av(k,j,i) = kh_av(k,j,i) + kh(k,j,i) 531 ENDDO 525 532 ENDDO 526 533 ENDDO 527 END DO534 ENDIF 528 535 529 536 CASE ( 'km' ) 530 DO i = nxlg, nxrg 531 DO j = nysg, nyng 532 DO k = nzb, nzt+1 533 km_av(k,j,i) = km_av(k,j,i) + km(k,j,i) 537 IF ( ALLOCATED( km_av ) ) THEN 538 DO i = nxlg, nxrg 539 DO j = nysg, nyng 540 DO k = nzb, nzt+1 541 km_av(k,j,i) = km_av(k,j,i) + km(k,j,i) 542 ENDDO 534 543 ENDDO 535 544 ENDDO 536 END DO545 ENDIF 537 546 538 547 CASE DEFAULT … … 546 555 547 556 CASE ( 'diss' ) 548 DO i = nxlg, nxrg 549 DO j = nysg, nyng 550 DO k = nzb, nzt+1 551 diss_av(k,j,i) = diss_av(k,j,i) & 552 / REAL( average_count_3d, KIND=wp ) 557 IF ( ALLOCATED( diss_av ) ) THEN 558 DO i = nxlg, nxrg 559 DO j = nysg, nyng 560 DO k = nzb, nzt+1 561 diss_av(k,j,i) = diss_av(k,j,i) & 562 / REAL( average_count_3d, KIND=wp ) 563 ENDDO 553 564 ENDDO 554 565 ENDDO 555 END DO566 ENDIF 556 567 557 568 CASE ( 'kh' ) 558 DO i = nxlg, nxrg 559 DO j = nysg, nyng 560 DO k = nzb, nzt+1 561 kh_av(k,j,i) = kh_av(k,j,i) & 562 / REAL( average_count_3d, KIND=wp ) 569 IF ( ALLOCATED( kh_av ) ) THEN 570 DO i = nxlg, nxrg 571 DO j = nysg, nyng 572 DO k = nzb, nzt+1 573 kh_av(k,j,i) = kh_av(k,j,i) & 574 / REAL( average_count_3d, KIND=wp ) 575 ENDDO 563 576 ENDDO 564 577 ENDDO 565 END DO578 ENDIF 566 579 567 580 CASE ( 'km' ) 568 DO i = nxlg, nxrg 569 DO j = nysg, nyng 570 DO k = nzb, nzt+1 571 km_av(k,j,i) = km_av(k,j,i) & 572 / REAL( average_count_3d, KIND=wp ) 581 IF ( ALLOCATED( km_av ) ) THEN 582 DO i = nxlg, nxrg 583 DO j = nysg, nyng 584 DO k = nzb, nzt+1 585 km_av(k,j,i) = km_av(k,j,i) & 586 / REAL( average_count_3d, KIND=wp ) 587 ENDDO 573 588 ENDDO 574 589 ENDDO 575 END DO590 ENDIF 576 591 577 592 END SELECT … … 608 623 LOGICAL :: found !< 609 624 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 625 626 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 610 627 611 628 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< local … … 627 644 ENDDO 628 645 ELSE 646 IF ( .NOT. ALLOCATED( diss_av ) ) THEN 647 ALLOCATE( diss_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 648 diss_av = REAL( fill_value, KIND = wp ) 649 ENDIF 629 650 DO i = nxl, nxr 630 651 DO j = nys, nyn … … 648 669 ENDDO 649 670 ELSE 671 IF ( .NOT. ALLOCATED( diss_av ) ) THEN 672 ALLOCATE( diss_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 673 diss_av = REAL( fill_value, KIND = wp ) 674 ENDIF 650 675 DO i = nxl, nxr 651 676 DO j = nys, nyn … … 669 694 ENDDO 670 695 ELSE 696 IF ( .NOT. ALLOCATED( diss_av ) ) THEN 697 ALLOCATE( diss_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 698 diss_av = REAL( fill_value, KIND = wp ) 699 ENDIF 671 700 DO i = nxl, nxr 672 701 DO j = nys, nyn … … 710 739 711 740 LOGICAL :: found !< 741 742 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 712 743 713 744 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< local … … 731 762 ENDDO 732 763 ELSE 764 IF ( .NOT. ALLOCATED( diss_av ) ) THEN 765 ALLOCATE( diss_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 766 diss_av = REAL( fill_value, KIND = wp ) 767 ENDIF 733 768 DO i = nxl, nxr 734 769 DO j = nys, nyn … … 750 785 ENDDO 751 786 ELSE 787 IF ( .NOT. ALLOCATED( kh_av ) ) THEN 788 ALLOCATE( kh_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 789 kh_av = REAL( fill_value, KIND = wp ) 790 ENDIF 752 791 DO i = nxl, nxr 753 792 DO j = nys, nyn … … 769 808 ENDDO 770 809 ELSE 810 IF ( .NOT. ALLOCATED( km_av ) ) THEN 811 ALLOCATE( km_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 812 km_av = REAL( fill_value, KIND = wp ) 813 ENDIF 771 814 DO i = nxl, nxr 772 815 DO j = nys, nyn -
palm/trunk/SOURCE/user_3d_data_averaging.f90
r2718 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Further allocation checks implemented 28 ! 29 ! 2718 2018-01-02 08:49:38Z maronga 27 30 ! Corrected "Former revisions" section 28 31 ! … … 112 115 !-- Sample for user-defined output: 113 116 ! CASE ( 'u2' ) 114 ! DO i = nxlg, nxrg 115 ! DO j = nysg, nyng 116 ! DO k = nzb, nzt+1 117 ! u2_av(k,j,i) = u2_av(k,j,i) + u2(k,j,i) 117 ! IF ( ALLOCATED( u2_av ) ) THEN 118 ! DO i = nxlg, nxrg 119 ! DO j = nysg, nyng 120 ! DO k = nzb, nzt+1 121 ! u2_av(k,j,i) = u2_av(k,j,i) + u2(k,j,i) 122 ! ENDDO 118 123 ! ENDDO 119 124 ! ENDDO 120 ! END DO125 ! ENDIF 121 126 122 127 CASE DEFAULT … … 135 140 !-- Sample for user-defined output: 136 141 ! CASE ( 'u2' ) 137 ! DO i = nxlg, nxrg 138 ! DO j = nysg, nyng 139 ! DO k = nzb, nzt+1 140 ! u2_av(k,j,i) = u2_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 142 ! IF ( ALLOCATED( u2_av ) ) THEN 143 ! DO i = nxlg, nxrg 144 ! DO j = nysg, nyng 145 ! DO k = nzb, nzt+1 146 ! u2_av(k,j,i) = u2_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 147 ! ENDDO 141 148 ! ENDDO 142 149 ! ENDDO 143 ! END DO150 ! ENDIF 144 151 145 152 END SELECT -
palm/trunk/SOURCE/user_data_output_2d.f90
r2718 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Further allocation checks implemented (averaged data will be assigned to fill 28 ! values if no allocation happened so far) 29 ! 30 ! 2718 2018-01-02 08:49:38Z maronga 27 31 ! Corrected "Former revisions" section 28 32 ! … … 94 98 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 95 99 100 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 101 96 102 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< 97 103 … … 116 122 ! ENDDO 117 123 ! ELSE 124 ! IF ( .NOT. ALLOCATED( u2_av ) ) THEN 125 ! ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 126 ! u2_av = REAL( fill_value, KIND = wp ) 127 ! ENDIF 118 128 ! DO i = nxl, nxr 119 129 ! DO j = nys, nyn -
palm/trunk/SOURCE/user_data_output_3d.f90
r2718 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Further allocation checks implemented (averaged data will be assigned to fill 28 ! values if no allocation happened so far) 29 ! 30 ! 2718 2018-01-02 08:49:38Z maronga 27 31 ! Corrected "Former revisions" section 28 32 ! … … 87 91 LOGICAL :: found !< 88 92 89 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< 93 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 94 95 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< 90 96 91 97 … … 109 115 ! ENDDO 110 116 ! ELSE 117 ! IF ( .NOT. ALLOCATED( u2_av ) ) THEN 118 ! ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 119 ! u2_av = REAL( fill_value, KIND = wp ) 120 ! ENDIF 111 121 ! DO i = nxl, nxr 112 122 ! DO j = nys, nyn -
palm/trunk/SOURCE/uv_exposure_model_mod.f90
r2932 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Further allocation checks implemented (averaged data will be assigned to fill 28 ! values if no allocation happened so far) 29 ! 30 ! 2932 2018-03-26 09:39:22Z maronga 27 31 ! renamed uvexposure_par to biometeorology_parameters 28 32 ! … … 331 335 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 332 336 337 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 338 333 339 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< 334 340 … … 353 359 354 360 CASE ( 'uvem_vitd3dose*_xy' ) ! 2d-array 361 IF ( .NOT. ALLOCATED( vitd3_exposure_av ) ) THEN 362 ALLOCATE( vitd3_exposure_av(nysg:nyng,nxlg:nxrg) ) 363 vitd3_exposure_av = REAL( fill_value, KIND = wp ) 364 ENDIF 355 365 IF ( av == 1 ) THEN 356 366 DO i = nxl, nxr … … 502 512 503 513 CASE ( 'uvem_vitd3dose*' ) 504 DO i = nxlg, nxrg 505 DO j = nysg, nyng 506 vitd3_exposure_av(j,i) = vitd3_exposure_av(j,i) + vitd3_exposure(j,i) 514 IF ( ALLOCATED( vitd3_exposure_av ) ) THEN 515 DO i = nxlg, nxrg 516 DO j = nysg, nyng 517 vitd3_exposure_av(j,i) = vitd3_exposure_av(j,i) + vitd3_exposure(j,i) 518 ENDDO 507 519 ENDDO 508 END DO520 ENDIF 509 521 510 522 -
palm/trunk/SOURCE/write_restart_data_mod.f90
r3003 r3004 25 25 ! ----------------- 26 26 ! $Id$ 27 ! precipitation_rate_av removed 28 ! 29 ! 3003 2018-04-23 10:22:58Z Giersch 27 30 ! z_i is also written out to use the last known inversion height from the 28 31 ! initial run as the first inversion height which is written into the … … 1078 1081 ENDIF 1079 1082 1080 IF ( ALLOCATED( precipitation_rate_av ) ) THEN1081 CALL wrd_write_string( 'precipitation_rate_av' )1082 WRITE ( 14 ) precipitation_rate_av1083 ENDIF1084 1085 1083 CALL wrd_write_string( 'pt' ) 1086 1084 WRITE ( 14 ) pt
Note: See TracChangeset
for help on using the changeset viewer.