source: LMDZ6/branches/DYNAMICO-conv/libf/phylmd/surf_land_mod.F90 @ 5177

Last change on this file since 5177 was 3413, checked in by Laurent Fairhead, 6 years ago

Inclusion of Yann's latest (summer/fall 2018) modifications for
convergence of DYNAMICO/LMDZ physics
YM/LF

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