Changeset 4746 for palm/trunk
- Timestamp:
- Oct 15, 2020 5:16:30 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_csd
r4490 r4746 20 20 # Current revisions: 21 21 # ----------------- 22 # 23 # 22 # 23 # 24 24 # Former revisions: 25 25 # ----------------- 26 26 # $Id$ 27 # Add support for backyard high vegetation, which is commonly classified as 28 # short grass 29 # 30 # 4490 2020-04-10 05:32:45Z maronga 27 31 # Bugfix: call of canopy generator was not made if tree heights were only 28 32 # available via patch_height, but not in tree_height … … 1066 1070 lai_high = np.where( (lad[0,:,:] == fillvalues["tree_data"]) & ( ( (vegetation_type == 4) | (vegetation_type == 5) | (vegetation_type == 6) |(vegetation_type == 7) | (vegetation_type == 17) | (vegetation_type == 18) ) & ( (patch_height == fillvalues["tree_data"]) | (patch_height >= domain_dz[i])) ),1.0,fillvalues["tree_data"]) 1067 1071 1072 1073 # Treat all pixels where short grass is defined, but where a patch_height >= dz is found, as high vegetation (often the case in backyards) 1074 lai_high = np.where( (lai_high == fillvalues["tree_data"]) & (patch_height >= domain_dz[i]) & (vegetation_type == 3), 1.0, lai_high) 1075 1068 1076 # Now, assign either the default LAI for high vegetation or keep 1.0 from the lai_high array. 1069 1077 lai_high = np.where( (lai_high != fillvalues["tree_data"]) & (lai == fillvalues["tree_data"]), settings_lai_high_default, lai_high) 1070 1078 1071 # If lai values are available in the laiarray, write them on the lai_high array1079 # If LAI values are available in the LAI array, write them on the lai_high array 1072 1080 lai_high = np.where( (lai_high != fillvalues["tree_data"]) & (lai != fillvalues["tree_data"]), lai, lai_high) 1081 1073 1082 1074 1083 # Define a patch height wherever it is missing, but where a high vegetation LAI was set 1075 1084 patch_height = np.where ( (lai_high != fillvalues["tree_data"]) & (patch_height == fillvalues["tree_data"]), settings_patch_height_default, patch_height) 1085 1076 1086 1077 1087 # Remove pixels where street trees were already set … … 1091 1101 lad_patch, patch_nz, status = process_patch(domain_dz[i],patch_height,max(zlad),lai_high,settings_lai_alpha,settings_lai_beta) 1092 1102 1093 lad[0:patch_nz+1,:,:] = np.where( (lad[0:patch_nz+1,:,:] == fillvalues["tree_data"]),lad_patch[0:patch_nz+1,:,:], lad[0:patch_nz+1,:,:] ) 1103 # 2D loop in order to avoid memory problems with large arrays 1104 for ii in range(0,domain_nx[i]): 1105 for jj in range(0,domain_ny[i]): 1106 1107 lad[0:patch_nz+1,jj,ii] = np.where( (lad[0:patch_nz+1,jj,ii] == fillvalues["tree_data"]),lad_patch[0:patch_nz+1,jj,ii], lad[0:patch_nz+1,jj,ii] ) 1094 1108 1095 1109 # Remove high vegetation wherever it is replaced by a leaf area density. This should effectively remove all high vegetation pixels
Note: See TracChangeset
for help on using the changeset viewer.