- Timestamp:
- Mar 19, 2024, 3:34:21 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/ecrad/radiation/radiation_mcica_lw.F90
r4773 r4853 19 19 ! 2017-10-23 R. Hogan Renamed single-character variables 20 20 21 #include "ecrad_config.h" 22 21 23 module radiation_mcica_lw 22 24 … … 124 126 ! Identify clear-sky layers 125 127 logical :: is_clear_sky_layer(nlev) 128 129 ! Temporary storage for more efficient summation 130 #ifdef DWD_REDUCTION_OPTIMIZATIONS 131 real(jprb), dimension(nlev+1,2) :: sum_aux 132 #else 133 real(jprb) :: sum_up, sum_dn 134 #endif 126 135 127 136 ! Index of the highest cloudy layer … … 179 188 180 189 ! Sum over g-points to compute broadband fluxes 181 flux%lw_up_clear(jcol,:) = sum(flux_up_clear,1) 182 flux%lw_dn_clear(jcol,:) = sum(flux_dn_clear,1) 190 #ifdef DWD_REDUCTION_OPTIMIZATIONS 191 sum_aux(:,:) = 0.0_jprb 192 do jg = 1,ng 193 do jlev = 1,nlev+1 194 sum_aux(jlev,1) = sum_aux(jlev,1) + flux_up_clear(jg,jlev) 195 sum_aux(jlev,2) = sum_aux(jlev,2) + flux_dn_clear(jg,jlev) 196 end do 197 end do 198 flux%lw_up_clear(jcol,:) = sum_aux(:,1) 199 flux%lw_dn_clear(jcol,:) = sum_aux(:,2) 200 #else 201 do jlev = 1,nlev+1 202 sum_up = 0.0_jprb 203 sum_dn = 0.0_jprb 204 !$omp simd reduction(+:sum_up, sum_dn) 205 do jg = 1,ng 206 sum_up = sum_up + flux_up_clear(jg,jlev) 207 sum_dn = sum_dn + flux_dn_clear(jg,jlev) 208 end do 209 flux%lw_up_clear(jcol,jlev) = sum_up 210 flux%lw_dn_clear(jcol,jlev) = sum_dn 211 end do 212 #endif 213 183 214 ! Store surface spectral downwelling fluxes 184 215 flux%lw_dn_surf_clear_g(:,jcol) = flux_dn_clear(:,nlev+1) … … 279 310 else 280 311 ! Clear-sky layer: copy over clear-sky values 281 reflectance(:,jlev) = ref_clear(:,jlev) 282 transmittance(:,jlev) = trans_clear(:,jlev) 283 source_up(:,jlev) = source_up_clear(:,jlev) 284 source_dn(:,jlev) = source_dn_clear(:,jlev) 312 do jg = 1,ng 313 reflectance(jg,jlev) = ref_clear(jg,jlev) 314 transmittance(jg,jlev) = trans_clear(jg,jlev) 315 source_up(jg,jlev) = source_up_clear(jg,jlev) 316 source_dn(jg,jlev) = source_dn_clear(jg,jlev) 317 end do 285 318 end if 286 319 end do … … 307 340 308 341 ! Store overcast broadband fluxes 309 flux%lw_up(jcol,:) = sum(flux_up,1) 310 flux%lw_dn(jcol,:) = sum(flux_dn,1) 342 #ifdef DWD_REDUCTION_OPTIMIZATIONS 343 sum_aux(:,:) = 0._jprb 344 do jg = 1, ng 345 do jlev = 1, nlev+1 346 sum_aux(jlev,1) = sum_aux(jlev,1) + flux_up(jg,jlev) 347 sum_aux(jlev,2) = sum_aux(jlev,2) + flux_dn(jg,jlev) 348 end do 349 end do 350 flux%lw_up(jcol,:) = sum_aux(:,1) 351 flux%lw_dn(jcol,:) = sum_aux(:,2) 352 #else 353 do jlev = 1,nlev+1 354 sum_up = 0.0_jprb 355 sum_dn = 0.0_jprb 356 !$omp simd reduction(+:sum_up, sum_dn) 357 do jg = 1,ng 358 sum_up = sum_up + flux_up(jg,jlev) 359 sum_dn = sum_dn + flux_dn(jg,jlev) 360 end do 361 flux%lw_up(jcol,jlev) = sum_up 362 flux%lw_dn(jcol,jlev) = sum_dn 363 end do 364 #endif 311 365 312 366 ! Cloudy flux profiles currently assume completely overcast 313 367 ! skies; perform weighted average with clear-sky profile 314 flux%lw_up(jcol,:) = total_cloud_cover *flux%lw_up(jcol,:) & 315 & + (1.0_jprb - total_cloud_cover)*flux%lw_up_clear(jcol,:) 316 flux%lw_dn(jcol,:) = total_cloud_cover *flux%lw_dn(jcol,:) & 317 & + (1.0_jprb - total_cloud_cover)*flux%lw_dn_clear(jcol,:) 368 do jlev = 1,nlev+1 369 flux%lw_up(jcol,jlev) = total_cloud_cover *flux%lw_up(jcol,jlev) & 370 & + (1.0_jprb - total_cloud_cover)*flux%lw_up_clear(jcol,jlev) 371 flux%lw_dn(jcol,jlev) = total_cloud_cover *flux%lw_dn(jcol,jlev) & 372 & + (1.0_jprb - total_cloud_cover)*flux%lw_dn_clear(jcol,jlev) 373 end do 318 374 ! Store surface spectral downwelling fluxes 319 375 flux%lw_dn_surf_g(:,jcol) = total_cloud_cover*flux_dn(:,nlev+1) & … … 335 391 ! No cloud in profile and clear-sky fluxes already 336 392 ! calculated: copy them over 337 flux%lw_up(jcol,:) = flux%lw_up_clear(jcol,:) 338 flux%lw_dn(jcol,:) = flux%lw_dn_clear(jcol,:) 393 do jlev = 1,nlev+1 394 flux%lw_up(jcol,jlev) = flux%lw_up_clear(jcol,jlev) 395 flux%lw_dn(jcol,jlev) = flux%lw_dn_clear(jcol,jlev) 396 end do 339 397 flux%lw_dn_surf_g(:,jcol) = flux%lw_dn_surf_clear_g(:,jcol) 340 398 if (config%do_lw_derivatives) then
Note: See TracChangeset
for help on using the changeset viewer.