Changeset 4746 for palm/trunk


Ignore:
Timestamp:
Oct 15, 2020 5:16:30 PM (4 years ago)
Author:
maronga
Message:

support for backyard trees in palm_csd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palm_csd

    r4490 r4746  
    2020# Current revisions:
    2121# -----------------
    22 # 
    23 # 
     22#
     23#
    2424# Former revisions:
    2525# -----------------
    2626# $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
    2731# Bugfix: call of canopy generator was not made if tree heights were only
    2832# available via patch_height, but not in tree_height
     
    10661070      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"])
    10671071
     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                         
    10681076#     Now, assign either the default LAI for high vegetation or keep 1.0 from the lai_high array.
    10691077      lai_high = np.where( (lai_high != fillvalues["tree_data"]) & (lai == fillvalues["tree_data"]), settings_lai_high_default, lai_high)
    10701078
    1071 #     If lai values are available in the lai array, write them on the lai_high array
     1079#     If LAI values are available in the LAI array, write them on the lai_high array
    10721080      lai_high = np.where( (lai_high != fillvalues["tree_data"]) & (lai != fillvalues["tree_data"]), lai, lai_high)
     1081
    10731082
    10741083#     Define a patch height wherever it is missing, but where a high vegetation LAI was set
    10751084      patch_height = np.where ( (lai_high != fillvalues["tree_data"]) & (patch_height == fillvalues["tree_data"]), settings_patch_height_default, patch_height)
     1085
    10761086
    10771087#     Remove pixels where street trees were already set
     
    10911101         lad_patch, patch_nz, status = process_patch(domain_dz[i],patch_height,max(zlad),lai_high,settings_lai_alpha,settings_lai_beta)
    10921102
    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] )
    10941108
    10951109#     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.