1 | ! |
---|
2 | ! $Header$ |
---|
3 | ! |
---|
4 | MODULE surf_land_mod |
---|
5 | |
---|
6 | USE surface_data, ONLY : ok_veget |
---|
7 | USE dimphy |
---|
8 | |
---|
9 | #ifdef CPP_VEGET |
---|
10 | USE surf_land_orchidee_mod |
---|
11 | #endif |
---|
12 | USE surf_land_bucket_mod |
---|
13 | |
---|
14 | IMPLICIT NONE |
---|
15 | |
---|
16 | CONTAINS |
---|
17 | ! |
---|
18 | !**************************************************************************************** |
---|
19 | ! |
---|
20 | SUBROUTINE surf_land(itime, dtime, date0, jour, knon, knindex, & |
---|
21 | rlon, rlat, & |
---|
22 | debut, lafin, zlev, ccanopy, swnet, lwnet, albedo, & |
---|
23 | tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum, & |
---|
24 | petAcoef, peqAcoef, petBcoef, peqBcoef, & |
---|
25 | pref, u1_lay, v1_lay, rugoro, pctsrf, & |
---|
26 | snow, qsol, agesno, tsoil, & |
---|
27 | z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, & |
---|
28 | qsurf, tsurf_new, dflux_s, dflux_l, & |
---|
29 | lwdown_m) |
---|
30 | |
---|
31 | INCLUDE "indicesol.h" |
---|
32 | INCLUDE "dimsoil.h" |
---|
33 | INCLUDE "YOMCST.h" |
---|
34 | |
---|
35 | ! Input variables |
---|
36 | !**************************************************************************************** |
---|
37 | INTEGER, INTENT(IN) :: itime, jour, knon |
---|
38 | INTEGER, DIMENSION(klon), INTENT(IN) :: knindex |
---|
39 | REAL, INTENT(IN) :: date0 |
---|
40 | REAL, DIMENSION(klon), INTENT(IN) :: rlon, rlat |
---|
41 | LOGICAL, INTENT(IN) :: debut, lafin |
---|
42 | REAL, INTENT(IN) :: dtime |
---|
43 | REAL, DIMENSION(klon), INTENT(IN) :: zlev, ccanopy |
---|
44 | REAL, DIMENSION(klon), INTENT(IN) :: swnet, lwnet |
---|
45 | REAL, DIMENSION(klon), INTENT(IN) :: albedo ! albedo for whole short-wave interval |
---|
46 | REAL, DIMENSION(klon), INTENT(IN) :: tsurf |
---|
47 | REAL, DIMENSION(klon), INTENT(IN) :: p1lay |
---|
48 | REAL, DIMENSION(klon), INTENT(IN) :: tq_cdrag |
---|
49 | REAL, DIMENSION(klon), INTENT(IN) :: precip_rain, precip_snow |
---|
50 | REAL, DIMENSION(klon), INTENT(IN) :: temp_air, spechum |
---|
51 | REAL, DIMENSION(klon), INTENT(IN) :: petAcoef, peqAcoef |
---|
52 | REAL, DIMENSION(klon), INTENT(IN) :: petBcoef, peqBcoef |
---|
53 | REAL, DIMENSION(klon), INTENT(IN) :: pref ! pressure reference |
---|
54 | REAL, DIMENSION(klon), INTENT(IN) :: u1_lay, v1_lay |
---|
55 | REAL, DIMENSION(klon), INTENT(IN) :: rugoro |
---|
56 | REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf |
---|
57 | |
---|
58 | REAL, DIMENSION(klon), INTENT(IN) :: lwdown_m ! downwelling longwave radiation at mean surface |
---|
59 | ! corresponds to previous sollwdown |
---|
60 | |
---|
61 | ! In/Output variables |
---|
62 | !**************************************************************************************** |
---|
63 | REAL, DIMENSION(klon), INTENT(INOUT) :: snow, qsol |
---|
64 | REAL, DIMENSION(klon), INTENT(INOUT) :: agesno |
---|
65 | REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil |
---|
66 | |
---|
67 | ! Output variables |
---|
68 | !**************************************************************************************** |
---|
69 | REAL, DIMENSION(klon), INTENT(OUT) :: z0_new |
---|
70 | REAL, DIMENSION(klon), INTENT(OUT) :: alb1_new ! albdeo for shortwave interval 1(visible) |
---|
71 | REAL, DIMENSION(klon), INTENT(OUT) :: alb2_new ! albedo for shortwave interval 2(near infrared) |
---|
72 | REAL, DIMENSION(klon), INTENT(OUT) :: evap |
---|
73 | REAL, DIMENSION(klon), INTENT(OUT) :: fluxsens, fluxlat |
---|
74 | REAL, DIMENSION(klon), INTENT(OUT) :: qsurf |
---|
75 | REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new |
---|
76 | REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l |
---|
77 | |
---|
78 | ! Local variables |
---|
79 | !**************************************************************************************** |
---|
80 | REAL, DIMENSION(klon) :: p1lay_tmp |
---|
81 | REAL, DIMENSION(klon) :: pref_tmp |
---|
82 | REAL, DIMENSION(klon) :: swdown ! downwelling shortwave radiation at land surface |
---|
83 | REAL, DIMENSION(klon) :: lwdown ! downwelling longwave radiation at land surface |
---|
84 | REAL, DIMENSION(klon) :: epot_air ! potential air temperature |
---|
85 | REAL, DIMENSION(klon) :: tsol_rad, emis_new ! output from interfsol not used |
---|
86 | INTEGER :: i |
---|
87 | |
---|
88 | |
---|
89 | !**************************************************************************************** |
---|
90 | ! Choice between call to vegetation model (ok_veget=true) or simple calculation below |
---|
91 | ! |
---|
92 | !**************************************************************************************** |
---|
93 | IF (ok_veget) THEN |
---|
94 | !**************************************************************************************** |
---|
95 | ! Call model sechiba in model ORCHIDEE |
---|
96 | ! |
---|
97 | !**************************************************************************************** |
---|
98 | p1lay_tmp(:) = 0.0 |
---|
99 | pref_tmp(:) = 0.0 |
---|
100 | p1lay_tmp(1:knon) = p1lay(1:knon)/100. |
---|
101 | pref_tmp(1:knon) = pref(1:knon)/100. |
---|
102 | ! |
---|
103 | !* Calculate incoming flux for SW and LW interval: swdown, lwdown |
---|
104 | ! |
---|
105 | swdown(:) = 0.0 |
---|
106 | lwdown(:) = 0.0 |
---|
107 | DO i = 1, knon |
---|
108 | swdown(i) = swnet(i)/(1-albedo(i)) |
---|
109 | lwdown(i) = lwnet(i) + RSIGMA*tsurf(i)**4 |
---|
110 | END DO |
---|
111 | ! |
---|
112 | !* Calculate potential air temperature |
---|
113 | ! |
---|
114 | epot_air(:) = 0.0 |
---|
115 | DO i = 1, knon |
---|
116 | epot_air(i) = RCPD*temp_air(i)*(pref(i)/p1lay(i))**RKAPPA |
---|
117 | END DO |
---|
118 | |
---|
119 | #ifdef CPP_VEGET |
---|
120 | ! temporary for keeping same results using lwdown_m instead of lwdown |
---|
121 | CALL surf_land_orchidee(itime, dtime, date0, knon, & |
---|
122 | knindex, rlon, rlat, pctsrf, & |
---|
123 | debut, lafin, & |
---|
124 | zlev, u1_lay, v1_lay, temp_air, spechum, epot_air, ccanopy, & |
---|
125 | tq_cdrag, petAcoef, peqAcoef, petBcoef, peqBcoef, & |
---|
126 | precip_rain, precip_snow, lwdown_m, swnet, swdown, & |
---|
127 | pref_tmp, & |
---|
128 | evap, fluxsens, fluxlat, & |
---|
129 | tsol_rad, tsurf_new, alb1_new, alb2_new, & |
---|
130 | emis_new, z0_new, qsurf) |
---|
131 | #endif |
---|
132 | |
---|
133 | ! |
---|
134 | !* Add contribution of relief to surface roughness |
---|
135 | ! |
---|
136 | DO i=1,knon |
---|
137 | z0_new(i) = SQRT(z0_new(i)**2 + rugoro(i)**2) |
---|
138 | ENDDO |
---|
139 | |
---|
140 | ELSE ! not ok_veget |
---|
141 | !**************************************************************************************** |
---|
142 | ! No extern vegetation model choosen, call simple bucket calculations instead. |
---|
143 | ! |
---|
144 | !**************************************************************************************** |
---|
145 | CALL surf_land_bucket(itime, jour, knon, knindex, debut, dtime,& |
---|
146 | tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, & |
---|
147 | spechum, petAcoef, peqAcoef, petBcoef, peqBcoef, pref, & |
---|
148 | u1_lay, v1_lay, rugoro, swnet, lwnet, & |
---|
149 | snow, qsol, agesno, tsoil, & |
---|
150 | qsurf, z0_new, alb1_new, alb2_new, evap, & |
---|
151 | fluxsens, fluxlat, tsurf_new, dflux_s, dflux_l) |
---|
152 | |
---|
153 | ENDIF ! ok_veget |
---|
154 | |
---|
155 | END SUBROUTINE surf_land |
---|
156 | ! |
---|
157 | !**************************************************************************************** |
---|
158 | ! |
---|
159 | END MODULE surf_land_mod |
---|
160 | ! |
---|
161 | !**************************************************************************************** |
---|
162 | ! |
---|