source: lmdz_wrf/WRFV3/lmdz/surf_land_bucket_mod.F90 @ 1

Last change on this file since 1 was 1, checked in by lfita, 10 years ago
  • -- --- Opening of the WRF+LMDZ coupling repository --- -- -

WRF: version v3.3
LMDZ: version v1818

More details in:

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