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

Last change on this file since 1850 was 1785, checked in by Ehouarn Millour, 11 years ago

Transformation de l'include indicesol.h en un module indice_sol_mod et modification des appels dans tous les fichiers concernés.
Aucun changement des résultats ni des sorties du modèle vs 1784.
UG

...................................................

Replacement of the indicesol.h include by a module named indice_sol_mod. Modification of the calls in every affected files.
Results and outputs of simulations are unchanged in comparison with rev 1784.
UG

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