source: LMDZ5/trunk/libf/phy1d/surf_land_bucket_mod.F90 @ 1630

Last change on this file since 1630 was 1607, checked in by lguez, 13 years ago

Import 1D files. Files added to directory "phy1d" were in directories:

lmdz1d_source_20111207/phy1d_source
lmdz1d_source_20111207/phy1d_source_upd

extracted from:

http://www.lmd.jussieu.fr/~jyg/lmdz1d_source_20111207.tar.gz

File size: 5.9 KB
Line 
1!
2MODULE surf_land_bucket_mod
3!
4! Surface land bucket module
5!
6! This module is used when no external land model is choosen.
7!
8  IMPLICIT NONE
9
10CONTAINS
11
12  SUBROUTINE surf_land_bucket(itime, jour, knon, knindex, debut, dtime,&
13       tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, &
14       spechum, petAcoef, peqAcoef, petBcoef, peqBcoef, pref, &
15       u1, v1, rugoro, swnet, lwnet, &
16       snow, qsol, agesno, tsoil, &
17       qsurf, z0_new, alb1_new, alb2_new, evap, &
18       fluxsens, fluxlat, tsurf_new, dflux_s, dflux_l)
19
20    USE limit_read_mod
21    USE surface_data
22    USE fonte_neige_mod
23    USE calcul_fluxs_mod
24    USE cpl_mod
25    USE dimphy
26    USE mod_grid_phy_lmdz
27    USE mod_phys_lmdz_para
28!****************************************************************************************
29! Bucket calculations for surface.
30!
31    INCLUDE "clesphys.h"
32    INCLUDE "indicesol.h"
33    INCLUDE "dimsoil.h"
34    INCLUDE "YOMCST.h"
35
36! Input variables 
37!****************************************************************************************
38    INTEGER, INTENT(IN)                     :: itime, jour, knon
39    INTEGER, DIMENSION(klon), INTENT(IN)    :: knindex
40    LOGICAL, INTENT(IN)                     :: debut
41    REAL, INTENT(IN)                        :: dtime
42    REAL, DIMENSION(klon), INTENT(IN)       :: tsurf
43    REAL, DIMENSION(klon), INTENT(IN)       :: p1lay
44    REAL, DIMENSION(klon), INTENT(IN)       :: tq_cdrag
45    REAL, DIMENSION(klon), INTENT(IN)       :: precip_rain, precip_snow
46    REAL, DIMENSION(klon), INTENT(IN)       :: temp_air, spechum
47    REAL, DIMENSION(klon), INTENT(IN)       :: petAcoef, peqAcoef
48    REAL, DIMENSION(klon), INTENT(IN)       :: petBcoef, peqBcoef
49    REAL, DIMENSION(klon), INTENT(IN)       :: pref
50    REAL, DIMENSION(klon), INTENT(IN)       :: u1, v1
51    REAL, DIMENSION(klon), INTENT(IN)       :: rugoro
52    REAL, DIMENSION(klon), INTENT(IN)       :: swnet, lwnet
53
54! In/Output variables
55!****************************************************************************************
56    REAL, DIMENSION(klon), INTENT(INOUT)          :: snow, qsol
57    REAL, DIMENSION(klon), INTENT(INOUT)          :: agesno
58    REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil
59
60! Output variables
61!****************************************************************************************
62    REAL, DIMENSION(klon), INTENT(OUT)       :: qsurf
63    REAL, DIMENSION(klon), INTENT(OUT)       :: z0_new
64    REAL, DIMENSION(klon), INTENT(OUT)       :: alb1_new, alb2_new
65    REAL, DIMENSION(klon), INTENT(OUT)       :: evap, fluxsens, fluxlat
66    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new
67    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l     
68
69! Local variables
70!****************************************************************************************
71    REAL, DIMENSION(klon) :: soilcap, soilflux
72    REAL, DIMENSION(klon) :: cal, beta, dif_grnd, capsol
73    REAL, DIMENSION(klon) :: alb_neig, alb_lim
74    REAL, DIMENSION(klon) :: zfra
75    REAL, DIMENSION(klon) :: radsol       ! total net radiance at surface
76    REAL, DIMENSION(klon) :: u0, v0, u1_lay, v1_lay
77    REAL, DIMENSION(klon) :: dummy_riverflow,dummy_coastalflow
78    INTEGER               :: i
79!
80!****************************************************************************************
81
82
83!
84!* Read from limit.nc : albedo(alb_lim), length of rugosity(z0_new)
85!
86    CALL limit_read_rug_alb(itime, dtime, jour,&
87         knon, knindex, &
88         z0_new, alb_lim)
89!
90!* Calcultaion of fluxes
91!
92
93! calculate total absorbed radiance at surface
94       radsol(:) = 0.0
95       radsol(1:knon) = swnet(1:knon) + lwnet(1:knon)
96
97! calculate constants
98    CALL calbeta(dtime, is_ter, knon, snow, qsol, beta, capsol, dif_grnd)
99       
100! calculate temperature, heat capacity and conduction flux in soil
101    IF (soil_model) THEN
102       CALL soil(dtime, is_ter, knon, snow, tsurf, tsoil, soilcap, soilflux)
103       DO i=1, knon
104          cal(i) = RCPD / soilcap(i)
105          radsol(i) = radsol(i)  + soilflux(i)
106       END DO
107    ELSE
108       cal(:) = RCPD * capsol(:)
109       IF (klon_glo .EQ. 1) THEN
110         cal(:) = 0.
111       ENDIF
112    ENDIF
113   
114! Suppose zero surface speed
115    u0(:)=0.0
116    v0(:)=0.0
117    u1_lay(:) = u1(:) - u0(:)
118    v1_lay(:) = v1(:) - v0(:)
119
120    CALL calcul_fluxs(knon, is_ter, dtime, &
121         tsurf, p1lay, cal, beta, tq_cdrag, pref, &
122         precip_rain, precip_snow, snow, qsurf,  &
123         radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &
124         petAcoef, peqAcoef, petBcoef, peqBcoef, &
125         tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)
126   
127!
128!* Calculate snow height, run_off, age of snow
129!     
130    CALL fonte_neige( knon, is_ter, knindex, dtime, &
131         tsurf, precip_rain, precip_snow, &
132         snow, qsol, tsurf_new, evap)
133!
134!* Calculate the age of snow
135!
136    CALL albsno(klon,knon,dtime,agesno(:),alb_neig(:), precip_snow(:)) 
137   
138    WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.
139   
140    DO i=1, knon
141       zfra(i) = MAX(0.0,MIN(1.0, snow(i)/(snow(i)+10.0)))
142       alb_lim(i)  = alb_neig(i) *zfra(i) + alb_lim(i)*(1.0-zfra(i))
143    END DO
144
145!
146!* Return albedo :
147!    alb1_new and alb2_new are here given the same values
148!
149    alb1_new(:) = 0.0
150    alb2_new(:) = 0.0
151    alb1_new(1:knon) = alb_lim(1:knon)
152    alb2_new(1:knon) = alb_lim(1:knon)
153       
154!
155!* Calculate the rugosity
156!
157    DO i = 1, knon
158       z0_new(i) = MAX(1.5e-05,SQRT(z0_new(i)**2 + rugoro(i)**2))
159    END DO
160
161!* Send to coupler
162!  The run-off from river and coast are not calculated in the bucket modele.
163!  For testing purpose of the coupled modele we put the run-off to zero.
164    IF (type_ocean=='couple') THEN
165       dummy_riverflow(:)   = 0.0
166       dummy_coastalflow(:) = 0.0
167       CALL cpl_send_land_fields(itime, knon, knindex, &
168            dummy_riverflow, dummy_coastalflow)
169    ENDIF
170
171!
172!* End
173!
174  END SUBROUTINE surf_land_bucket
175!
176!****************************************************************************************
177!
178END MODULE surf_land_bucket_mod
Note: See TracBrowser for help on using the repository browser.