Changeset 430
- Timestamp:
- 2011-08-31T12:17:34+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ORCHIDEE_EXT/ORCHIDEE_OL/weather.f90
r424 r430 103 103 ! 104 104 REAL,PARAMETER :: pir = pi/180. 105 105 REAL,PARAMETER :: rair = 287. 106 106 !- 107 107 ! Parametres orbitaux: … … 217 217 ! daily average temperature (K) 218 218 REAL :: td(npoi) 219 REAL,PARAMETER :: rair = 287.219 !!$ REAL,PARAMETER :: rair = 287. 220 220 !>> The two following parameters are replaced by the values used by ORCHIDEE in constantes.f90 221 221 ! grav by cte_grav= 9.80665 … … 288 288 STOP 289 289 ENDIF 290 xstore(:,:) = 0.290 xstore(:,:) = zero 291 291 npoi0 = npoi 292 292 ELSE IF (npoi /= npoi0) THEN … … 432 432 !------ initialize daily precipitation to zero 433 433 !------- 434 precip(i) = 0.0434 precip(i) = zero 435 435 !------- 436 436 IF (xinprec(i,imonth) > 1.e-6) THEN … … 509 509 CALL bcast(count_not_ok_g) 510 510 !- 511 z(:) =0.0511 z(:) = zero 512 512 DO WHILE (count_not_ok_g > 0) 513 513 IF (is_root_prc) THEN … … 520 520 DO i=1,npoi 521 521 IF ((iwet(i) == 1).AND.(not_ok(i) == 1)) then 522 IF ( (rn1-tr1(i)) <= 0.) THEN523 s1 = 0.0522 IF ( (rn1-tr1(i)) <= zero ) THEN 523 s1 = zero 524 524 ELSE 525 525 s1 = rn1**aa(i) 526 526 ENDIF 527 527 !----------- 528 IF ((rn2-tr2(i)) <= 0.) THEN529 s2 = 0.0528 IF ((rn2-tr2(i)) <= zero) THEN 529 s2 = zero 530 530 ELSE 531 531 s2 = rn2**ab(i) … … 533 533 !----------- 534 534 s12 = s1+s2 535 IF ((s12-1.0) <= 0.) THEN535 IF ((s12-1.0) <= zero) THEN 536 536 z(i) = s1/s12 537 537 not_ok(i) = 0 … … 616 616 & /REAL(NINT(MAX(1.,xinwet(i,imonth)))) 617 617 ELSE 618 precip(i) = 0.618 precip(i) = zero 619 619 ENDIF 620 620 ENDDO … … 638 638 !---- modify maximum temperatures for wet and dry days 639 639 !----- 640 IF (pwet(i) /= 0.0) THEN640 IF (pwet(i) /= zero) THEN 641 641 tmaxd = tmaxm+pwet(i)*omtmax*trngm 642 642 tmaxw = tmaxd- omtmax*trngm … … 707 707 !---- following logic of the EPIC weather generator code 708 708 !----- 709 IF (pwet(i) /= 0.0) THEN710 cloudd = (cloudm-pwet(i)*omcloud)/( 1.0-pwet(i)*omcloud)711 cloudd = MIN( 1.0,MAX(0.0,cloudd))712 cloudw = (cloudm-( 1.0-pwet(i))*cloudd)/pwet(i)709 IF (pwet(i) /= zero) THEN 710 cloudd = (cloudm-pwet(i)*omcloud)/(un-pwet(i)*omcloud) 711 cloudd = MIN(un,MAX(zero,cloudd)) 712 cloudw = (cloudm-(un-pwet(i))*cloudd)/pwet(i) 713 713 ELSE 714 714 cloudd = cloudm … … 758 758 !-- zero out vectors 759 759 !--- 760 r(1:3) = 0.0761 rr(1:npoi,1:3) = 0.0760 r(1:3) = zero 761 rr(1:npoi,1:3) = zero 762 762 !--- 763 763 !-- update working vectors … … 804 804 cloud(i) = cloude(i)+clouds(i)*xstore(i,3) 805 805 !---- constrain cloud cover to be between 0 and 100% 806 cloud(i) = MAX( 0.0,MIN(1.0,cloud(i)))806 cloud(i) = MAX(zero,MIN(un,cloud(i))) 807 807 enddo 808 808 !--- … … 844 844 !---- following logic of the EPIC weather generator code 845 845 !----- 846 if (pwet(i) /= 0.0) then847 qdd(i) = (qdm(i)-pwet(i)*omqd)/( 1.0-pwet(i)*omqd)846 if (pwet(i) /= zero) then 847 qdd(i) = (qdm(i)-pwet(i)*omqd)/(un-pwet(i)*omqd) 848 848 if (qdd(i) < 0.2) then 849 849 qdd(i) = 0.2 850 850 if (qdd(i) > qdm(i)) qdm(i) = qdd(i) 851 851 ENDIF 852 qdd(i) = MIN( 1.0,qdd(i))853 qdw(i) = (qdm(i)-( 1.0-pwet(i))*qdd(i))/pwet(i)852 qdd(i) = MIN(un,qdd(i)) 853 qdw(i) = (qdm(i)-(un-pwet(i))*qdd(i))/pwet(i) 854 854 ELSE 855 855 qdd(i) = qdm(i) … … 864 864 !----- 865 865 xx = exp(qde(i)) 866 qdup(i) = qde(i)+( 1.0-qde(i))*xx/e867 qdlow(i) = qde(i)*( 1.0-1./xx)866 qdup(i) = qde(i)+(un-qde(i))*xx/e 867 qdlow(i) = qde(i)*(un-1./xx) 868 868 !----- 869 869 !---- randomlly select humidity from triangular distribution function … … 1151 1151 !-- calculate the cosine of the solar zenith angle 1152 1152 !--- 1153 coszen(i) = MAX( 0.0, (sin(xlat)*sin(xdecl) &1153 coszen(i) = MAX(zero, (sin(xlat)*sin(xdecl) & 1154 1154 & + cos(xlat)*cos(xdecl)*cos(angle))) 1155 1155 !--- … … 1342 1342 !-- the surface air temperature 1343 1343 !--- 1344 dtair = 0.01345 dtcloud = 0.01344 dtair = zero 1345 dtcloud = zero 1346 1346 !--- 1347 1347 !-- total downward ir is equal to the sum of: … … 1360 1360 !-- reset snow and rain to zero 1361 1361 !--- 1362 snowa(i) = 0.01363 raina(i) = 0.01362 snowa(i) = zero 1363 raina(i) = zero 1364 1364 !--- 1365 1365 !-- if precipitation event then calculate … … 2223 2223 CALL restget (rest_id, var_name, iim_g, jjm_g, 1, itau, .TRUE., xchamp_g) 2224 2224 IF (ALL(xchamp_g(:) == val_exp)) THEN 2225 xchamp_g(:) = 0.2225 xchamp_g(:) = zero 2226 2226 ENDIF 2227 2227 ENDIF … … 2378 2378 qair(:,:)=val_exp 2379 2379 pb(:,:)=val_exp 2380 xx = 9.81/287./0.0065 2380 !!$ xx = 9.81/287./0.0065 2381 xx = cte_grav/rair/0.0065 2381 2382 DO ij=1,nbindex 2382 2383 j = ((kindex(ij)-1)/iim) + 1 … … 2757 2758 swdown(:,:) = solad(:,:)+solai(:,:) 2758 2759 !- 2759 v(:) = 0.2760 v(:) = zero 2760 2761 !- 2761 2762 ! 5. Store date … … 3172 3173 STOP 3173 3174 ENDIF 3174 outside(:) = 0.3175 outside(:) = zero 3175 3176 nb_outside = 0 3176 3177 DO i=1,iimjjm … … 3277 3278 REAL :: tsat 3278 3279 !--------------------------------------------------------------------- 3279 tsat = MIN(100.,MAX(t-zero_t, 0.))3280 tsat = MIN(100.,MAX(t-zero_t,zero)) 3280 3281 !----------------- 3281 3282 END FUNCTION tsatl … … 3292 3293 REAL :: tsat 3293 3294 !--------------------------------------------------------------------- 3294 tsat = MAX(-60.,MIN(t-zero_t, 0.))3295 tsat = MAX(-60.,MIN(t-zero_t,zero)) 3295 3296 !----------------- 3296 3297 END FUNCTION tsati … … 3380 3381 ENDWHERE 3381 3382 !- 3382 tl(:) = MIN(100.,MAX(t(:)-zero_t, 0.))3383 ti(:) = MAX(-60.,MIN(t(:)-zero_t, 0.))3383 tl(:) = MIN(100.,MAX(t(:)-zero_t,zero)) 3384 ti(:) = MAX(-60.,MIN(t(:)-zero_t,zero)) 3384 3385 !- 3385 3386 e(:) = 100.* &
Note: See TracChangeset
for help on using the changeset viewer.