Changeset 4713 for palm/trunk/SOURCE/radiation_model_mod.f90
- Timestamp:
- Sep 29, 2020 12:02:05 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/radiation_model_mod.f90
r4708 r4713 28 28 ! ----------------- 29 29 ! $Id$ 30 ! Correct OpenMP parallelization including cycles with cumulative variables (J. Resler) 31 ! 32 ! 4708 2020-09-28 17:42:58Z suehring 30 33 ! - Bugfix, correct mapping of RRTMG heating rates, as well as incoming/outgoing 31 34 ! radiation onto the topography-following grid … … 5967 5970 REAL(wp) :: pabs_pc_lwdifl !< total absorbed LW radiation in plant canopy from sky in local processor (W) 5968 5971 REAL(wp) :: pabs_pc_lwdif !< total absorbed LW radiation in plant canopy from sky in all processors (W) 5969 5972 !- rotation related variables 5970 5973 REAL(wp) :: sun_direct_factor !< factor for direct normal radiation from direct horizontal 5971 5974 REAL(wp) :: sin_rot !< sine of rotation_angle … … 6072 6075 !-- Set up thermal radiation from surfaces 6073 6076 mm = 1 6077 !-- following code depends on the order of the execution 6078 !-- do not parallelize by OpenMP 6074 6079 DO i = nxl, nxr 6075 6080 DO j = nys, nyn … … 6159 6164 6160 6165 IF ( surface_reflections) THEN 6166 !$OMP DO PRIVATE (i, j, k, isvf, isurf, isurfsrc) SCHEDULE (STATIC) 6161 6167 DO isvf = 1, nsvfl 6162 6168 isurf = svfsurf(1, isvf) … … 6173 6179 ENDIF 6174 6180 ENDDO 6181 !$OMP END DO 6175 6182 ENDIF 6176 6183 ! 6177 6184 !-- diffuse radiation using sky view factor 6185 !$OMP DO PRIVATE (i, j, d, isurf) REDUCTION(+:pinswl, pinlwl) SCHEDULE (STATIC) 6178 6186 DO isurf = 1, nsurfl 6179 6187 j = surfl(iy, isurf) … … 6193 6201 ENDIF 6194 6202 ENDDO 6203 !$OMP END DO 6195 6204 ! 6196 6205 !-- MRT diffuse irradiance 6206 !$OMP DO PRIVATE (i, j, imrt) SCHEDULE (STATIC) 6197 6207 DO imrt = 1, nmrtbl 6198 6208 j = mrtbl(iy, imrt) … … 6201 6211 mrtinlw(imrt) = mrtsky(imrt) * rad_lw_in_diff(j,i) 6202 6212 ENDDO 6213 !$OMP END DO 6203 6214 ! 6204 6215 !-- Direct radiation … … 6218 6229 isd = dsidir_rev(j, i) 6219 6230 !-- TODO: check if isd = -1 to report that this solar position is not precalculated 6231 !$OMP DO PRIVATE (i, j, d, isurf) REDUCTION(+:pinswl) SCHEDULE (STATIC) 6220 6232 DO isurf = 1, nsurfl 6221 6233 j = surfl(iy, isurf) … … 6227 6239 pinswl = pinswl + surfinswdir(isurf) * facearea(d) 6228 6240 ENDDO 6241 !$OMP END DO 6229 6242 ! 6230 6243 !-- MRT direct irradiance 6244 !$OMP DO PRIVATE (i, j, imrt) SCHEDULE (STATIC) 6231 6245 DO imrt = 1, nmrtbl 6232 6246 j = mrtbl(iy, imrt) … … 6235 6249 * sun_direct_factor / 4.0_wp ! normal to sphere 6236 6250 ENDDO 6251 !$OMP END DO 6237 6252 ENDIF 6238 6253 ! 6239 6254 !-- MRT first pass thermal 6255 !$OMP DO PRIVATE (imrtf, imrt, isurfsrc) SCHEDULE (STATIC) 6240 6256 DO imrtf = 1, nmrtf 6241 6257 imrt = mrtfsurf(1, imrtf) … … 6243 6259 mrtinlw(imrt) = mrtinlw(imrt) + mrtf(imrtf) * surfoutl(isurfsrc) 6244 6260 ENDDO 6261 !$OMP END DO 6245 6262 ! 6246 6263 !-- Absorption in each local plant canopy grid box from the first atmospheric … … 6252 6269 pcbinlw(:) = 0.0_wp 6253 6270 6271 !$OMP DO PRIVATE (icsf, ipcgb, i, j, k, kk, isurfsrc, pc_abs_frac, pcrad, asrc) & 6272 !$OMP& REDUCTION(+:pinswl, pinlwl, pabslwl, pemitlwl, pabs_pc_lwdifl) SCHEDULE (STATIC) 6254 6273 DO icsf = 1, ncsfl 6255 6274 ipcgb = csfsurf(1, icsf) … … 6309 6328 ENDIF 6310 6329 ENDDO 6330 !$OMP END DO 6311 6331 6312 6332 pcbinsw(:) = pcbinswdir(:) + pcbinswdif(:) … … 6362 6382 ENDIF 6363 6383 6364 !-- Next passes of radiation interactions:6384 !-- Next passes of radiation interactions: 6365 6385 !-- radiation reflections 6366 6386 … … 6404 6424 ! 6405 6425 !-- Reflected radiation 6426 !$OMP DO PRIVATE (isvf, isurf, isurfsrc) SCHEDULE (STATIC) 6406 6427 DO isvf = 1, nsvfl 6407 6428 isurf = svfsurf(1, isvf) … … 6414 6435 ENDIF 6415 6436 ENDDO 6437 !$OMP END DO 6416 6438 ! 6417 6439 !-- NOTE: PC absorbtion and MRT from reflected can both be done at once … … 6421 6443 ! 6422 6444 !-- Radiation absorbed by plant canopy 6445 !$OMP DO PRIVATE (icsf, ipcgb, isurfsrc, asrc) SCHEDULE (STATIC) 6423 6446 DO icsf = 1, ncsfl 6424 6447 ipcgb = csfsurf(1, icsf) … … 6435 6458 ENDIF 6436 6459 ENDDO 6460 !$OMP END DO 6437 6461 ! 6438 6462 !-- MRT reflected 6463 !$OMP DO PRIVATE (imrtf, imrt, isurfsrc) SCHEDULE (STATIC) 6439 6464 DO imrtf = 1, nmrtf 6440 6465 imrt = mrtfsurf(1, imrtf) … … 6443 6468 mrtinlw(imrt) = mrtinlw(imrt) + mrtf(imrtf) * surfoutl(isurfsrc) 6444 6469 ENDDO 6470 !$OMP END DO 6445 6471 6446 6472 IF ( trace_fluxes_above >= 0.0_wp ) THEN … … 6464 6490 IF ( npcbl > 0 ) THEN 6465 6491 pcm_heating_rate(:,:,:) = 0.0_wp 6492 !$OMP DO PRIVATE (ipcgb, i, j, k, kk) REDUCTION(+:pabsswl) SCHEDULE (STATIC) 6466 6493 DO ipcgb = 1, npcbl 6467 6494 j = pcbl(iy, ipcgb) … … 6476 6503 pabsswl = pabsswl + pcbinsw(ipcgb) 6477 6504 ENDDO 6505 !$OMP END DO 6478 6506 6479 6507 IF ( humidity .AND. plant_canopy_transpiration ) THEN … … 6481 6509 pcm_transpiration_rate(:,:,:) = 0.0_wp 6482 6510 pcm_latent_rate(:,:,:) = 0.0_wp 6511 !$OMP DO PRIVATE (ipcgb, i, j, k, kk) SCHEDULE (STATIC) 6483 6512 DO ipcgb = 1, npcbl 6484 6513 i = pcbl(ix, ipcgb) … … 6490 6519 pcm_transpiration_rate(kk,j,i), & 6491 6520 pcm_latent_rate(kk,j,i) ) 6492 ENDDO 6521 ENDDO 6522 !$OMP END DO 6493 6523 ENDIF 6494 6524 ENDIF … … 6506 6536 ! and claculate relevant radiation model-RTM coupling terms 6507 6537 mm = 1 6538 !-- following code depends on the order of the execution 6539 !-- do not parallelize by OpenMP 6508 6540 DO i = nxl, nxr 6509 6541 DO j = nys, nyn … … 6598 6630 ENDDO 6599 6631 6632 !$OMP DO PRIVATE (i, d) REDUCTION(+:pabsswl, pabslwl, pemitlwl, pabs_surf_lwdifl) & 6633 !$OMP& SCHEDULE (STATIC) 6600 6634 DO i = 1, nsurfl 6601 6635 d = surfl(id, i) … … 6612 6646 emiss_surf(i) * facearea(d) * surfinlwdif(i) 6613 6647 ENDDO 6648 !$OMP END DO 6614 6649 6615 6650 DO l = 0, 1 6651 !$OMP DO PRIVATE (m) SCHEDULE (STATIC) 6616 6652 DO m = 1, surf_usm_h(l)%ns 6617 6653 surf_usm_h(l)%surfhf(m) = surf_usm_h(l)%rad_sw_in(m) + & … … 6620 6656 surf_usm_h(l)%rad_lw_out(m) 6621 6657 ENDDO 6658 !$OMP END DO 6659 !$OMP DO PRIVATE (m) SCHEDULE (STATIC) 6622 6660 DO m = 1, surf_lsm_h(l)%ns 6623 6661 surf_lsm_h(l)%surfhf(m) = surf_lsm_h(l)%rad_sw_in(m) + & … … 6626 6664 surf_lsm_h(l)%rad_lw_out(m) 6627 6665 ENDDO 6666 !$OMP END DO 6628 6667 ENDDO 6668 6629 6669 DO l = 0, 3 6670 !$OMP DO PRIVATE (m) SCHEDULE (STATIC) 6630 6671 !-- urban 6631 6672 DO m = 1, surf_usm_v(l)%ns … … 6635 6676 surf_usm_v(l)%rad_lw_out(m) 6636 6677 ENDDO 6678 !$OMP END DO 6637 6679 !-- land 6680 !$OMP DO PRIVATE (m) SCHEDULE (STATIC) 6638 6681 DO m = 1, surf_lsm_v(l)%ns 6639 6682 surf_lsm_v(l)%surfhf(m) = surf_lsm_v(l)%rad_sw_in(m) + & … … 6643 6686 6644 6687 ENDDO 6688 !$OMP END DO 6645 6689 ENDDO 6646 6690 !
Note: See TracChangeset
for help on using the changeset viewer.