161 | | * hydrol : Move flag ok_throughfall_by_pft to pft_parameters. The pft parameter throughfall_by_pft is initiliazed and read in pft_parameters.f90. Correct memory allocation and initialization for parameter throughfall_by_pft : |
| 161 | * hydrol : Move flag ok_throughfall_by_pft to pft_parameters : |
| 162 | {{{ |
| 163 | IF ( active_flags%hydrol_cwrr ) THEN |
| 164 | |
| 165 | !! 2.1 Read the flag ok_throughfall_by_pft to know if |
| 166 | !! we have to use the parameter throughfall_by_pft |
| 167 | |
| 168 | !Config Key = OK_THROUGHFALL_PFT |
| 169 | !Config Desc = Activate use of PERCENT_THROUGHFALL_PFT |
| 170 | !Config If = HYDROL_CWRR |
| 171 | !Config Def = FALSE |
| 172 | !Config Help = If NOT OFF_LINE_MODE it is always TRUE (coupled with a GCM) |
| 173 | !Config Units = [FLAG] |
| 174 | IF ( .NOT. OFF_LINE_MODE ) ok_throughfall_by_pft = .TRUE. |
| 175 | CALL getin_p('OK_THROUGHFALL_PFT',ok_throughfall_by_pft) |
| 176 | |
| 177 | END IF |
| 178 | |
| 179 | }}} |
| 180 | |
| 181 | |
| 182 | The pft parameter throughfall_by_pft is initiliazed and read in pft_parameters.f90. Correct memory allocation and initialization for parameter throughfall_by_pft : |
| 183 | |
| 184 | |
| 185 | {{{ |
| 186 | IF ( .NOT.(active_flags%hydrol_cwrr) .OR. (active_flags%hydrol_cwrr .AND. ok_throughfall_by_pft) ) THEN |
| 187 | ALLOCATE(throughfall_by_pft(nvm),stat=ier) |
| 188 | l_error = l_error .OR. (ier /= 0) |
| 189 | IF (l_error) THEN |
| 190 | WRITE(numout,*) ' Memory allocation error for throughfall_by_pft. We stop. We need nvm words = ',nvm |
| 191 | STOP 'pft_parameters_alloc' |
| 192 | END IF |
| 193 | END IF |
| 194 | }}} |
| 195 | |
| 196 | |