source: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/surf_landice_mod.F90 @ 2404

Last change on this file since 2404 was 1907, checked in by lguez, 11 years ago

Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:

$ svn propget copyright libf/phylmd/physiq.F90
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

Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.

  • 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: 13.0 KB
Line 
1!
2MODULE surf_landice_mod
3 
4  IMPLICIT NONE
5
6CONTAINS
7!
8!****************************************************************************************
9!
10  SUBROUTINE surf_landice(itime, dtime, knon, knindex, &
11       rlon, rlat, debut, lafin, &
12       rmu0, lwdownm, albedo, pphi1, &
13       swnet, lwnet, tsurf, p1lay, &
14       cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, &
15       AcoefH, AcoefQ, BcoefH, BcoefQ, &
16       AcoefU, AcoefV, BcoefU, BcoefV, &
17       ps, u1, v1, rugoro, pctsrf, &
18       snow, qsurf, qsol, agesno, &
19       tsoil, z0_new, alb1, alb2, evap, fluxsens, fluxlat, &
20       tsurf_new, dflux_s, dflux_l, &
21       slope, cloudf, &
22       snowhgt, qsnow, to_ice, sissnow, &
23       alb3, runoff, &
24       flux_u1, flux_v1)
25
26    USE dimphy
27    USE surface_data,     ONLY : type_ocean, calice, calsno, ok_snow
28    USE fonte_neige_mod,  ONLY : fonte_neige, run_off_lic
29    USE cpl_mod,          ONLY : cpl_send_landice_fields
30    USE calcul_fluxs_mod
31    USE phys_output_var_mod
32#ifdef CPP_SISVAT
33    USE surf_sisvat_mod,  ONLY : surf_sisvat
34#endif
35    USE indice_sol_mod
36
37!    INCLUDE "indicesol.h"
38    INCLUDE "dimsoil.h"
39    INCLUDE "YOMCST.h"
40    INCLUDE "clesphys.h"
41
42! Input variables
43!****************************************************************************************
44    INTEGER, INTENT(IN)                           :: itime, knon
45    INTEGER, DIMENSION(klon), INTENT(in)          :: knindex
46    REAL, INTENT(in)                              :: dtime
47    REAL, DIMENSION(klon), INTENT(IN)             :: swnet ! net shortwave radiance
48    REAL, DIMENSION(klon), INTENT(IN)             :: lwnet ! net longwave radiance
49    REAL, DIMENSION(klon), INTENT(IN)             :: tsurf
50    REAL, DIMENSION(klon), INTENT(IN)             :: p1lay
51    REAL, DIMENSION(klon), INTENT(IN)             :: cdragh, cdragm
52    REAL, DIMENSION(klon), INTENT(IN)             :: precip_rain, precip_snow
53    REAL, DIMENSION(klon), INTENT(IN)             :: temp_air, spechum
54    REAL, DIMENSION(klon), INTENT(IN)             :: AcoefH, AcoefQ
55    REAL, DIMENSION(klon), INTENT(IN)             :: BcoefH, BcoefQ
56    REAL, DIMENSION(klon), INTENT(IN)             :: AcoefU, AcoefV, BcoefU, BcoefV
57    REAL, DIMENSION(klon), INTENT(IN)             :: ps
58    REAL, DIMENSION(klon), INTENT(IN)             :: u1, v1
59    REAL, DIMENSION(klon), INTENT(IN)             :: rugoro
60    REAL, DIMENSION(klon,nbsrf), INTENT(IN)       :: pctsrf
61
62    LOGICAL,  INTENT(IN)                          :: debut   !true if first step
63    LOGICAL,  INTENT(IN)                          :: lafin   !true if last step
64    REAL, DIMENSION(klon), INTENT(IN)             :: rlon, rlat
65    REAL, DIMENSION(klon), INTENT(IN)             :: rmu0
66    REAL, DIMENSION(klon), INTENT(IN)             :: lwdownm !ylwdown
67    REAL, DIMENSION(klon), INTENT(IN)             :: albedo  !mean albedo
68    REAL, DIMENSION(klon), INTENT(IN)             :: pphi1   
69    REAL, DIMENSION(klon), INTENT(IN)             :: slope   !mean slope in grid box 
70    REAL, DIMENSION(klon), INTENT(IN)             :: cloudf  !total cloud fraction
71
72! In/Output variables
73!****************************************************************************************
74    REAL, DIMENSION(klon), INTENT(INOUT)          :: snow, qsol
75    REAL, DIMENSION(klon), INTENT(INOUT)          :: agesno
76    REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil
77
78! Output variables
79!****************************************************************************************
80    REAL, DIMENSION(klon), INTENT(OUT)            :: qsurf
81    REAL, DIMENSION(klon), INTENT(OUT)            :: z0_new
82    REAL, DIMENSION(klon), INTENT(OUT)            :: alb1  ! new albedo in visible SW interval
83    REAL, DIMENSION(klon), INTENT(OUT)            :: alb2  ! new albedo in near IR interval
84    REAL, DIMENSION(klon), INTENT(OUT)            :: evap, fluxsens, fluxlat
85    REAL, DIMENSION(klon), INTENT(OUT)            :: tsurf_new
86    REAL, DIMENSION(klon), INTENT(OUT)            :: dflux_s, dflux_l     
87    REAL, DIMENSION(klon), INTENT(OUT)            :: flux_u1, flux_v1
88
89    REAL, DIMENSION(klon), INTENT(OUT)           :: alb3
90    REAL, DIMENSION(klon), INTENT(OUT)           :: qsnow   !column water in snow [kg/m2]
91    REAL, DIMENSION(klon), INTENT(OUT)           :: snowhgt !Snow height (m)
92    REAL, DIMENSION(klon), INTENT(OUT)           :: to_ice
93    REAL, DIMENSION(klon), INTENT(OUT)           :: sissnow
94    REAL, DIMENSION(klon), INTENT(OUT)           :: runoff  !Land ice runoff
95 
96
97! Local variables
98!****************************************************************************************
99    REAL, DIMENSION(klon)    :: soilcap, soilflux
100    REAL, DIMENSION(klon)    :: cal, beta, dif_grnd
101    REAL, DIMENSION(klon)    :: zfra, alb_neig
102    REAL, DIMENSION(klon)    :: radsol
103    REAL, DIMENSION(klon)    :: u0, v0, u1_lay, v1_lay
104    INTEGER                  :: i,j
105
106    REAL, DIMENSION(klon)    :: emis_new                  !Emissivity
107    REAL, DIMENSION(klon)    :: swdown,lwdown
108    REAL, DIMENSION(klon)    :: precip_snow_adv, snow_adv !Snow Drift precip./advection
109    REAL, DIMENSION(klon)    :: bl_height, wind_velo      !height boundary layer, wind spd
110    REAL, DIMENSION(klon)    :: dens_air,  snow_cont_air  !air density; snow content air
111    REAL, DIMENSION(klon)    :: alb_soil                  !albedo of underlying ice
112    REAL, DIMENSION(klon)    :: pexner                    !Exner potential
113    REAL                     :: pref
114    REAL, DIMENSION(klon,nsoilmx) :: tsoil0 !modfi
115
116    CHARACTER (len = 20)                      :: modname = 'surf_landice'
117    CHARACTER (len = 80)                      :: abort_message
118
119! End definition
120!****************************************************************************************
121!
122! Initialize output variables
123    alb3(:) = 999999.
124    alb2(:) = 999999.
125    alb1(:) = 999999.
126   
127    runoff(:) = 0.
128!****************************************************************************************
129! Calculate total absorbed radiance at surface
130!
131!****************************************************************************************
132    radsol(:) = 0.0
133    radsol(1:knon) = swnet(1:knon) + lwnet(1:knon)
134
135!****************************************************************************************
136!   ok_snow = TRUE  : prepare and call SISVAT snow model
137!   ok_snow = FALSE : soil_model, calcul_flux, fonte_neige, ...
138!
139!****************************************************************************************
140    IF (ok_snow) THEN
141#ifdef CPP_SISVAT
142       ! Prepare for calling SISVAT
143       
144       ! Calculate incoming flux for SW and LW interval: swdown, lwdown
145       swdown(:)        = 0.0
146       lwdown(:)        = 0.0
147       DO i = 1, knon
148          swdown(i)        = swnet(i)/(1-albedo(i))
149          lwdown(i)        = lwdownm(i)
150       END DO
151       
152       ! Set constants and compute some input for SISVAT
153       snow_adv(:)      = 0.                          ! no snow blown in for now
154       snow_cont_air(:) = 0.       
155       alb_soil(:)      = albedo(:)
156       pref             = 100000.                     ! = 1000 hPa
157       DO i = 1, knon
158          wind_velo(i)     = u1(i)**2 + v1(i)**2
159          wind_velo(i)     = wind_velo(i)**0.5
160          pexner(i)        = (p1lay(i)/pref)**(RD/RCPD)
161          dens_air(i)      = p1lay(i)/RD/temp_air(i)  ! dry air density
162          bl_height(i)     = pphi1(i)/RG             
163       END DO
164
165!****************************************************************************************
166! CALL to SISVAT interface
167!
168!****************************************************************************************
169       ! config: compute everything with SV but temperatures afterwards with soil/calculfluxs
170       DO i = 1, knon
171          tsoil0(i,:)=tsoil(i,:)
172       END DO
173           ! Martin
174           PRINT*, 'on appelle surf_sisvat'
175           ! Martin
176       CALL surf_sisvat(knon, rlon, rlat, knindex, itime, dtime, debut, lafin, &
177            rmu0, swdown, lwdown, pexner, ps, p1lay, &
178            precip_rain, precip_snow, precip_snow_adv, snow_adv, &
179            bl_height, wind_velo, temp_air, dens_air, spechum, tsurf, &
180            rugoro, snow_cont_air, alb_soil, slope, cloudf, &
181            radsol, qsol, tsoil0, snow, snowhgt, qsnow, to_ice,sissnow, agesno, &
182            AcoefH, AcoefQ, BcoefH, BcoefQ, cdragh, &
183            run_off_lic, evap, fluxsens, fluxlat, dflux_s, dflux_l, &       
184            tsurf_new, alb1, alb2, alb3, &
185            emis_new, z0_new, qsurf)
186       
187       ! Suppose zero surface speed
188       u0(:)            = 0.0
189       v0(:)            = 0.0
190       ! The calculation of heat/water fluxes, otherwise done by "CALL calcul_fluxs" is
191       ! integrated in SISVAT, using the same method. It can be found in "sisvat.f", in the
192       ! subroutine "SISVAT_TS2".
193       ! u0, v0=0., dif_grnd=0. and beta=1 are assumed there!
194       
195       CALL calcul_flux_wind(knon, dtime, &
196            u0, v0, u1, v1, cdragm, &
197            AcoefU, AcoefV, BcoefU, BcoefV, &
198            p1lay, temp_air, &
199            flux_u1, flux_v1)
200#else
201       abort_message='Pb de coherence: ok_snow = .true. mais CPP_SISVAT = .false.'
202       CALL abort_gcm(modname,abort_message,1)
203#endif
204    ELSE ! ok_snow=FALSE
205
206!****************************************************************************************
207! Soil calculations
208!
209!****************************************************************************************
210    IF (soil_model) THEN
211       CALL soil(dtime, is_lic, knon, snow, tsurf, tsoil, soilcap, soilflux)
212       cal(1:knon) = RCPD / soilcap(1:knon)
213       radsol(1:knon)  = radsol(1:knon) + soilflux(1:knon)
214    ELSE
215       cal = RCPD * calice
216       WHERE (snow > 0.0) cal = RCPD * calsno
217    ENDIF
218
219
220!****************************************************************************************
221! Calulate fluxes
222!
223!****************************************************************************************
224    beta(:) = 1.0
225    dif_grnd(:) = 0.0
226
227! Suppose zero surface speed
228    u0(:)=0.0
229    v0(:)=0.0
230    u1_lay(:) = u1(:) - u0(:)
231    v1_lay(:) = v1(:) - v0(:)
232
233    CALL calcul_fluxs(knon, is_lic, dtime, &
234         tsurf, p1lay, cal, beta, cdragh, ps, &
235         precip_rain, precip_snow, snow, qsurf,  &
236         radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &
237         AcoefH, AcoefQ, BcoefH, BcoefQ, &
238         tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)
239
240    CALL calcul_flux_wind(knon, dtime, &
241         u0, v0, u1, v1, cdragm, &
242         AcoefU, AcoefV, BcoefU, BcoefV, &
243         p1lay, temp_air, &
244         flux_u1, flux_v1)
245
246!****************************************************************************************
247! Calculate snow height, age, run-off,..
248!   
249!****************************************************************************************
250    CALL fonte_neige( knon, is_lic, knindex, dtime, &
251         tsurf, precip_rain, precip_snow, &
252         snow, qsol, tsurf_new, evap)
253
254
255!****************************************************************************************
256! Calculate albedo
257!
258!****************************************************************************************
259    CALL albsno(klon,knon,dtime,agesno(:),alb_neig(:), precip_snow(:)) 
260    WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.
261    zfra(1:knon) = MAX(0.0,MIN(1.0,snow(1:knon)/(snow(1:knon)+10.0)))
262    alb1(1:knon) = alb_neig(1:knon)*zfra(1:knon) + &
263         0.6 * (1.0-zfra(1:knon))
264!
265!IM: plusieurs choix/tests sur l'albedo des "glaciers continentaux"
266!       alb1(1 : knon)  = 0.6 !IM cf FH/GK
267!       alb1(1 : knon)  = 0.82
268!       alb1(1 : knon)  = 0.77 !211003 Ksta0.77
269!       alb1(1 : knon)  = 0.8 !KstaTER0.8 & LMD_ARMIP5
270!IM: KstaTER0.77 & LMD_ARMIP6   
271
272! Attantion: alb1 and alb2 are the same!
273    alb1(1:knon)  = 0.77
274    alb2(1:knon)  = alb1(1:knon)
275
276
277!****************************************************************************************
278! Rugosity
279!
280!****************************************************************************************
281    z0_new(:) = MAX(1.E-3,rugoro(:))
282    END IF ! ok_snow
283
284
285!****************************************************************************************
286! Send run-off on land-ice to coupler if coupled ocean.
287! run_off_lic has been calculated in fonte_neige or surf_sisvat
288!
289!****************************************************************************************
290    IF (type_ocean=='couple') THEN
291       CALL cpl_send_landice_fields(itime, knon, knindex, run_off_lic)
292    ENDIF
293
294 ! transfer runoff rate [kg/m2/s](!) to physiq for output
295    runoff(1:knon)=run_off_lic(1:knon)/dtime
296
297 
298!****************************************************************************************
299       snow_o=0.
300       zfra_o = 0.
301       DO j = 1, knon
302           i = knindex(j)
303           snow_o(i) = snow(j)
304           zfra_o(i) = zfra(j)
305       ENDDO
306
307!****************************************************************************************
308       snow_o=0.
309       zfra_o = 0.
310       DO j = 1, knon
311           i = knindex(j)
312           snow_o(i) = snow(j)
313           zfra_o(i) = zfra(j)
314       ENDDO
315
316
317  END SUBROUTINE surf_landice
318!
319!****************************************************************************************
320!
321END MODULE surf_landice_mod
322
323
324
Note: See TracBrowser for help on using the repository browser.