Changeset 3065 for palm/trunk/SOURCE/radiation_model_mod.f90
- Timestamp:
- Jun 12, 2018 7:03:02 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/radiation_model_mod.f90
r3049 r3065 28 28 ! ----------------- 29 29 ! $Id$ 30 ! dz was replaced by dz(1), error message concerning vertical stretching was 31 ! added 32 ! 33 ! 3049 2018-05-29 13:52:36Z Giersch 30 34 ! Error messages revised 31 35 ! … … 330 334 ! ------------ 331 335 !> Radiation models and interfaces 336 !> @todo Replace dz(1) appropriatly to account for grid stretching 332 337 !> @todo move variable definitions used in radiation_init only to the subroutine 333 338 !> as they are no longer required after initialization. … … 4371 4376 IF ( plant_canopy ) THEN 4372 4377 pchf_prep(:) = r_d * (hyp(nzub:nzut) / 100000.0_wp)**0.286_wp & 4373 / (cp * hyp(nzub:nzut) * dx*dy*dz ) !< equals to 1 / (rho * c_p * Vbox * T)4378 / (cp * hyp(nzub:nzut) * dx*dy*dz(1)) !< equals to 1 / (rho * c_p * Vbox * T) 4374 4379 pctf_prep(:) = r_d * (hyp(nzub:nzut) / 100000.0_wp)**0.286_wp & 4375 4380 / (l_v * hyp(nzub:nzut) * dx*dy*dz) … … 4396 4401 !-- each dimension, so that this new direction vector will allow us 4397 4402 !-- to traverse the ray path within grid coordinates directly 4398 sunorig_grid = (/ sunorig(1)/dz , sunorig(2)/dy, sunorig(3)/dx /)4403 sunorig_grid = (/ sunorig(1)/dz(1), sunorig(2)/dy, sunorig(3)/dx /) 4399 4404 !-- sunorig_grid = sunorig_grid / norm2(sunorig_grid) 4400 4405 sunorig_grid = sunorig_grid / SQRT(SUM(sunorig_grid**2)) … … 4403 4408 !-- precompute effective box depth with prototype Leaf Area Density 4404 4409 pc_box_dimshift = MAXLOC(ABS(sunorig), 1) - 1 4405 CALL box_absorb(CSHIFT((/dz ,dy,dx/), pc_box_dimshift), &4410 CALL box_absorb(CSHIFT((/dz(1),dy,dx/), pc_box_dimshift), & 4406 4411 60, prototype_lad, & 4407 4412 CSHIFT(ABS(sunorig), pc_box_dimshift), & … … 4801 4806 IF ( idir(d) == 0 ) facearea(d) = facearea(d) * dx 4802 4807 IF ( jdir(d) == 0 ) facearea(d) = facearea(d) * dy 4803 IF ( kdir(d) == 0 ) facearea(d) = facearea(d) * dz 4808 IF ( kdir(d) == 0 ) facearea(d) = facearea(d) * dz(1) 4804 4809 ENDDO 4805 4810 ! … … 5014 5019 SUBROUTINE radiation_interaction_init 5015 5020 5021 USE control_parameters, & 5022 ONLY: dz_stretch_level_start 5023 5016 5024 USE netcdf_data_input_mod, & 5017 5025 ONLY: leaf_area_density_f … … 5095 5103 nzpt = nzptl 5096 5104 #endif 5105 ! 5106 !-- Stretching (non-uniform grid spacing) is not considered in the radiation 5107 !-- model. Therefore, vertical stretching has to be applied above the area 5108 !-- where the parts of the radiation model which assume constant grid spacing 5109 !-- are active. ABS (...) is required because the default value of 5110 !-- dz_stretch_level_start is -9999999.9_wp (negative). 5111 IF ( ABS( dz_stretch_level_start(1) ) <= zw(nzut) ) THEN 5112 WRITE( message_string, * ) 'The lowest level where vertical ', & 5113 'stretching is applied have to be ', & 5114 'greater than ', zw(nzut) 5115 CALL message( 'init_grid', 'PA0496', 1, 2, 0, 6, 0 ) 5116 ENDIF 5097 5117 ! 5098 5118 !-- global number of urban and plant layers … … 5390 5410 IF ( idir(d) == 0 ) facearea(d) = facearea(d) * dx 5391 5411 IF ( jdir(d) == 0 ) facearea(d) = facearea(d) * dy 5392 IF ( kdir(d) == 0 ) facearea(d) = facearea(d) * dz 5412 IF ( kdir(d) == 0 ) facearea(d) = facearea(d) * dz(1) 5393 5413 ENDDO 5394 5414 … … 5512 5532 5513 5533 !-- unit vector source -> target 5514 uv = (/ (ta(1)-sa(1))*dz , (ta(2)-sa(2))*dy, (ta(3)-sa(3))*dx /)5534 uv = (/ (ta(1)-sa(1))*dz(1), (ta(2)-sa(2))*dy, (ta(3)-sa(3))*dx /) 5515 5535 sqdist = SUM(uv(:)**2) 5516 5536 uv = uv / SQRT(sqdist) … … 5677 5697 5678 5698 !-- unit vector source -> target 5679 uv = (/ (ta(1)-sa(1))*dz , (ta(2)-sa(2))*dy, (ta(3)-sa(3))*dx /)5699 uv = (/ (ta(1)-sa(1))*dz(1), (ta(2)-sa(2))*dy, (ta(3)-sa(3))*dx /) 5680 5700 sqdist = SUM(uv(:)**2) 5681 5701 uv = uv / SQRT(sqdist) … … 6127 6147 ENDIF 6128 6148 uvect(:) = delta(:) / distance 6129 realdist = SQRT(SUM( (uvect(:)*(/dz ,dy,dx/))**2 ))6149 realdist = SQRT(SUM( (uvect(:)*(/dz(1),dy,dx/))**2 )) 6130 6150 6131 6151 lastdist = 0._wp … … 6509 6529 zb1 = CEILING(zexit * zsgn - .5_wp) - 1 ! because it must be smaller than exit 6510 6530 nz = MAX(zb1 - zb0 + 3, 2) 6511 rt2_dist(nz) = SQRT(((zexit-zorig)*dz )**2 + dxxyy)6531 rt2_dist(nz) = SQRT(((zexit-zorig)*dz(1))**2 + dxxyy) 6512 6532 qdist = rt2_dist(nz) / (zexit-zorig) 6513 6533 rt2_dist(2:nz-1) = (/( ((REAL(l, wp) + .5_wp) * zsgn - zorig) * qdist , l = zb0, zb1 )/) … … 6567 6587 zb1 = CEILING(zexit * zsgn - .5_wp) - 1 ! because it must be smaller than exit 6568 6588 nz = MAX(zb1 - zb0 + 3, 2) 6569 rt2_dist(nz) = SQRT(((zexit-zorig)*dz )**2 + dxxyy)6589 rt2_dist(nz) = SQRT(((zexit-zorig)*dz(1))**2 + dxxyy) 6570 6590 qdist = rt2_dist(nz) / (zexit-zorig) 6571 6591 rt2_dist(2:nz-1) = (/( ((REAL(l, wp) + .5_wp) * zsgn - zorig) * qdist , l = zb0, zb1 )/)
Note: See TracChangeset
for help on using the changeset viewer.