source: LMDZ6/branches/Ocean_skin/libf/phylmd/surf_land_mod.F90 @ 3601

Last change on this file since 3601 was 3391, checked in by oboucher, 6 years ago

Fields can now be passed to ORCHIDEE through surf_land_orchidee.
Fields are compressed in pbl_surface_mod and uncompressed in surf_land_orchidee.
Cosmetic changes, including in surf_land_mod.

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