source: LMDZ5/branches/testing/libf/phylmd/surf_land_mod.F90 @ 2275

Last change on this file since 2275 was 2258, checked in by Laurent Fairhead, 10 years ago

Merged trunk changes 2216:2237 into testing branch

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 8.3 KB
Line 
1!
2MODULE surf_land_mod
3 
4  IMPLICIT NONE
5
6CONTAINS
7!
8!****************************************************************************************
9
10  SUBROUTINE surf_land(itime, dtime, date0, jour, knon, knindex, &
11       rlon, rlat, &
12       debut, lafin, zlev, ccanopy, swnet, lwnet, albedo, &
13       tsurf, p1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, &
14       AcoefH, AcoefQ, BcoefH, BcoefQ, &
15       AcoefU, AcoefV, BcoefU, BcoefV, &
16       pref, u1, v1, rugoro, pctsrf, &
17       lwdown_m, q2m, t2m, &
18       snow, qsol, agesno, tsoil, &
19!albedo SB >>>
20!      z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, &
21       z0_new, SFRWL, alb_dir_new, alb_dif_new, evap, fluxsens, fluxlat, &   
22!albedo SB <<<
23       qsurf, tsurf_new, dflux_s, dflux_l, &
24       flux_u1, flux_v1 )
25
26    USE dimphy
27    USE surface_data, ONLY    : ok_veget
28
29#ifdef ORCHIDEE_NOOPENMP
30    USE surf_land_orchidee_noopenmp_mod
31#else
32    USE surf_land_orchidee_mod
33#endif
34    USE surf_land_bucket_mod
35    USE calcul_fluxs_mod
36    USE indice_sol_mod
37
38    INCLUDE "dimsoil.h"
39    INCLUDE "YOMCST.h"
40!albedo SB >>>
41    INCLUDE "clesphys.h"
42!albedo SB <<<
43
44! Input variables 
45!****************************************************************************************
46    INTEGER, INTENT(IN)                     :: itime, jour, knon
47    INTEGER, DIMENSION(klon), INTENT(IN)    :: knindex
48    REAL, INTENT(IN)                        :: date0
49    REAL, DIMENSION(klon), INTENT(IN)       :: rlon, rlat
50    LOGICAL, INTENT(IN)                     :: debut, lafin
51    REAL, INTENT(IN)                        :: dtime
52    REAL, DIMENSION(klon), INTENT(IN)       :: zlev, ccanopy
53    REAL, DIMENSION(klon), INTENT(IN)       :: swnet, lwnet
54    REAL, DIMENSION(klon), INTENT(IN)       :: albedo  ! albedo for whole short-wave interval
55    REAL, DIMENSION(klon), INTENT(IN)       :: tsurf
56    REAL, DIMENSION(klon), INTENT(IN)       :: p1lay
57    REAL, DIMENSION(klon), INTENT(IN)       :: cdragh, cdragm
58    REAL, DIMENSION(klon), INTENT(IN)       :: precip_rain, precip_snow
59    REAL, DIMENSION(klon), INTENT(IN)       :: temp_air, spechum
60    REAL, DIMENSION(klon), INTENT(IN)       :: AcoefH, AcoefQ, BcoefH, BcoefQ
61    REAL, DIMENSION(klon), INTENT(IN)       :: AcoefU, AcoefV, BcoefU, BcoefV
62    REAL, DIMENSION(klon), INTENT(IN)       :: pref   ! pressure reference
63    REAL, DIMENSION(klon), INTENT(IN)       :: u1, v1
64    REAL, DIMENSION(klon), INTENT(IN)       :: rugoro
65    REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf
66    REAL, DIMENSION(klon), INTENT(IN)       :: lwdown_m  ! downwelling longwave radiation at mean surface
67                                                         ! corresponds to previous sollwdown
68    REAL, DIMENSION(klon), INTENT(IN)       :: q2m, t2m
69
70! In/Output variables
71!****************************************************************************************
72    REAL, DIMENSION(klon), INTENT(INOUT)          :: snow, qsol
73    REAL, DIMENSION(klon), INTENT(INOUT)          :: agesno
74    REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil
75
76! Output variables
77!****************************************************************************************
78    REAL, DIMENSION(klon), INTENT(OUT)       :: z0_new
79!albedo SB >>>
80!    REAL, DIMENSION(klon), INTENT(OUT)       :: alb1_new ! albdeo for shortwave interval 1(visible)
81!    REAL, DIMENSION(klon), INTENT(OUT)       :: alb2_new ! albedo for shortwave interval 2(near infrared)
82    REAL, DIMENSION(6), INTENT(IN) :: SFRWL
83    REAL, DIMENSION(klon,nsw), INTENT(OUT)       :: alb_dir_new,alb_dif_new
84!albedo SB <<<
85    REAL, DIMENSION(klon), INTENT(OUT)       :: evap
86    REAL, DIMENSION(klon), INTENT(OUT)       :: fluxsens, fluxlat
87    REAL, DIMENSION(klon), INTENT(OUT)       :: qsurf
88    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new
89    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l     
90    REAL, DIMENSION(klon), INTENT(OUT)       :: flux_u1, flux_v1  ! flux for U and V at first model level
91
92! Local variables
93!****************************************************************************************
94    REAL, DIMENSION(klon) :: p1lay_tmp
95    REAL, DIMENSION(klon) :: pref_tmp
96    REAL, DIMENSION(klon) :: swdown     ! downwelling shortwave radiation at land surface
97    REAL, DIMENSION(klon) :: epot_air           ! potential air temperature
98    REAL, DIMENSION(klon) :: tsol_rad, emis_new ! output from interfsol not used
99    REAL, DIMENSION(klon) :: u0, v0     ! surface speed
100    INTEGER               :: i
101
102!albedo SB >>>
103    REAL, DIMENSION(klon)      :: alb1_new,alb2_new
104!albedo SB <<<
105
106
107!****************************************************************************************
108! Choice between call to vegetation model (ok_veget=true) or simple calculation below
109!
110!****************************************************************************************
111   IF (ok_veget) THEN
112!****************************************************************************************
113!  Call model sechiba in model ORCHIDEE
114!
115!****************************************************************************************
116       p1lay_tmp(:)      = 0.0
117       pref_tmp(:)       = 0.0
118       p1lay_tmp(1:knon) = p1lay(1:knon)/100.
119       pref_tmp(1:knon)  = pref(1:knon)/100.
120!
121!* Calculate incoming flux for SW and LW interval: swdown
122!
123       swdown(:) = 0.0
124       DO i = 1, knon
125          swdown(i) = swnet(i)/(1-albedo(i))
126       END DO
127!
128!* Calculate potential air temperature
129!
130       epot_air(:) = 0.0
131       DO i = 1, knon
132          epot_air(i) = RCPD*temp_air(i)*(pref(i)/p1lay(i))**RKAPPA
133       END DO
134
135       ! temporary for keeping same results using lwdown_m instead of lwdown
136       CALL surf_land_orchidee(itime, dtime, date0, knon, &
137            knindex, rlon, rlat, pctsrf, &
138            debut, lafin, &
139            zlev,  u1, v1, temp_air, spechum, epot_air, ccanopy, &
140            cdragh, AcoefH, AcoefQ, BcoefH, BcoefQ, &
141            precip_rain, precip_snow, lwdown_m, swnet, swdown, &
142            pref_tmp, q2m, t2m, &
143            evap, fluxsens, fluxlat, &             
144            tsol_rad, tsurf_new, alb1_new, alb2_new, &
145            emis_new, z0_new, qsurf)       
146
147
148!* Add contribution of relief to surface roughness
149
150       DO i=1,knon
151          z0_new(i) = MAX(1.5e-05,SQRT(z0_new(i)**2 + rugoro(i)**2))
152       ENDDO
153
154    ELSE  ! not ok_veget
155!****************************************************************************************
156! No extern vegetation model choosen, call simple bucket calculations instead.
157!
158!****************************************************************************************
159       CALL surf_land_bucket(itime, jour, knon, knindex, debut, dtime,&
160            tsurf, p1lay, cdragh, precip_rain, precip_snow, temp_air, &
161            spechum, AcoefH, AcoefQ, BcoefH, BcoefQ, pref, &
162            u1, v1, rugoro, swnet, lwnet, &
163            snow, qsol, agesno, tsoil, &
164            qsurf, z0_new, alb1_new, alb2_new, evap, &
165            fluxsens, fluxlat, tsurf_new, dflux_s, dflux_l)
166
167    ENDIF ! ok_veget
168
169!****************************************************************************************
170! Calculation for all land models
171! - Flux calculation at first modele level for U and V
172!****************************************************************************************
173! Suppose zero surface speed
174    u0(:)=0.0
175    v0(:)=0.0
176    CALL calcul_flux_wind(knon, dtime, &
177         u0, v0, u1, v1, cdragm, &
178         AcoefU, AcoefV, BcoefU, BcoefV, &
179         p1lay, temp_air, &
180         flux_u1, flux_v1)
181
182!albedo SB >>>
183
184
185     select case(NSW)
186     case(2)
187       alb_dir_new(1:knon,1)=alb1_new(1:knon)
188       alb_dir_new(1:knon,2)=alb2_new(1:knon)
189     case(4)
190       alb_dir_new(1:knon,1)=alb1_new(1:knon)
191       alb_dir_new(1:knon,2)=alb2_new(1:knon)
192       alb_dir_new(1:knon,3)=alb2_new(1:knon)
193       alb_dir_new(1:knon,4)=alb2_new(1:knon)
194     case(6)
195       alb_dir_new(1:knon,1)=alb1_new(1:knon)
196       alb_dir_new(1:knon,2)=alb1_new(1:knon)
197       alb_dir_new(1:knon,3)=alb1_new(1:knon)
198       alb_dir_new(1:knon,4)=alb2_new(1:knon)
199       alb_dir_new(1:knon,5)=alb2_new(1:knon)
200       alb_dir_new(1:knon,6)=alb2_new(1:knon)
201     end select
202alb_dif_new=alb_dir_new
203!albedo SB <<<
204
205
206   
207  END SUBROUTINE surf_land
208!
209!****************************************************************************************
210
211END MODULE surf_land_mod
212!
213!****************************************************************************************
214
Note: See TracBrowser for help on using the repository browser.