Changeset 4168 for palm/trunk/SOURCE/radiation_model_mod.f90
- Timestamp:
- Aug 16, 2019 1:50:17 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/radiation_model_mod.f90
r4167 r4168 28 28 ! ----------------- 29 29 ! $Id$ 30 ! Changed behaviour of masked output over surface to follow terrain and ignore 31 ! buildings (J.Resler, T.Gronemeier) 30 ! Replace function get_topography_top_index by topo_top_ind 32 31 ! 33 32 ! 4157 2019-08-14 09:19:12Z suehring … … 691 690 USE indices, & 692 691 ONLY: nnx, nny, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, & 693 nzb, nzt 692 nzb, nzt, topo_top_ind 694 693 695 694 USE, INTRINSIC :: iso_c_binding … … 737 736 738 737 USE surface_mod, & 739 ONLY: get_topography_top_index, get_topography_top_index_ji, & 740 ind_pav_green, ind_veg_wall, ind_wat_win, & 738 ONLY: ind_pav_green, ind_veg_wall, ind_wat_win, & 741 739 surf_lsm_h, surf_lsm_v, surf_type, surf_usm_h, surf_usm_v, & 742 740 vertical_surfaces_exist … … 745 743 746 744 CHARACTER(10) :: radiation_scheme = 'clear-sky' ! 'constant', 'clear-sky', or 'rrtmg' 747 748 REAL(wp), PARAMETER :: fill_value = -9999.0_wp !< value for the _FillValue attribute749 745 750 746 ! … … 3583 3579 ! 3584 3580 !-- Determine minimum topography top index. 3585 k_topo_l = MINVAL( get_topography_top_index( 's') )3581 k_topo_l = MINVAL( topo_top_ind(nys:nyn,nxl:nxr,0) ) 3586 3582 #if defined( __parallel ) 3587 3583 CALL MPI_ALLREDUCE( k_topo_l, k_topo, 1, MPI_INTEGER, MPI_MIN, & … … 3773 3769 DO i = nxl, nxr 3774 3770 DO j = nys, nyn 3775 k_topo_l = get_topography_top_index_ji( j, i, 's')3771 k_topo_l = topo_top_ind(j,i,0) 3776 3772 DO k = k_topo_l+1, nzt+1 3777 3773 rad_lw_hr(k,j,i) = rrtm_lwhr(0,k-k_topo_l) * d_hours_day … … 4066 4062 ! 4067 4063 !-- Obtain topography top index (lower bound of RRTMG) 4068 k_topo = get_topography_top_index_ji( j, i, 's')4064 k_topo = topo_top_ind(j,i,0) 4069 4065 4070 4066 IF ( lw_radiation ) THEN … … 5688 5684 ! 5689 5685 !-- Following expression equals former kk = k - nzb_s_inner(j,i) 5690 kk = k - get_topography_top_index_ji( j, i, 's') !- lad arrays are defined flat5686 kk = k - topo_top_ind(j,i,0) !- lad arrays are defined flat 5691 5687 pc_heating_rate(kk, j, i) = (pcbinsw(ipcgb) + pcbinlw(ipcgb)) & 5692 5688 * pchf_prep(k) * pt(k, j, i) !-- = dT/dt … … 5701 5697 j = pcbl(iy, ipcgb) 5702 5698 k = pcbl(iz, ipcgb) 5703 kk = k - get_topography_top_index_ji( j, i, 's') !- lad arrays are defined flat5699 kk = k - topo_top_ind(j,i,0) !- lad arrays are defined flat 5704 5700 CALL pcm_calc_transpiration_rate( i, j, k, kk, pcbinsw(ipcgb), pcbinlw(ipcgb), & 5705 5701 pc_transpiration_rate(kk,j,i), pc_latent_rate(kk,j,i) ) … … 6217 6213 !-- removed later). The following contruct finds the lowest / largest index 6218 6214 !-- for any upward-facing wall (see bit 12). 6219 nzubl = MINVAL( get_topography_top_index( 's') )6220 nzutl = MAXVAL( get_topography_top_index( 's') )6215 nzubl = MINVAL( topo_top_ind(nys:nyn,nxl:nxr,0) ) 6216 nzutl = MAXVAL( topo_top_ind(nys:nyn,nxl:nxr,0) ) 6221 6217 6222 6218 nzubl = MAX( nzubl, nzb ) … … 6235 6231 ! 6236 6232 !-- Find topography top index 6237 k_topo = get_topography_top_index_ji( j, i, 's')6233 k_topo = topo_top_ind(j,i,0) 6238 6234 6239 6235 DO k = nzt+1, 0, -1 … … 6358 6354 ! 6359 6355 !-- Find topography top index 6360 k_topo = get_topography_top_index_ji( j, i, 's')6356 k_topo = topo_top_ind(j,i,0) 6361 6357 6362 6358 DO k = k_topo + 1, pct(j,i) … … 6793 6789 ALLOCATE( nzterrl_l((nyn-nys+1)*(nxr-nxl+1)) ) 6794 6790 nzterrl(nys:nyn,nxl:nxr) => nzterrl_l(1:(nyn-nys+1)*(nxr-nxl+1)) 6795 nzterrl = get_topography_top_index( 's')6791 nzterrl = topo_top_ind(nys:nyn,nxl:nxr,0) 6796 6792 CALL MPI_AllGather( nzterrl_l, nnx*nny, MPI_INTEGER, & 6797 6793 nzterr, nnx*nny, MPI_INTEGER, comm2d, ierr ) … … 6803 6799 DEALLOCATE(nzterrl_l) 6804 6800 #else 6805 nzterr = RESHAPE( get_topography_top_index( 's'), (/(nx+1)*(ny+1)/) )6801 nzterr = RESHAPE( topo_top_ind(nys:nyn,nxl:nxr,0), (/(nx+1)*(ny+1)/) ) 6806 6802 #endif 6807 6803 IF ( plant_canopy ) THEN … … 6884 6880 DO i = nxl, nxr 6885 6881 DO j = nys, nyn 6886 k = get_topography_top_index_ji( j, i, 's')6882 k = topo_top_ind(j,i,0) 6887 6883 6888 6884 sub_lad(k:nz_plant_t, j, i) = lad_s(0:nz_plant_t-k, j, i) … … 10143 10139 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 10144 10140 10141 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 10142 10145 10143 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< 10146 10144 … … 10540 10538 LOGICAL :: found !< 10541 10539 10540 REAL(wp) :: fill_value = -999.0_wp !< value for the _FillValue attribute 10541 10542 10542 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< 10543 10543 … … 11107 11107 CHARACTER (LEN=*) :: variable !< 11108 11108 11109 CHARACTER(LEN=5) :: grid !< flag to distinquish between staggered grids 11110 11109 11111 INTEGER(iwp) :: av !< 11110 11112 INTEGER(iwp) :: i !< 11111 11113 INTEGER(iwp) :: j !< 11112 INTEGER(iwp) :: k !< 11113 INTEGER(iwp) :: im !< loop index for masked variables 11114 INTEGER(iwp) :: jm !< loop index for masked variables 11115 INTEGER(iwp) :: kk !< 11114 INTEGER(iwp) :: k !< 11116 11115 INTEGER(iwp) :: mid !< masked output running index 11117 INTEGER(iwp) :: ktt !< k index of highest terrainsurface11116 INTEGER(iwp) :: topo_top_index !< k index of highest horizontal surface 11118 11117 11119 11118 LOGICAL :: found !< true if output array was found … … 11127 11126 REAL(wp), DIMENSION(:,:,:), POINTER :: to_be_resorted !< points to array which needs to be resorted for output 11128 11127 11128 11129 found = .TRUE. 11130 grid = 's' 11129 11131 resorted = .FALSE. 11130 found = .TRUE.11131 11132 11132 11133 SELECT CASE ( TRIM( variable ) ) … … 11215 11216 DO j = 1, mask_size_l(mid,2) 11216 11217 ! 11217 !-- Get k index of the highest terraing surface 11218 im = mask_i(mid,i) 11219 jm = mask_j(mid,j) 11220 ktt = MINLOC( MERGE( 1, 0, BTEST( wall_flags_0(:,jm,im), 5 )), & 11221 DIM = 1 ) - 1 11218 !-- Get k index of highest horizontal surface 11219 topo_top_index = topo_top_ind(mask_j(mid,j), & 11220 mask_i(mid,i), & 11221 0 ) 11222 ! 11223 !-- Save output array 11222 11224 DO k = 1, mask_size_l(mid,3) 11223 kk = MIN( ktt+mask_k(mid,k), nzt+1 ) 11224 ! 11225 !-- Set value if not in building 11226 IF ( BTEST( wall_flags_0(kk,jm,im), 6 ) ) THEN 11227 local_pf(i,j,k) = fill_value 11228 ELSE 11229 local_pf(i,j,k) = to_be_resorted(kk,jm,im) 11230 ENDIF 11225 local_pf(i,j,k) = to_be_resorted( & 11226 MIN( topo_top_index+mask_k(mid,k), & 11227 nzt+1 ), & 11228 mask_j(mid,j), & 11229 mask_i(mid,i) ) 11231 11230 ENDDO 11232 11231 ENDDO
Note: See TracChangeset
for help on using the changeset viewer.