source: LMDZ6/trunk/libf/phylmd/surf_landice_mod.F90 @ 3941

Last change on this file since 3941 was 3903, checked in by evignon, 3 years ago

suppression du repertoire sisvat et nettoyage, deuxieme essai apres modifs
de JYG et plantage lie au bld.cfg

  • 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: 16.2 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, gustiness, rugoro, pctsrf, &
18       snow, qsurf, qsol, agesno, &
19       tsoil, z0m, z0h, SFRWL, alb_dir, alb_dif, evap, fluxsens, fluxlat, &
20       tsurf_new, dflux_s, dflux_l, &
21       alt, 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, landice_opt, iflag_albcalc
28    USE fonte_neige_mod,  ONLY : fonte_neige,run_off_lic,fqcalving_global,ffonte_global,fqfonte_global,runofflic_global
29    USE cpl_mod,          ONLY : cpl_send_landice_fields
30    USE calcul_fluxs_mod
31    USE phys_output_var_mod
32!FC
33    USE ioipsl_getin_p_mod, ONLY : getin_p
34
35
36#ifdef CPP_INLANDSIS
37    USE surf_inlandsis_mod,  ONLY : surf_inlandsis
38#endif
39
40    USE indice_sol_mod
41
42!    INCLUDE "indicesol.h"
43    INCLUDE "dimsoil.h"
44    INCLUDE "YOMCST.h"
45    INCLUDE "clesphys.h"
46
47! Input variables
48!****************************************************************************************
49    INTEGER, INTENT(IN)                           :: itime, knon
50    INTEGER, DIMENSION(klon), INTENT(in)          :: knindex
51    REAL, INTENT(in)                              :: dtime
52    REAL, DIMENSION(klon), INTENT(IN)             :: swnet ! net shortwave radiance
53    REAL, DIMENSION(klon), INTENT(IN)             :: lwnet ! net longwave radiance
54    REAL, DIMENSION(klon), INTENT(IN)             :: tsurf
55    REAL, DIMENSION(klon), INTENT(IN)             :: p1lay
56    REAL, DIMENSION(klon), INTENT(IN)             :: cdragh, cdragm
57    REAL, DIMENSION(klon), INTENT(IN)             :: precip_rain, precip_snow
58    REAL, DIMENSION(klon), INTENT(IN)             :: temp_air, spechum
59    REAL, DIMENSION(klon), INTENT(IN)             :: AcoefH, AcoefQ
60    REAL, DIMENSION(klon), INTENT(IN)             :: BcoefH, BcoefQ
61    REAL, DIMENSION(klon), INTENT(IN)             :: AcoefU, AcoefV, BcoefU, BcoefV
62    REAL, DIMENSION(klon), INTENT(IN)             :: ps
63    REAL, DIMENSION(klon), INTENT(IN)             :: u1, v1, gustiness
64    REAL, DIMENSION(klon), INTENT(IN)             :: rugoro
65    REAL, DIMENSION(klon,nbsrf), INTENT(IN)       :: pctsrf
66
67    LOGICAL,  INTENT(IN)                          :: debut   !true if first step
68    LOGICAL,  INTENT(IN)                          :: lafin   !true if last step
69    REAL, DIMENSION(klon), INTENT(IN)             :: rlon, rlat
70    REAL, DIMENSION(klon), INTENT(IN)             :: rmu0
71    REAL, DIMENSION(klon), INTENT(IN)             :: lwdownm !ylwdown
72    REAL, DIMENSION(klon), INTENT(IN)             :: albedo  !mean albedo
73    REAL, DIMENSION(klon), INTENT(IN)             :: pphi1   
74    REAL, DIMENSION(klon), INTENT(IN)             :: alt   !mean altitude of the grid box 
75    REAL, DIMENSION(klon), INTENT(IN)             :: slope   !mean slope in grid box 
76    REAL, DIMENSION(klon), INTENT(IN)             :: cloudf  !total cloud fraction
77
78! In/Output variables
79!****************************************************************************************
80    REAL, DIMENSION(klon), INTENT(INOUT)          :: snow, qsol
81    REAL, DIMENSION(klon), INTENT(INOUT)          :: agesno
82    REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil
83
84! Output variables
85!****************************************************************************************
86    REAL, DIMENSION(klon), INTENT(OUT)            :: qsurf
87    REAL, DIMENSION(klon), INTENT(OUT)            :: z0m, z0h
88!albedo SB >>>
89!    REAL, DIMENSION(klon), INTENT(OUT)            :: alb1  ! new albedo in visible SW interval
90!    REAL, DIMENSION(klon), INTENT(OUT)            :: alb2  ! new albedo in near IR interval
91    REAL, DIMENSION(6), INTENT(IN)                :: SFRWL
92    REAL, DIMENSION(klon,nsw), INTENT(OUT)        :: alb_dir,alb_dif
93!albedo SB <<<
94    REAL, DIMENSION(klon), INTENT(OUT)            :: evap, fluxsens, fluxlat
95    REAL, DIMENSION(klon), INTENT(OUT)            :: tsurf_new
96    REAL, DIMENSION(klon), INTENT(OUT)            :: dflux_s, dflux_l     
97    REAL, DIMENSION(klon), INTENT(OUT)            :: flux_u1, flux_v1
98
99    REAL, DIMENSION(klon), INTENT(OUT)           :: alb3
100    REAL, DIMENSION(klon), INTENT(OUT)           :: qsnow   !column water in snow [kg/m2]
101    REAL, DIMENSION(klon), INTENT(OUT)           :: snowhgt !Snow height (m)
102    REAL, DIMENSION(klon), INTENT(OUT)           :: to_ice
103    REAL, DIMENSION(klon), INTENT(OUT)           :: sissnow
104    REAL, DIMENSION(klon), INTENT(OUT)           :: runoff  !Land ice runoff
105 
106
107! Local variables
108!****************************************************************************************
109    REAL, DIMENSION(klon)    :: soilcap, soilflux
110    REAL, DIMENSION(klon)    :: cal, beta, dif_grnd
111    REAL, DIMENSION(klon)    :: zfra, alb_neig
112    REAL, DIMENSION(klon)    :: radsol
113    REAL, DIMENSION(klon)    :: u0, v0, u1_lay, v1_lay, ustar
114    INTEGER                  :: i,j,nt
115    REAL, DIMENSION(klon)    :: fqfonte,ffonte
116    REAL, DIMENSION(klon)    :: emis_new                  !Emissivity
117    REAL, DIMENSION(klon)    :: swdown,lwdown
118    REAL, DIMENSION(klon)    :: precip_snow_adv, snow_adv !Snow Drift precip./advection (not used in inlandsis)
119    REAL, DIMENSION(klon)    :: erod                      !erosion of surface snow (flux, kg/m2/s like evap)
120    REAL, DIMENSION(klon)    :: zsl_height, wind_velo     !surface layer height, wind spd
121    REAL, DIMENSION(klon)    :: dens_air,  snow_cont_air  !air density; snow content air
122    REAL, DIMENSION(klon)    :: alb_soil                  !albedo of underlying ice
123    REAL, DIMENSION(klon)    :: pexner                    !Exner potential
124    REAL                     :: pref
125    REAL, DIMENSION(klon,nsoilmx) :: tsoil0               !modif
126    REAL                          :: dtis                ! subtimestep
127    LOGICAL                       :: debut_is, lafin_is  ! debut and lafin for inlandsis
128
129    CHARACTER (len = 20)                      :: modname = 'surf_landice'
130    CHARACTER (len = 80)                      :: abort_message
131
132
133    REAL,DIMENSION(klon) :: alb1,alb2
134    REAL, DIMENSION (klon,6) :: alb6
135! End definition
136!****************************************************************************************
137!FC
138!FC
139   REAL,SAVE :: alb_vis_sno_lic
140  !$OMP THREADPRIVATE(alb_vis_sno_lic)
141   REAL,SAVE :: alb_nir_sno_lic
142  !$OMP THREADPRIVATE(alb_nir_sno_lic)
143  LOGICAL, SAVE :: firstcall = .TRUE.
144  !$OMP THREADPRIVATE(firstcall)
145
146
147!FC firtscall initializations
148!******************************************************************************************
149  IF (firstcall) THEN
150  alb_vis_sno_lic=0.77
151  CALL getin_p('alb_vis_sno_lic',alb_vis_sno_lic)
152           PRINT*, 'alb_vis_sno_lic',alb_vis_sno_lic
153  alb_nir_sno_lic=0.77
154  CALL getin_p('alb_nir_sno_lic',alb_nir_sno_lic)
155           PRINT*, 'alb_nir_sno_lic',alb_nir_sno_lic
156 
157!  z0m=1.e-3
158!  z0h = z0m
159  firstcall=.false.
160  ENDIF
161!******************************************************************************************
162
163! Initialize output variables
164    alb3(:) = 999999.
165    alb2(:) = 999999.
166    alb1(:) = 999999.
167   
168    runoff(:) = 0.
169!****************************************************************************************
170! Calculate total absorbed radiance at surface
171!
172!****************************************************************************************
173    radsol(:) = 0.0
174    radsol(1:knon) = swnet(1:knon) + lwnet(1:knon)
175
176!****************************************************************************************
177!  landice_opt = 0 : soil_model, calcul_flux, fonte_neige, ... 
178!  landice_opt = 1  : prepare and call INterace Lmdz SISvat (INLANDSIS)
179!****************************************************************************************
180
181
182    IF (landice_opt .EQ. 1) THEN
183
184!****************************************************************************************   
185! CALL to INLANDSIS interface
186!****************************************************************************************
187#ifdef CPP_INLANDSIS
188
189        debut_is=debut
190        lafin_is=.false.
191        ! Suppose zero surface speed
192        u0(:)            = 0.0
193        v0(:)            = 0.0
194
195
196        CALL calcul_flux_wind(knon, dtime, &
197         u0, v0, u1, v1, gustiness, cdragm, &
198         AcoefU, AcoefV, BcoefU, BcoefV, &
199         p1lay, temp_air, &
200         flux_u1, flux_v1)
201
202       
203       ! Set constants and compute some input for SISVAT
204       ! = 1000 hPa
205       ! and calculate incoming flux for SW and LW interval: swdown, lwdown
206       swdown(:)        = 0.0
207       lwdown(:)        = 0.0
208       snow_cont_air(:) = 0.  ! the snow content in air is not a prognostic variable of the model     
209       alb_soil(:)      = 0.4 ! before albedo(:) but here it is the ice albedo that we have to set
210       ustar(:)         = 0.
211       pref             = 100000.       
212       DO i = 1, knon
213          swdown(i)        = swnet(i)/(1-albedo(i))
214          lwdown(i)        = lwdownm(i)
215          wind_velo(i)     = u1(i)**2 + v1(i)**2
216          wind_velo(i)     = wind_velo(i)**0.5
217          pexner(i)        = (p1lay(i)/pref)**(RD/RCPD)
218          dens_air(i)      = p1lay(i)/RD/temp_air(i)  ! dry air density
219          zsl_height(i)    = pphi1(i)/RG     
220          tsoil0(i,:)      = tsoil(i,:) 
221          ustar(i)= (cdragm(i)*(wind_velo(i)**2))**0.5   
222       END DO
223       
224
225
226        dtis=dtime
227
228          IF (lafin) THEN
229            lafin_is=.true.
230          END IF
231
232          CALL surf_inlandsis(knon, rlon, rlat, knindex, itime, dtis, debut_is, lafin_is,&
233            rmu0, swdown, lwdown, albedo, pexner, ps, p1lay, precip_rain, precip_snow,   &
234            zsl_height, wind_velo, ustar, temp_air, dens_air, spechum, tsurf,&
235            rugoro, snow_cont_air, alb_soil, alt, slope, cloudf, &
236            radsol, qsol, tsoil0, snow, zfra, snowhgt, qsnow, to_ice, sissnow,agesno,   &
237            AcoefH, AcoefQ, BcoefH, BcoefQ, cdragm, cdragh, &
238            run_off_lic, fqfonte, ffonte, evap, erod, fluxsens, fluxlat,dflux_s, dflux_l, &
239            tsurf_new, alb1, alb2, alb3, alb6, &
240            emis_new, z0m, z0h, qsurf)
241
242          debut_is=.false.
243
244
245        ! Treatment of snow melting and calving
246
247        ! for consistency with standard LMDZ, add calving to run_off_lic
248        run_off_lic(:)=run_off_lic(:) + to_ice(:)
249
250        DO i = 1, knon
251           ffonte_global(knindex(i),is_lic)    = ffonte(i)
252           fqfonte_global(knindex(i),is_lic)   = fqfonte(i)! net melting= melting - refreezing
253           fqcalving_global(knindex(i),is_lic) = to_ice(i) ! flux
254           runofflic_global(knindex(i)) = run_off_lic(i)
255        ENDDO
256        ! Here, we assume that the calving term is equal to the to_ice term
257        ! (no ice accumulation)
258
259
260#else
261       abort_message='Pb de coherence: landice_opt = 1  mais CPP_INLANDSIS = .false.'
262       CALL abort_physic(modname,abort_message,1)
263#endif
264
265
266
267    ELSE
268
269!****************************************************************************************
270! Soil calculations
271!
272!****************************************************************************************
273
274    ! EV: use calbeta
275    CALL calbeta(dtime, is_lic, knon, snow, qsol, beta, cal, dif_grnd)
276
277
278    ! use soil model and recalculate properly cal
279    IF (soil_model) THEN
280       CALL soil(dtime, is_lic, knon, snow, tsurf, tsoil, soilcap, soilflux)
281       cal(1:knon) = RCPD / soilcap(1:knon)
282       radsol(1:knon)  = radsol(1:knon) + soilflux(1:knon)
283    ELSE
284       cal = RCPD * calice
285       WHERE (snow > 0.0) cal = RCPD * calsno
286    ENDIF
287
288
289!****************************************************************************************
290! Calulate fluxes
291!
292!****************************************************************************************
293!    beta(:) = 1.0
294!    dif_grnd(:) = 0.0
295
296! Suppose zero surface speed
297    u0(:)=0.0
298    v0(:)=0.0
299    u1_lay(:) = u1(:) - u0(:)
300    v1_lay(:) = v1(:) - v0(:)
301
302    CALL calcul_fluxs(knon, is_lic, dtime, &
303         tsurf, p1lay, cal, beta, cdragh, cdragh, ps, &
304         precip_rain, precip_snow, snow, qsurf,  &
305         radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, gustiness, &
306         1.,AcoefH, AcoefQ, BcoefH, BcoefQ, &
307         tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)
308
309    CALL calcul_flux_wind(knon, dtime, &
310         u0, v0, u1, v1, gustiness, cdragm, &
311         AcoefU, AcoefV, BcoefU, BcoefV, &
312         p1lay, temp_air, &
313         flux_u1, flux_v1)
314
315!****************************************************************************************
316! Calculate snow height, age, run-off,..
317!   
318!****************************************************************************************
319    CALL fonte_neige(knon, is_lic, knindex, dtime, &
320         tsurf, precip_rain, precip_snow, &
321         snow, qsol, tsurf_new, evap)
322
323
324!****************************************************************************************
325! Calculate albedo
326!
327!****************************************************************************************
328    CALL albsno(klon,knon,dtime,agesno(:),alb_neig(:), precip_snow(:)) 
329
330    WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.
331    zfra(1:knon) = MAX(0.0,MIN(1.0,snow(1:knon)/(snow(1:knon)+10.0)))
332    alb1(1:knon) = alb_neig(1:knon)*zfra(1:knon) + &
333         0.6 * (1.0-zfra(1:knon))
334!
335!IM: plusieurs choix/tests sur l'albedo des "glaciers continentaux"
336!       alb1(1 : knon)  = 0.6 !IM cf FH/GK
337!       alb1(1 : knon)  = 0.82
338!       alb1(1 : knon)  = 0.77 !211003 Ksta0.77
339!       alb1(1 : knon)  = 0.8 !KstaTER0.8 & LMD_ARMIP5
340!IM: KstaTER0.77 & LMD_ARMIP6   
341
342! Attantion: alb1 and alb2 are not the same!
343    alb1(1:knon)  = alb_vis_sno_lic
344    alb2(1:knon)  = alb_nir_sno_lic
345
346
347!****************************************************************************************
348! Rugosity
349!
350!****************************************************************************************
351    z0m=1.e-3
352    z0h = z0m
353    z0m = SQRT(z0m**2+rugoro**2)
354
355
356
357    END IF ! landice_opt
358
359
360!****************************************************************************************
361! Send run-off on land-ice to coupler if coupled ocean.
362! run_off_lic has been calculated in fonte_neige or surf_inlandsis
363!
364!****************************************************************************************
365    IF (type_ocean=='couple') THEN
366       CALL cpl_send_landice_fields(itime, knon, knindex, run_off_lic)
367    ENDIF
368
369 ! transfer runoff rate [kg/m2/s](!) to physiq for output
370    runoff(1:knon)=run_off_lic(1:knon)/dtime
371
372 
373!****************************************************************************************
374! Etienne: comment these lines because of duplication just below
375!       snow_o=0.
376!       zfra_o = 0.
377!       DO j = 1, knon
378!           i = knindex(j)
379!           snow_o(i) = snow(j)
380!           zfra_o(i) = zfra(j)
381!       ENDDO
382!
383!****************************************************************************************
384       snow_o=0.
385       zfra_o = 0.
386       DO j = 1, knon
387           i = knindex(j)
388           snow_o(i) = snow(j)
389           zfra_o(i) = zfra(j)
390       ENDDO
391
392
393!albedo SB >>>
394     select case(NSW)
395     case(2)
396       alb_dir(1:knon,1)=alb1(1:knon)
397       alb_dir(1:knon,2)=alb2(1:knon)
398     case(4)
399       alb_dir(1:knon,1)=alb1(1:knon)
400       alb_dir(1:knon,2)=alb2(1:knon)
401       alb_dir(1:knon,3)=alb2(1:knon)
402       alb_dir(1:knon,4)=alb2(1:knon)
403     case(6)
404       alb_dir(1:knon,1)=alb1(1:knon)
405       alb_dir(1:knon,2)=alb1(1:knon)
406       alb_dir(1:knon,3)=alb1(1:knon)
407       alb_dir(1:knon,4)=alb2(1:knon)
408       alb_dir(1:knon,5)=alb2(1:knon)
409       alb_dir(1:knon,6)=alb2(1:knon)
410
411       IF ((landice_opt .EQ. 1) .AND. (iflag_albcalc .EQ. 2)) THEN
412       alb_dir(1:knon,1)=alb6(1:knon,1)
413       alb_dir(1:knon,2)=alb6(1:knon,2)
414       alb_dir(1:knon,3)=alb6(1:knon,3)
415       alb_dir(1:knon,4)=alb6(1:knon,4)
416       alb_dir(1:knon,5)=alb6(1:knon,5)
417       alb_dir(1:knon,6)=alb6(1:knon,6)
418       ENDIF
419
420     end select
421alb_dif=alb_dir
422!albedo SB <<<
423
424 
425 
426
427  END SUBROUTINE surf_landice
428!
429!****************************************************************************************
430!
431END MODULE surf_landice_mod
432
433
434
Note: See TracBrowser for help on using the repository browser.