public HashMap < String , String > computeSoil ( Map < String , String > fullCurrentSoil , Map < String , String > previousSoil ) { HashMap < String , String > aggregatedSoil ; String fullCurrentValue ; String previousValue ; Float newValue ; newValue = 0f ; aggregatedSoil = new HashMap < String , String > ( ) ; for ( String p : allParams ) { if ( SLLB . equals ( p ) ) { newValue = ( parseFloat ( fullCurrentSoil . get ( p ) ) + parseFloat ( previousSoil . get ( p ) ) ) ; } else if ( ( ICNH4 . equals ( p ) && fullCurrentSoil . containsKey ( ICNH4 ) && previousSoil . containsKey ( ICNH4 ) ) || ICNO3 . equals ( p ) && fullCurrentSoil . containsKey ( ICNO3 ) && previousSoil . containsKey ( ICNO3 ) ) { newValue = computeInitialConditions ( p , fullCurrentSoil , previousSoil ) ; } else { fullCurrentValue = fullCurrentSoil . get ( p ) == null ? LayerReducerUtil . defaultValue ( p ) : fullCurrentSoil . get ( p ) ; previousValue = previousSoil . get ( p ) == null ? LayerReducerUtil . defaultValue ( p ) : previousSoil . get ( p ) ; newValue = ( parseFloat ( fullCurrentValue ) + parseFloat ( previousValue ) ) / 2f ; } aggregatedSoil . put ( p , newValue . toString ( ) ) ; } return aggregatedSoil ; }
Create a new soil filled with aggregated data coming from soils set as input parameters .