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

Last change on this file since 2339 was 2298, checked in by Laurent Fairhead, 9 years ago

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