code: public static HashMap<String, ArrayList<String>> getRootDistribution(HashMap data, String var, String m, String pp, String rd) {
  
          String[] sllbs;
          String k;
          HashMap<String, ArrayList<String>> results = new HashMap<String, ArrayList<String>>();
          ArrayList<String> result = new ArrayList<String>();
          ArrayList<HashMap<String, String>> soilLayers = getSoilLayer(data);
  
          if (soilLayers == null) {
              return results;
          } else if (soilLayers.isEmpty()) {
              LOG.error("----  SOIL LAYER DATA IS EMPTY");
              return results;
          } else {
              try {
                  sllbs = new String[soilLayers.size()];
                  k = divide(Math.log(0.02) + "", substract(rd, pp));
                  for (int i = 0; i < soilLayers.size(); i++) {
                      sllbs[i] = soilLayers.get(i).get("sllb");
                  }
              } catch (NumberFormatException e) {
                  LOG.error("INVALID INPUT NUMBER [" + e.getMessage() + "]");
                  return results;
              }
          }
  
          // First layer
          result.add(round(getGrowthFactor(divide(sllbs[0], "2"), pp, k, m), 3));
  
          // Other layers
          for (int i = 1; i < sllbs.length; i++) {
              result.add(round(getGrowthFactor(average(sllbs[i], sllbs[i - 1]), pp, k, m), 3));
          }
  
          results.put(var, result);
          return results;
      }
docs: Calculate root growth factor (0-1) for each soil layer
  
  @param data The data map
  @param var The variable name that will be used for storing the result
  @param m Maximum value in the top PP cm of soil (units depend on
  variable)
  @param pp depth of top of curve (pivot point) (cm)
  @param rd maximum rooting depth (cm), or depth at which the value is 2%
  of the maximum value
  
  @return An {@code ArrayList} of {@code root distribution} for each layer
  of given soil