source: LMDZ5/branches/IPSLCM6.0.11pre/libf/phylmd/surf_land_mod.F90 @ 5331

Last change on this file since 5331 was 2571, checked in by jghattas, 8 years ago

Interface LMDZ/ORCHIDEE :

  • copied previous default module surf_land_orchidee_mod.f90 into surf_land_orchidee_noz0h.f90. This interface can still be compiled if adding cpp key ORCHIDEE_NOZ0H
  • modified default interface by adding z0h as output from ORCHIDEE.
  • added comments in each module surf_land_orchidee_xxx of compatiblity with ORCHIDEE.
  • all modules surf_land_orchidee_xxx now send back z0h and z0m to surf_land_mod. But note that z0m and zOh are different only in the new default version surf_land_orchidee_mod.f90. In the old interfaces, z0h is a copy of z0m.


cosp : some small changes to be able to compile with gfortran

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