source: LMDZ5/branches/AI-cosp/libf/phylmd/surf_land_mod.F90 @ 5360

Last change on this file since 5360 was 2410, checked in by jghattas, 9 years ago

Added the variable yrmu0(cosine of the solar zenith angle) into ORCHIDEE:

Current version of LMDZ can now be used with ORCHIDEE trunk revisions from rev 2961 and newer. For revision 1078-2960 on ORCHIDEE trunk, a small modification (change coszang into sinang) in surf_land_orchidee_mod.f90 is needed. For older versions than ORCHIDEE trunk revision 1078, the interface in surf_land_orchidee_noopenmp_mod.f90 should be used (add cpp key ORCHIDEE_NOOPENMP).

For details see ticket https://forge.ipsl.jussieu.fr/orchidee/ticket/217

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