- Timestamp:
- Sep 20, 2024, 12:32:04 PM (5 days ago)
- Location:
- LMDZ6/branches/cirrus
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/cirrus
- Property svn:mergeinfo changed
-
LMDZ6/branches/cirrus/libf/phylmd/ecrad/radiation/radiation_tripleclouds_sw.F90
r4853 r5202 74 74 ! Gas and aerosol optical depth, single-scattering albedo and 75 75 ! asymmetry factor at each shortwave g-point 76 real(jprb), intent(in), dimension(config%n_g_sw,nlev,istartcol:iendcol) & 77 & :: od, ssa, g 76 ! real(jprb), intent(in), dimension(istartcol:iendcol,nlev,config%n_g_sw) :: & 77 real(jprb), intent(in), dimension(config%n_g_sw,nlev,istartcol:iendcol) :: & 78 & od, ssa, g 78 79 79 80 ! Cloud and precipitation optical depth, single-scattering albedo and 80 81 ! asymmetry factor in each shortwave band 81 real(jprb), intent(in), dimension(config%n_bands_sw,nlev,istartcol:iendcol) &82 & ::od_cloud, ssa_cloud, g_cloud82 real(jprb), intent(in), dimension(config%n_bands_sw,nlev,istartcol:iendcol) :: & 83 & od_cloud, ssa_cloud, g_cloud 83 84 84 85 ! Optical depth, single scattering albedo and asymmetry factor in … … 91 92 ! flux into a plane perpendicular to the incoming radiation at 92 93 ! top-of-atmosphere in each of the shortwave g points 93 real(jprb), intent(in), dimension(config%n_g_sw,istartcol:iendcol) &94 & ::albedo_direct, albedo_diffuse, incoming_sw94 real(jprb), intent(in), dimension(config%n_g_sw,istartcol:iendcol) :: & 95 & albedo_direct, albedo_diffuse, incoming_sw 95 96 96 97 ! Output … … 165 166 real(jprb) :: scat_od, scat_od_cloud 166 167 167 ! Temporaries to speed up summations168 real(jprb) :: sum_dn_diff, sum_dn_dir, sum_up169 170 ! Local cosine of solar zenith angle171 168 real(jprb) :: mu0 172 169 … … 447 444 end if 448 445 449 ! Store the TOA broadband fluxes, noting that there is no 450 ! diffuse downwelling at TOA. The intrinsic "sum" command has 451 ! been found to be very slow; better performance is found on 452 ! x86-64 architecture with explicit loops and the "omp simd 453 ! reduction" directive. 454 sum_up = 0.0_jprb 455 sum_dn_dir = 0.0_jprb 456 do jreg = 1,nregions 457 !$omp simd reduction(+:sum_up, sum_dn_dir) 458 do jg = 1,ng 459 sum_up = sum_up + flux_up(jg,jreg) 460 sum_dn_dir = sum_dn_dir + direct_dn(jg,jreg) 461 end do 462 end do 463 flux%sw_up(jcol,1) = sum_up 464 flux%sw_dn(jcol,1) = mu0 * sum_dn_dir 446 ! Store the TOA broadband fluxes 447 flux%sw_up(jcol,1) = sum(sum(flux_up,1)) 448 flux%sw_dn(jcol,1) = mu0 * sum(sum(direct_dn,1)) 465 449 if (allocated(flux%sw_dn_direct)) then 466 450 flux%sw_dn_direct(jcol,1) = flux%sw_dn(jcol,1) 467 451 end if 468 452 if (config%do_clear) then 469 sum_up = 0.0_jprb 470 sum_dn_dir = 0.0_jprb 471 !$omp simd reduction(+:sum_up, sum_dn_dir) 472 do jg = 1,ng 473 sum_up = sum_up + flux_up_clear(jg) 474 sum_dn_dir = sum_dn_dir + direct_dn_clear(jg) 475 end do 476 flux%sw_up_clear(jcol,1) = sum_up 477 flux%sw_dn_clear(jcol,1) = mu0 * sum_dn_dir 453 flux%sw_up_clear(jcol,1) = sum(flux_up_clear) 454 flux%sw_dn_clear(jcol,1) = mu0 * sum(direct_dn_clear) 478 455 if (allocated(flux%sw_dn_direct_clear)) then 479 456 flux%sw_dn_direct_clear(jcol,1) = flux%sw_dn_clear(jcol,1) … … 490 467 & config%i_spec_from_reordered_g_sw, & 491 468 & flux%sw_dn_band(:,jcol,1)) 492 flux%sw_dn_band(:,jcol,1) = mu0 * flux%sw_dn_band(:,jcol,1) 469 flux%sw_dn_band(:,jcol,1) = & 470 & mu0 * flux%sw_dn_band(:,jcol,1) 493 471 if (allocated(flux%sw_dn_direct_band)) then 494 472 flux%sw_dn_direct_band(:,jcol,1) = flux%sw_dn_band(:,jcol,1) … … 571 549 ! nothing to do 572 550 573 ! Store the broadband fluxes. The intrinsic "sum" command has 574 ! been found to be very slow; better performance is found on 575 ! x86-64 architecture with explicit loops and the "omp simd 576 ! reduction" directive. 577 sum_up = 0.0_jprb 578 sum_dn_dir = 0.0_jprb 579 sum_dn_diff = 0.0_jprb 580 do jreg = 1,nregions 581 !$omp simd reduction(+:sum_up, sum_dn_diff, sum_dn_dir) 582 do jg = 1,ng 583 sum_up = sum_up + flux_up(jg,jreg) 584 sum_dn_diff = sum_dn_diff + flux_dn(jg,jreg) 585 sum_dn_dir = sum_dn_dir + direct_dn(jg,jreg) 586 end do 587 end do 588 flux%sw_up(jcol,jlev+1) = sum_up 589 flux%sw_dn(jcol,jlev+1) = mu0 * sum_dn_dir + sum_dn_diff 551 ! Store the broadband fluxes 552 flux%sw_up(jcol,jlev+1) = sum(sum(flux_up,1)) 590 553 if (allocated(flux%sw_dn_direct)) then 591 flux%sw_dn_direct(jcol,jlev+1) = mu0 * sum_dn_dir 554 flux%sw_dn_direct(jcol,jlev+1) = mu0 * sum(sum(direct_dn,1)) 555 flux%sw_dn(jcol,jlev+1) & 556 & = flux%sw_dn_direct(jcol,jlev+1) + sum(sum(flux_dn,1)) 557 else 558 flux%sw_dn(jcol,jlev+1) = mu0 * sum(sum(direct_dn,1)) + sum(sum(flux_dn,1)) 592 559 end if 593 560 if (config%do_clear) then 594 sum_up = 0.0_jprb 595 sum_dn_dir = 0.0_jprb 596 sum_dn_diff = 0.0_jprb 597 !$omp simd reduction(+:sum_up, sum_dn_diff, sum_dn_dir) 598 do jg = 1,ng 599 sum_up = sum_up + flux_up_clear(jg) 600 sum_dn_diff = sum_dn_diff + flux_dn_clear(jg) 601 sum_dn_dir = sum_dn_dir + direct_dn_clear(jg) 602 end do 603 flux%sw_up_clear(jcol,jlev+1) = sum_up 604 flux%sw_dn_clear(jcol,jlev+1) = mu0 * sum_dn_dir + sum_dn_diff 561 flux%sw_up_clear(jcol,jlev+1) = sum(flux_up_clear) 605 562 if (allocated(flux%sw_dn_direct_clear)) then 606 flux%sw_dn_direct_clear(jcol,jlev+1) = mu0 * sum_dn_dir 563 flux%sw_dn_direct_clear(jcol,jlev+1) = mu0 * sum(direct_dn_clear) 564 flux%sw_dn_clear(jcol,jlev+1) & 565 & = flux%sw_dn_direct_clear(jcol,jlev+1) + sum(flux_dn_clear) 566 else 567 flux%sw_dn_clear(jcol,jlev+1) = mu0 * sum(direct_dn_clear) & 568 & + sum(flux_dn_clear) 607 569 end if 608 570 end if … … 643 605 end if 644 606 end if 607 645 608 end do ! Final loop over levels 646 609
Note: See TracChangeset
for help on using the changeset viewer.