| 123 | == Formules de convolution/déconvolution == |
| 124 | La convolution est définit par les corr_veg_soil |
| 125 | {{{ |
| 126 | ! somme(corr_veg_soil / vegtot / veget_max ) = 1 - vegtot = frac_nobio |
| 127 | DO ji=1,kjpindex |
| 128 | tot_corr_veg_soil(ji)=zero |
| 129 | DO jst = 1, nstm |
| 130 | DO jv = 1,nvm |
| 131 | tot_corr_veg_soil(ji)=tot_corr_veg_soil(ji)+corr_veg_soil(ji,jv,jst) / vegtot(ji) / veget_max(ji,jv) |
| 132 | ENDDO |
| 133 | ENDDO |
| 134 | ENDDO |
| 135 | |
| 136 | DO ji=1,kjpindex |
| 137 | IF ( ABS( tot_corr_veg_soil(ji) - (1 - vegtot(ji)) ) .GT. EPS1 ) THEN |
| 138 | WRITE(numout,*) 'corr_veg_soil SPLIT FALSE:ji=',ji,tot_corr_veg_soil(ji),(1 - vegtot(ji)) |
| 139 | WRITE(numout,*) 'err',ABS( tot_corr_veg_soil(ji) - (1 - vegtot(ji)) ) |
| 140 | WRITE(numout,*) 'vegtot',vegtot(ji) |
| 141 | DO jv=1,nvm |
| 142 | WRITE(numout,*) 'jv,veget_max,corr_veg_soil',jv,veget_max(ji,jv),corr_veg_soil(ji,jv,:) |
| 143 | END DO |
| 144 | ENDIF |
| 145 | ENDDO |
| 146 | }}} |
| 147 | Donc pour chaque point de terre : |
| 148 | {{{ |
| 149 | #!formula |
| 150 | #density=100 |
| 151 | \displaystyle \sum_{jv=1,nvm} \sum_{jst=1,nstm}\left( \frac {corr\_veg\_soil(jv,jst)}{vegtot \times veget\_max(jv)} \right) = 1 - vegtot= frac\_nobio |
| 152 | }}} |
| 153 | soit |
| 154 | {{{ |
| 155 | #!formula |
| 156 | #density=100 |
| 157 | \displaystyle \sum_{jv=1,nvm} \sum_{jst=1,nstm}\left( \frac {corr\_veg\_soil(jv,jst)}{veget\_max(jv)} \right) = vegtot\times (1 - vegtot) = vegtot \times frac\_nobio |
| 158 | }}} |
| 159 | La formule de convolution est alors : |
| 160 | {{{ |
| 161 | DO jv=1,nvm |
| 162 | DO jst=1,nstm |
| 163 | DO ji=1,kjpindex |
| 164 | IF(veget_max(ji,jv).GT.min_sechiba) THEN |
| 165 | precisol_ns(ji,jst)=precisol_ns(ji,jst)+precisol(ji,jv)* & |
| 166 | & corr_veg_soil(ji,jv,jst) / vegtot(ji) / veget_max(ji,jv)) |
| 167 | ENDIF |
| 168 | END DO |
| 169 | END DO |
| 170 | END DO |
| 171 | |
| 172 | ! |
| 173 | ! Now we check if the deconvolution is correct and conserves the fluxes: |
| 174 | |
| 175 | IF (check_cwrr) THEN |
| 176 | |
| 177 | |
| 178 | tmp_check1(:)=zero |
| 179 | tmp_check2(:)=zero |
| 180 | |
| 181 | ! First we check the precisol and evapnu |
| 182 | |
| 183 | DO jst=1,nstm |
| 184 | DO ji=1,kjpindex |
| 185 | tmp_check1(ji)=tmp_check1(ji) + & |
| 186 | & precisol_ns(ji,jst)*soiltile(ji,jst)*vegtot(ji) |
| 187 | END DO |
| 188 | END DO |
| 189 | |
| 190 | DO jv=1,nvm |
| 191 | DO ji=1,kjpindex |
| 192 | tmp_check2(ji)=tmp_check2(ji) + precisol(ji,jv) |
| 193 | END DO |
| 194 | END DO |
| 195 | |
| 196 | DO ji=1,kjpindex |
| 197 | |
| 198 | IF(ABS(tmp_check1(ji)- tmp_check2(ji)).GT.allowed_err) THEN |
| 199 | WRITE(numout,*) 'PRECISOL SPLIT FALSE:ji=',ji,tmp_check1(ji),tmp_check2(ji) |
| 200 | WRITE(numout,*) 'err',ABS(tmp_check1(ji)- tmp_check2(ji)) |
| 201 | WRITE(numout,*) 'vegtot',vegtot(ji) |
| 202 | |
| 203 | DO jv=1,nvm |
| 204 | WRITE(numout,*) 'jv,veget_max, precisol',jv,veget_max(ji,jv),precisol(ji,jv) |
| 205 | DO jst=1,nstm |
| 206 | WRITE(numout,*) 'corr_veg_soil:jst',jst,corr_veg_soil(ji,jv,jst) |
| 207 | END DO |
| 208 | END DO |
| 209 | |
| 210 | DO jst=1,nstm |
| 211 | WRITE(numout,*) 'jst,precisol_ns',jst,precisol_ns(ji,jst) |
| 212 | WRITE(numout,*) 'soiltile', soiltile(ji,jst) |
| 213 | END DO |
| 214 | waterbal_error=.TRUE. |
| 215 | CALL ipslerr(2, 'hydrol_split_soil', 'We will STOP after hydrol_split_soil.',& |
| 216 | & 'check_CWRR','PRECISOL SPLIT FALSE') |
| 217 | ENDIF |
| 218 | |
| 219 | END DO |
| 220 | |
| 221 | ENDIF |
| 222 | |
| 223 | }}} |