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, epot_air, ccanopy, sollwdown, swnet, swdown, & |
---|
23 | tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum, & |
---|
24 | petAcoef, peqAcoef, petBcoef, peqBcoef, & |
---|
25 | ps, u1_lay, v1_lay, rugoro, pctsrf, & |
---|
26 | radsol, snow, qsurf, qsol, agesno, & |
---|
27 | tsoil, z0_new, alblw, evap, fluxsens, fluxlat, & |
---|
28 | tsurf_new, alb_new, dflux_s, dflux_l, pctsrf_ter) |
---|
29 | |
---|
30 | INCLUDE "indicesol.h" |
---|
31 | INCLUDE "dimsoil.h" |
---|
32 | |
---|
33 | ! Input variables |
---|
34 | !**************************************************************************************** |
---|
35 | INTEGER, INTENT(IN) :: itime, jour, knon |
---|
36 | INTEGER, DIMENSION(klon), INTENT(IN) :: knindex |
---|
37 | REAL, INTENT(IN) :: date0 |
---|
38 | REAL, DIMENSION(klon), INTENT(IN) :: rlon, rlat |
---|
39 | LOGICAL, INTENT(IN) :: debut, lafin |
---|
40 | REAL, INTENT(IN) :: dtime |
---|
41 | REAL, DIMENSION(klon), INTENT(IN) :: zlev, epot_air, ccanopy |
---|
42 | REAL, DIMENSION(klon), INTENT(IN) :: sollwdown, swnet, swdown |
---|
43 | REAL, DIMENSION(klon), INTENT(IN) :: tsurf |
---|
44 | REAL, DIMENSION(klon), INTENT(IN) :: p1lay |
---|
45 | REAL, DIMENSION(klon), INTENT(IN) :: tq_cdrag |
---|
46 | REAL, DIMENSION(klon), INTENT(IN) :: precip_rain, precip_snow |
---|
47 | REAL, DIMENSION(klon), INTENT(IN) :: temp_air, spechum |
---|
48 | REAL, DIMENSION(klon), INTENT(IN) :: petAcoef, peqAcoef |
---|
49 | REAL, DIMENSION(klon), INTENT(IN) :: petBcoef, peqBcoef |
---|
50 | REAL, DIMENSION(klon), INTENT(IN) :: ps |
---|
51 | REAL, DIMENSION(klon), INTENT(IN) :: u1_lay, v1_lay |
---|
52 | REAL, DIMENSION(klon), INTENT(IN) :: rugoro |
---|
53 | REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf |
---|
54 | |
---|
55 | ! In/Output variables |
---|
56 | !**************************************************************************************** |
---|
57 | REAL, DIMENSION(klon), INTENT(INOUT) :: radsol |
---|
58 | REAL, DIMENSION(klon), INTENT(INOUT) :: snow, qsol |
---|
59 | REAL, DIMENSION(klon), INTENT(INOUT) :: agesno |
---|
60 | REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil |
---|
61 | |
---|
62 | ! Output variables |
---|
63 | !**************************************************************************************** |
---|
64 | REAL, DIMENSION(klon), INTENT(OUT) :: qsurf |
---|
65 | REAL, DIMENSION(klon), INTENT(OUT) :: z0_new |
---|
66 | REAL, DIMENSION(klon), INTENT(OUT) :: alblw |
---|
67 | REAL, DIMENSION(klon), INTENT(OUT) :: evap, fluxsens, fluxlat |
---|
68 | REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new, alb_new |
---|
69 | REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l |
---|
70 | REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_ter |
---|
71 | |
---|
72 | ! Local variables |
---|
73 | !**************************************************************************************** |
---|
74 | REAL, DIMENSION(klon) :: ps_tmp, p1lay_tmp |
---|
75 | REAL, DIMENSION(klon) :: tsol_rad, emis_new ! output from interfsol not used |
---|
76 | INTEGER :: i |
---|
77 | |
---|
78 | |
---|
79 | !**************************************************************************************** |
---|
80 | ! Choice between call to vegetation model (ok_veget=true) or simple calculation below |
---|
81 | ! |
---|
82 | !**************************************************************************************** |
---|
83 | IF (ok_veget) THEN |
---|
84 | !**************************************************************************************** |
---|
85 | ! Call model sechiba |
---|
86 | ! |
---|
87 | !**************************************************************************************** |
---|
88 | p1lay_tmp(:) = 0.0 |
---|
89 | ps_tmp(:) = 0.0 |
---|
90 | p1lay_tmp(1:knon) = p1lay(1:knon)/100. |
---|
91 | ps_tmp(1:knon) = ps(1:knon)/100. |
---|
92 | |
---|
93 | #ifdef CPP_VEGET |
---|
94 | CALL surf_land_orchidee(itime, dtime, date0, knon, & |
---|
95 | knindex, rlon, rlat, pctsrf, & |
---|
96 | debut, lafin, & |
---|
97 | zlev, u1_lay, v1_lay, temp_air, spechum, epot_air, ccanopy, & |
---|
98 | tq_cdrag, petAcoef, peqAcoef, petBcoef, peqBcoef, & |
---|
99 | precip_rain, precip_snow, sollwdown, swnet, swdown, & |
---|
100 | ps_tmp, & |
---|
101 | evap, fluxsens, fluxlat, & |
---|
102 | tsol_rad, tsurf_new, alb_new, alblw, & |
---|
103 | emis_new, z0_new, qsurf) |
---|
104 | #endif |
---|
105 | |
---|
106 | ! |
---|
107 | !* Ajout de la contribution du relief |
---|
108 | ! |
---|
109 | DO i=1,knon |
---|
110 | z0_new(i) = SQRT(z0_new(i)**2 + rugoro(i)**2) |
---|
111 | ENDDO |
---|
112 | |
---|
113 | ELSE ! not ok_veget |
---|
114 | !**************************************************************************************** |
---|
115 | ! No extern vegetation model choosen, call simple bucket calculations instead. |
---|
116 | ! |
---|
117 | !**************************************************************************************** |
---|
118 | CALL surf_land_bucket(itime, jour, knon, knindex, debut, dtime,& |
---|
119 | tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, & |
---|
120 | spechum, petAcoef, peqAcoef, petBcoef, peqBcoef, ps, & |
---|
121 | u1_lay, v1_lay, rugoro, & |
---|
122 | radsol, snow, qsol, agesno, tsoil, & |
---|
123 | qsurf, z0_new, alblw, evap, fluxsens, fluxlat, & |
---|
124 | tsurf_new, alb_new, dflux_s, dflux_l) |
---|
125 | |
---|
126 | ENDIF ! ok_veget |
---|
127 | |
---|
128 | !**************************************************************************************** |
---|
129 | ! Return the pourcentage of land in each grid cell, even if not changed in here! |
---|
130 | ! |
---|
131 | !**************************************************************************************** |
---|
132 | pctsrf_ter(:) = pctsrf(:,is_ter) |
---|
133 | |
---|
134 | |
---|
135 | END SUBROUTINE surf_land |
---|
136 | ! |
---|
137 | !**************************************************************************************** |
---|
138 | ! |
---|
139 | END MODULE surf_land_mod |
---|
140 | ! |
---|
141 | !**************************************************************************************** |
---|
142 | ! |
---|