Go to the documentation of this file.00001
00002
00003
00004 subroutine hydro_canopy(sib,sib_loc)
00005
00006 use kinds
00007 use sibtype
00008
00009 use physical_parameters, only: &
00010 tice
00011
00012 use sib_const_module, only: &
00013 cww, &
00014 clai, &
00015 snomel, &
00016 denice, &
00017 denh2o, &
00018 dtt, &
00019 dti, &
00020 cpliq, &
00021 cpice, &
00022 tkice
00023
00024
00025 implicit none
00026
00027
00028
00029 type(sib_t), intent(inout) :: sib
00030 type(sib_local_vars) ,intent(inout) :: sib_loc
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 real(kind=dbl_kind) :: pcoefs(2,2)
00068 real(kind=dbl_kind) :: ap
00069 real(kind=dbl_kind) :: bp
00070 real(kind=dbl_kind) :: cp
00071 real(kind=dbl_kind) :: totalp
00072 real(kind=dbl_kind) :: pinf
00073 real(kind=dbl_kind) :: fpi
00074 real(kind=dbl_kind) :: xsc
00075 real(kind=dbl_kind) :: xss
00076 real(kind=dbl_kind) :: xs
00077 real(kind=dbl_kind) :: capacp
00078 real(kind=dbl_kind) :: snowwp
00079 real(kind=dbl_kind) :: spechc
00080
00081 real(kind=dbl_kind) :: chiv
00082 real(kind=dbl_kind) :: aa
00083 real(kind=dbl_kind) :: bb
00084 real(kind=dbl_kind) :: exrain
00085 real(kind=dbl_kind) :: zload
00086 real(kind=dbl_kind) :: tti
00087 real(kind=dbl_kind) :: tex
00088 real(kind=dbl_kind) :: thru
00089 real(kind=dbl_kind) :: freeze
00090 real(kind=dbl_kind) :: diff
00091 real(kind=dbl_kind) :: ccp
00092 real(kind=dbl_kind) :: cct
00093 real(kind=dbl_kind) :: tsd
00094
00095 real(kind=dbl_kind) :: tta
00096 real(kind=dbl_kind) :: ttb
00097 real(kind=dbl_kind) :: cca
00098 real(kind=dbl_kind) :: ccb
00099 real(kind=dbl_kind) :: ccc
00100 real(kind=dbl_kind) :: arg
00101 real(kind=dbl_kind) :: fliq
00102 real(kind=dbl_kind) :: bifall
00103 real(kind=dbl_kind) :: dz_snowfall
00104 real(kind=dbl_kind) :: capac1m
00105
00106 integer(kind=int_kind) :: pcptype
00107 integer(kind=int_kind) :: newnode
00108 integer(kind=int_kind) :: i,j
00109
00110 data pcoefs(1,1)/ 20. /, pcoefs(1,2)/ .206E-8 /, &
00111 pcoefs(2,1)/ 0.0001 /, pcoefs(2,2)/ 0.9999 /, bp /20. /
00112
00113
00114
00115
00116
00117
00118 dz_snowfall = 0.0
00119
00120 ap = pcoefs(2,1)
00121 cp = pcoefs(2,2)
00122 totalp = (sib%diag%cuprt + sib%diag%lsprt) * dtt
00123
00124
00125 if(totalp < 1.0E-10) then
00126 totalp = 0.0
00127 sib%diag%cuprt = 0.0
00128 sib%diag%lsprt = 0.0
00129 endif
00130
00131 if( sib%prog%snow_veg > 0.0 .or. sib%prog%snow_mass > 0.0 &
00132 .or. sib%prog%tm < tice ) sib%diag%cuprt = 0.0
00133 sib%diag%lsprt = totalp/dtt - sib%diag%cuprt
00134
00135 if(totalp > 1.e-8) then
00136 ap = sib%diag%cuprt * dtt / totalp * pcoefs(1,1) + &
00137 sib%diag%lsprt * dtt / totalp * pcoefs(2,1)
00138 cp = sib%diag%cuprt * dtt / totalp * pcoefs(1,2) + &
00139 sib%diag%lsprt * dtt / totalp * pcoefs(2,2)
00140 endif
00141
00142 thru = 0.
00143 fpi = 0.
00144
00145
00146
00147
00148
00149 sib%diag%p0 = totalp
00150
00151
00152 capac1m = sib%prog%capac(1)/denh2o
00153
00154 xsc = max(0.0_dbl_kind, capac1m - sib%param%satcap(1) )
00155 capac1m = capac1m - xsc
00156 xss = max(0.0_dbl_kind, (sib%prog%snow_veg/denice - sib%param%satcap(1)) )
00157 sib%prog%snow_veg = (sib%prog%snow_veg/denice - xss)*denice
00158
00159
00160 thru = thru + xsc + xss
00161
00162 capacp = capac1m
00163 snowwp = sib%prog%snow_veg/denice
00164
00165
00166
00167
00168 spechc = &
00169 min( 0.05_dbl_kind, ( capac1m + sib%prog%snow_veg/denice ) ) &
00170 * cww + sib%param%zlt * clai
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185 chiv = sib%param%chil
00186 if ( abs(chiv) <= 0.01 ) chiv = 0.01
00187
00188 aa = 0.5 - 0.633 * chiv - 0.33 * chiv * chiv
00189 bb = 0.877 * ( 1. - 2. * aa )
00190 exrain = aa + bb
00191
00192 zload = capac1m + sib%prog%snow_veg/denice
00193 fpi = ( 1.-exp( - exrain*sib%param%zlt/sib%param%vcover ) )* sib%param%vcover
00194
00195
00196
00197 tti = sib%diag%p0 * ( 1.-fpi )
00198
00199
00200
00201
00202 xs = 1.
00203
00204 if ( sib%diag%p0 >= 1.e-9 ) then
00205
00206 arg = ( sib%param%satcap(1)-zload )/ ( sib%diag%p0*fpi*ap ) -cp/ap
00207
00208 if ( arg >= 1.e-9 ) then
00209 xs = -1./bp * log( arg )
00210 xs = min( xs, 1.0_dbl_kind )
00211 xs = max( xs, 0.0_dbl_kind )
00212 endif
00213 endif
00214
00215
00216
00217 tex = sib%diag%p0*fpi * &
00218 ( ap/bp*( 1.- exp( -bp*xs )) + cp*xs ) - &
00219 ( sib%param%satcap(1) - zload ) * xs
00220 tex = max( tex, 0.0_dbl_kind )
00221
00222
00223
00224
00225
00226
00227
00228 thru = thru + tti + tex
00229
00230
00231 pinf = sib%diag%p0 - thru
00232
00233
00234 pinf = MAX(pinf,0.0_dbl_kind)
00235
00236 if( sib%prog%tm > tice ) then
00237 capac1m = capac1m + pinf
00238 else
00239 sib%prog%snow_veg = (sib%prog%snow_veg/denice + pinf)*denice
00240 endif
00241
00242
00243
00244
00245
00246
00247
00248
00249 freeze = 0.
00250 diff = ( capac1m+sib%prog%snow_veg/denice - capacp - snowwp )*cww
00251
00252 ccp = spechc
00253 cct = spechc + diff
00254
00255 tsd = ( sib%prog%tc * ccp + sib%prog%tm * diff ) / cct
00256
00257 if ( ( sib%prog%tc > tice .AND. sib%prog%tm <= tice ) .or. &
00258 ( sib%prog%tc <= tice .AND. sib%prog%tm > tice ) )then
00259
00260 tta = sib%prog%tc
00261 ttb = sib%prog%tm
00262 cca = ccp
00263 ccb = diff
00264 if ( tsd <= tice ) then
00265
00266
00267
00268
00269
00270 ccc = capacp * 0.001 * snomel
00271 if ( sib%prog%tc < sib%prog%tm ) ccc = diff * snomel / cww
00272 tsd = ( tta * cca + ttb * ccb + ccc ) / cct
00273
00274 freeze = ( tice * cct - ( tta * cca + ttb * ccb ) )
00275 freeze = (min ( ccc, freeze )) / snomel
00276 if(tsd > tice) tsd = tice - 0.01
00277
00278
00279 else
00280
00281
00282
00283
00284
00285 ccc = - sib%prog%snow_veg/denice * snomel
00286 if ( sib%prog%tc > sib%prog%tm ) ccc = - diff * snomel / cww
00287
00288 tsd = ( tta * cca + ttb * ccb + ccc ) / cct
00289
00290 freeze = ( tice * cct - ( tta * cca + ttb * ccb ) )
00291 freeze = (max( ccc, freeze )) / snomel
00292 if(tsd <= tice)tsd = tice - 0.01
00293
00294
00295 endif
00296 endif
00297
00298 sib%prog%snow_veg = (sib%prog%snow_veg/denice + freeze)*denice
00299 capac1m = capac1m - freeze
00300 sib%prog%snow_veg = max(sib%prog%snow_veg,0.0_dbl_kind)
00301 capac1m = max(capac1m,0.0_dbl_kind)
00302
00303 xs = max( 0.0_dbl_kind, ( capac1m - sib%param%satcap(1) ) )
00304 if ( sib%prog%snow_veg/denice >= 1.0e-7_dbl_kind ) xs = capac1m
00305 capac1m = capac1m - xs
00306 sib%prog%tc = tsd
00307
00308
00309
00310
00311
00312
00313
00314 sib%diag%p0 = thru + xs
00315
00316
00317 sib%diag%p0 = sib%diag%p0 * dti * 1000.0
00318
00319
00320
00321
00322
00323
00324 if(sib%prog%tm >= tice + 2.5) then
00325 pcptype = 1
00326 else
00327 pcptype = 2
00328 endif
00329
00330
00331
00332
00333 if (pcptype == 1 ) then
00334 fliq = 1.0
00335 sib%diag%pcpg_snow = 0.0
00336 sib%diag%pcpg_rain = sib%diag%p0
00337
00338 else
00339 if(sib%prog%tm <= tice) then
00340 fliq = 0.0
00341 elseif(sib%prog%tm < tice + 2.0) then
00342 fliq = -54.61 + 0.2*sib%prog%tm
00343 else
00344 fliq = 0.40
00345 endif
00346 fliq = max(0.0_dbl_kind,fliq)
00347
00348
00349
00350
00351
00352
00353
00354 if(sib%prog%tm > tice + 2.0) then
00355 bifall = 189.0
00356 elseif(sib%prog%tm > tice - 15.0) then
00357 bifall = 50.0 + 1.7 * (sib%prog%tm - tice + 15.0)**1.5
00358 else
00359 bifall = 50.0
00360 endif
00361
00362 sib%diag%pcpg_snow = sib%diag%p0 * (1.0 - fliq)
00363 sib%diag%pcpg_rain = sib%diag%p0 * fliq
00364
00365
00366
00367
00368
00369
00370 dz_snowfall = sib%diag%pcpg_snow/bifall
00371
00372
00373 sib%prog%snow_depth = sib%prog%snow_depth + dz_snowfall * dtt
00374
00375
00376 if(dz_snowfall > 0.0 .and. sib%prog%nsl < 0) then
00377 sib%prog%dz(sib%prog%nsl+1) = sib%prog%dz(sib%prog%nsl+1) + &
00378 dz_snowfall * dtt
00379 endif
00380
00381 sib%prog%snow_mass = sib%prog%snow_mass + sib%diag%pcpg_snow * dtt
00382
00383 endif
00384
00385
00386
00387
00388 newnode = 0
00389 if( sib%prog%nsl == 0 .and. sib%diag%pcpg_snow > 0.0 ) then
00390 newnode = 1
00391 sib%prog%nsl = -1
00392 sib%prog%dz(0) = sib%prog%snow_depth
00393 sib%prog%node_z(0) = -0.5 * sib%prog%dz(0)
00394 sib%prog%layer_z(-1) = -sib%prog%dz(0)
00395 sib%prog%layer_z(0) = 0.0
00396 sib%prog%snow_age = 0.0
00397 sib%prog%td(0) = MIN(tice, sib%prog%ta)
00398 sib%prog%www_ice(0) = sib%prog%snow_mass
00399 sib%prog%www_liq(0) = 0.0
00400 sib_loc%frac_iceold(0) = 1.0
00401 sib%param%shcap(0) = cpliq*sib%prog%www_liq(0) + &
00402 cpice*sib%prog%www_ice(0)
00403
00404 sib%param%tksoil(0) = tkice
00405 endif
00406
00407
00408 if(sib%prog%nsl < 0 .and. newnode == 0) then
00409 sib%prog%www_ice(sib%prog%nsl+1) = sib%prog%www_ice(sib%prog%nsl+1) + &
00410 dtt * sib%diag%pcpg_snow
00411 sib%prog%dz(sib%prog%nsl+1) = sib%prog%dz(sib%prog%nsl+1) + &
00412 dz_snowfall * dtt
00413 endif
00414
00415 sib%prog%capac(1) = capac1m * denh2o
00416
00417
00418 end subroutine hydro_canopy