source: LMDZ5/branches/LMDZ5-DOFOCO/libf/phylmd/surf_land_mod.F90 @ 3269

Last change on this file since 3269 was 1942, checked in by jghattas, 11 years ago

Passing the cosine of solar zenith angle from pbl_surface into orchidee.
Matthew McGrath?(LSCE)

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 7.5 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       z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, &
20       qsurf, tsurf_new, dflux_s, dflux_l, &
21       flux_u1, flux_v1, rmu0)
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
38! Input variables 
39!****************************************************************************************
40    INTEGER, INTENT(IN)                     :: itime, jour, knon
41    INTEGER, DIMENSION(klon), INTENT(IN)    :: knindex
42    REAL, INTENT(IN)                        :: date0
43    REAL, DIMENSION(klon), INTENT(IN)       :: rlon, rlat
44    LOGICAL, INTENT(IN)                     :: debut, lafin
45    REAL, INTENT(IN)                        :: dtime
46    REAL, DIMENSION(klon), INTENT(IN)       :: zlev, ccanopy
47    REAL, DIMENSION(klon), INTENT(IN)       :: swnet, lwnet
48    REAL, DIMENSION(klon), INTENT(IN)       :: albedo  ! albedo for whole short-wave interval
49    REAL, DIMENSION(klon), INTENT(IN)       :: tsurf
50    REAL, DIMENSION(klon), INTENT(IN)       :: p1lay
51    REAL, DIMENSION(klon), INTENT(IN)       :: cdragh, cdragm
52    REAL, DIMENSION(klon), INTENT(IN)       :: precip_rain, precip_snow
53    REAL, DIMENSION(klon), INTENT(IN)       :: temp_air, spechum
54    REAL, DIMENSION(klon), INTENT(IN)       :: AcoefH, AcoefQ, BcoefH, BcoefQ
55    REAL, DIMENSION(klon), INTENT(IN)       :: AcoefU, AcoefV, BcoefU, BcoefV
56    REAL, DIMENSION(klon), INTENT(IN)       :: pref   ! pressure reference
57    REAL, DIMENSION(klon), INTENT(IN)       :: u1, v1
58    REAL, DIMENSION(klon), INTENT(IN)       :: rugoro
59    REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf
60    REAL, DIMENSION(klon), INTENT(IN)       :: lwdown_m  ! downwelling longwave radiation at mean surface
61                                                         ! corresponds to previous sollwdown
62    REAL, DIMENSION(klon), INTENT(IN)       :: q2m, t2m
63    REAL, DIMENSION(klon), INTENT(IN)       :: rmu0      ! cosine of solar zenith angle
64
65! In/Output variables
66!****************************************************************************************
67    REAL, DIMENSION(klon), INTENT(INOUT)          :: snow, qsol
68    REAL, DIMENSION(klon), INTENT(INOUT)          :: agesno
69    REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil
70
71! Output variables
72!****************************************************************************************
73    REAL, DIMENSION(klon), INTENT(OUT)       :: z0_new
74    REAL, DIMENSION(klon), INTENT(OUT)       :: alb1_new ! albdeo for shortwave interval 1(visible)
75    REAL, DIMENSION(klon), INTENT(OUT)       :: alb2_new ! albedo for shortwave interval 2(near infrared)
76    REAL, DIMENSION(klon), INTENT(OUT)       :: evap
77    REAL, DIMENSION(klon), INTENT(OUT)       :: fluxsens, fluxlat
78    REAL, DIMENSION(klon), INTENT(OUT)       :: qsurf
79    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new
80    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l     
81    REAL, DIMENSION(klon), INTENT(OUT)       :: flux_u1, flux_v1  ! flux for U and V at first model level
82
83! Local variables
84!****************************************************************************************
85    REAL, DIMENSION(klon) :: p1lay_tmp
86    REAL, DIMENSION(klon) :: pref_tmp
87    REAL, DIMENSION(klon) :: swdown     ! downwelling shortwave radiation at land surface
88    REAL, DIMENSION(klon) :: lwdown     ! downwelling longwave radiation at land surface
89    REAL, DIMENSION(klon) :: epot_air           ! potential air temperature
90    REAL, DIMENSION(klon) :: tsol_rad, emis_new ! output from interfsol not used
91    REAL, DIMENSION(klon) :: u0, v0     ! surface speed
92    INTEGER               :: i
93
94
95!****************************************************************************************
96! Choice between call to vegetation model (ok_veget=true) or simple calculation below
97!
98!****************************************************************************************
99   IF (ok_veget) THEN
100!****************************************************************************************
101!  Call model sechiba in model ORCHIDEE
102!
103!****************************************************************************************
104       p1lay_tmp(:)      = 0.0
105       pref_tmp(:)       = 0.0
106       p1lay_tmp(1:knon) = p1lay(1:knon)/100.
107       pref_tmp(1:knon)  = pref(1:knon)/100.
108!
109!* Calculate incoming flux for SW and LW interval: swdown, lwdown
110!
111       swdown(:) = 0.0
112       lwdown(:) = 0.0
113       DO i = 1, knon
114          swdown(i) = swnet(i)/(1-albedo(i))
115          lwdown(i) = lwnet(i) + RSIGMA*tsurf(i)**4
116       END DO
117!
118!* Calculate potential air temperature
119!
120       epot_air(:) = 0.0
121       DO i = 1, knon
122          epot_air(i) = RCPD*temp_air(i)*(pref(i)/p1lay(i))**RKAPPA
123       END DO
124
125       ! temporary for keeping same results using lwdown_m instead of lwdown
126       CALL surf_land_orchidee(itime, dtime, date0, knon, &
127            knindex, rlon, rlat, pctsrf, &
128            debut, lafin, &
129            zlev,  u1, v1, temp_air, spechum, epot_air, ccanopy, &
130            cdragh, AcoefH, AcoefQ, BcoefH, BcoefQ, &
131            precip_rain, precip_snow, lwdown_m, swnet, swdown, &
132            pref_tmp, q2m, t2m, &
133            evap, fluxsens, fluxlat, &             
134            tsol_rad, tsurf_new, alb1_new, alb2_new, &
135            emis_new, z0_new, qsurf, rmu0)       
136
137
138!* Add contribution of relief to surface roughness
139
140       DO i=1,knon
141          z0_new(i) = MAX(1.5e-05,SQRT(z0_new(i)**2 + rugoro(i)**2))
142       ENDDO
143
144    ELSE  ! not ok_veget
145!****************************************************************************************
146! No extern vegetation model choosen, call simple bucket calculations instead.
147!
148!****************************************************************************************
149       CALL surf_land_bucket(itime, jour, knon, knindex, debut, dtime,&
150            tsurf, p1lay, cdragh, precip_rain, precip_snow, temp_air, &
151            spechum, AcoefH, AcoefQ, BcoefH, BcoefQ, pref, &
152            u1, v1, rugoro, swnet, lwnet, &
153            snow, qsol, agesno, tsoil, &
154            qsurf, z0_new, alb1_new, alb2_new, evap, &
155            fluxsens, fluxlat, tsurf_new, dflux_s, dflux_l)
156
157    ENDIF ! ok_veget
158
159!****************************************************************************************
160! Calculation for all land models
161! - Flux calculation at first modele level for U and V
162!****************************************************************************************
163! Suppose zero surface speed
164    u0(:)=0.0
165    v0(:)=0.0
166    CALL calcul_flux_wind(knon, dtime, &
167         u0, v0, u1, v1, cdragm, &
168         AcoefU, AcoefV, BcoefU, BcoefV, &
169         p1lay, temp_air, &
170         flux_u1, flux_v1)
171   
172  END SUBROUTINE surf_land
173!
174!****************************************************************************************
175
176END MODULE surf_land_mod
177!
178!****************************************************************************************
179
Note: See TracBrowser for help on using the repository browser.