source: LMDZ6/branches/LMDZ_DECOUPLE/libf/phylmd/surf_land_mod.F90 @ 5006

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

"Historic" :-) commit merging the physics branch used for DYNAMICO with the LMDZ trunk.
The same physics branch can now be used seamlessly with the traditional lon-lat LMDZ
dynamical core and DYNAMICO.
Testing consisted in running a lon-lat LMDZ bucket simulation with the NPv6.1 physics package
with the original trunk sources and the merged sources. Tests were succesful in the sense that
numeric continuity was preserved in the restart files from both simulation. Further tests
included running both versions of the physics codes for one year in a LMDZOR setting in which
the restart files also came out identical.

Caution:

  • as the physics package now manages unstructured grids, grid information needs to be transmitted

to the surface scheme ORCHIDEE. This means that the interface defined in surf_land_orchidee_mod.F90
is only compatible with ORCHIDEE version orchidee2.1 and later versions. If previous versions of
ORCHIDEE need to be used, the CPP key ORCHIDEE_NOUNSTRUCT needs to be set at compilation time.
This is done automatically if makelmdz/makelmdz_fcm are called with the veget orchidee2.0 switch

  • due to a limitation in XIOS, the time at which limit conditions will be read in by DYNAMICO will be

delayed by one physic timestep with respect to the time it is read in by the lon-lat model. This is caused
by the line

IF (MOD(itime-1, lmt_pas) == 0 .OR. (jour_lu /= jour .AND. grid_type /= unstructured)) THEN ! time to read

in limit_read_mod.F90

Work still needed on COSP integration and XML files for DYNAMICO

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