Changeset 3955 for palm/trunk/SCRIPTS
- Timestamp:
- May 7, 2019 9:55:25 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_csd
r3859 r3955 25 25 # ----------------- 26 26 # $Id$ 27 # Bugfix in preparaing of green roofs 28 # Bugfix: remove LAI for bare soils 29 # 30 # 3859 2019-04-03 20:30:31Z maronga 27 31 # Bugfix: wrong variable naming for 'y' 28 32 # … … 100 104 global settings_lai_alpha 101 105 global settings_lai_beta 106 global settings_veg_type_below_trees 102 107 global ndomains 103 108 … … 180 185 181 186 settings_bridge_width = 3.0 182 settings_lai_roof_intensive = 0.5183 settings_lai_roof_extensive = 1.0187 settings_lai_roof_intensive = 2.5 188 settings_lai_roof_extensive = 0.8 184 189 settings_season = "summer" 185 190 settings_lai_high_default = 6.0 … … 188 193 settings_lai_alpha = 5.0 189 194 settings_lai_beta = 3.0 195 settings_veg_type_below_trees = 3 190 196 ndomains = 0 191 197 … … 295 301 settings_lai_alpha = float(config.get(read_tmp, 'lai_alpha')) 296 302 settings_lai_beta = float(config.get(read_tmp, 'lai_beta')) 303 settings_veg_type_below_trees = config.get(read_tmp, 'vegetation_type_below_trees') 297 304 298 305 if ( read_tmp == 'output' ): … … 886 893 887 894 # assign green fraction on roofs 888 building_pars[3,:,:] = np.where( ( buildings_2d != fillvalues["buildings_2d"] ) & ( green_roofs != fillvalues["building_pars"] ),1.0,fillvalues["building_pars"])895 building_pars[3,:,:] = np.where( ( buildings_2d != fillvalues["buildings_2d"] ) & ( green_roofs != fillvalues["building_pars"] ) & ( green_roofs != 0.0 ),1,fillvalues["building_pars"] ) 889 896 890 897 # assign leaf area index for vegetation on roofs 891 building_pars[4,:,:] = np.where( ( buildings_2d != fillvalues["buildings_2d"] ) & ( green_roofs == 1.0),settings_lai_roof_intensive,fillvalues["building_pars"])892 building_pars[4,:,:] = np.where( ( buildings_2d != fillvalues["buildings_2d"] ) & ( green_roofs == 2.0),settings_lai_roof_extensive,building_pars[4,:,:])898 building_pars[4,:,:] = np.where( ( buildings_2d != fillvalues["buildings_2d"] ) & ( green_roofs >= 0.5 ),settings_lai_roof_intensive,fillvalues["building_pars"]) 899 building_pars[4,:,:] = np.where( ( buildings_2d != fillvalues["buildings_2d"] ) & ( green_roofs < 0.5 ),settings_lai_roof_extensive,building_pars[4,:,:]) 893 900 894 901 … … 1074 1081 1075 1082 # Remove high vegetation wherever it is replaced by a leaf area density. This should effectively remove all high vegetation pixels 1076 vegetation_type = np.where((lad[0,:,:] != fillvalues["tree_data"]) & (vegetation_type != fillvalues["vegetation_type"]), 3,vegetation_type)1083 vegetation_type = np.where((lad[0,:,:] != fillvalues["tree_data"]) & (vegetation_type != fillvalues["vegetation_type"]),settings_veg_type_below_trees,vegetation_type) 1077 1084 1078 1085 # If desired, remove all high vegetation. TODO: check if this is still necessary … … 1088 1095 1089 1096 # Remove lai for pixels that have no vegetation_type 1090 lai_low = np.where( vegetation_type != fillvalues["vegetation_type"], lai_low, fillvalues["tree_data"])1097 lai_low = np.where( ( (vegetation_type != fillvalues["vegetation_type"]) & (vegetation_type != 1) ), lai_low, fillvalues["tree_data"]) 1091 1098 1092 1099 # Overwrite lai in vegetation_parameters … … 1101 1108 1102 1109 del vegetation_type, lad, lai, patch_height, vegetation_pars, zlad 1110 1111 1112 # Final adjustment of vegetation parameters: remove LAI where a bare soil was set 1113 for i in range(0,ndomains): 1114 1115 vegetation_type = nc_read_from_file_2d_all(filename[i], 'vegetation_type') 1116 vegetation_pars = nc_read_from_file_3d_all(filename[i], 'vegetation_pars') 1117 lai = vegetation_pars[1,:,:] 1118 1119 1120 # Remove lai for pixels that have no vegetation_type 1121 lai = np.where( ( (vegetation_type != fillvalues["vegetation_type"]) & (vegetation_type != 1) ), lai, fillvalues["tree_data"]) 1122 1123 # Overwrite lai in vegetation_parameters 1124 vegetation_pars[1,:,:] = np.copy(lai) 1125 nc_overwrite_to_file_3d(filename[i], 'vegetation_pars', vegetation_pars) 1126 1127 del vegetation_type, lai, vegetation_pars 1128 1103 1129 1104 1130 # Final consistency check
Note: See TracChangeset
for help on using the changeset viewer.