source: LMDZ6/branches/DYNAMICO-conv/libf/phylmd/surf_land_mod.F90 @ 3940

Last change on this file since 3940 was 3413, checked in by Laurent Fairhead, 6 years ago

Inclusion of Yann's latest (summer/fall 2018) modifications for
convergence of DYNAMICO/LMDZ physics
YM/LF

  • 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: 9.1 KB
RevLine 
[781]1!
2MODULE surf_land_mod
[2952]3
[781]4  IMPLICIT NONE
5
6CONTAINS
7!
8!****************************************************************************************
9
10  SUBROUTINE surf_land(itime, dtime, date0, jour, knon, knindex, &
[2410]11       rlon, rlat, yrmu0, &
[888]12       debut, lafin, zlev, ccanopy, swnet, lwnet, albedo, &
[1067]13       tsurf, p1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, &
14       AcoefH, AcoefQ, BcoefH, BcoefQ, &
15       AcoefU, AcoefV, BcoefU, BcoefV, &
[2240]16       pref, u1, v1, gustiness, rugoro, pctsrf, &
[1146]17       lwdown_m, q2m, t2m, &
[888]18       snow, qsol, agesno, tsoil, &
[2243]19       z0m, z0h, SFRWL, alb_dir_new, alb_dif_new, evap, fluxsens, fluxlat, &   
[996]20       qsurf, tsurf_new, dflux_s, dflux_l, &
[2952]21       flux_u1, flux_v1 , &
22       veget,lai,height)
[781]23
[1067]24    USE dimphy
25    USE surface_data, ONLY    : ok_veget
[1146]26
[2571]27    ! See comments in each module surf_land_orchidee_xxx for compatiblity with ORCHIDEE
[1146]28#ifdef ORCHIDEE_NOOPENMP
[2571]29    ! Compilation with cpp key ORCHIDEE NOOPENMP
[1146]30    USE surf_land_orchidee_noopenmp_mod
31#else
[2571]32#if ORCHIDEE_NOZ0H
33    ! Compilation with cpp key ORCHIDEE NOZ0H
34    USE surf_land_orchidee_noz0h_mod
35#else
[2952]36#if ORCHIDEE_NOFREIN
37    ! Compilation with cpp key ORCHIDEE_NOFREIN
38    USE surf_land_orchidee_nofrein_mod
39#else
[3413]40#if ORCHIDEE_NOUNSTRUCT
41    ! Compilation with cpp key ORCHIDEE_NOUNSTRUCT
42    USE surf_land_orchidee_nounstruct_mod
43#else
[1067]44    USE surf_land_orchidee_mod
[1146]45#endif
[2571]46#endif
[2952]47#endif
[3413]48#endif
[2571]49
[1067]50    USE surf_land_bucket_mod
51    USE calcul_fluxs_mod
[1785]52    USE indice_sol_mod
[1067]53
[781]54    INCLUDE "dimsoil.h"
[888]55    INCLUDE "YOMCST.h"
[2227]56    INCLUDE "clesphys.h"
[2952]57    INCLUDE "dimpft.h"
[781]58
[2952]59
[781]60! Input variables 
61!****************************************************************************************
62    INTEGER, INTENT(IN)                     :: itime, jour, knon
63    INTEGER, DIMENSION(klon), INTENT(IN)    :: knindex
64    REAL, INTENT(IN)                        :: date0
65    REAL, DIMENSION(klon), INTENT(IN)       :: rlon, rlat
[2410]66    REAL, DIMENSION(klon), INTENT(IN)       :: yrmu0  ! cosine of solar zenith angle
[781]67    LOGICAL, INTENT(IN)                     :: debut, lafin
68    REAL, INTENT(IN)                        :: dtime
[888]69    REAL, DIMENSION(klon), INTENT(IN)       :: zlev, ccanopy
70    REAL, DIMENSION(klon), INTENT(IN)       :: swnet, lwnet
71    REAL, DIMENSION(klon), INTENT(IN)       :: albedo  ! albedo for whole short-wave interval
[781]72    REAL, DIMENSION(klon), INTENT(IN)       :: tsurf
73    REAL, DIMENSION(klon), INTENT(IN)       :: p1lay
[1067]74    REAL, DIMENSION(klon), INTENT(IN)       :: cdragh, cdragm
[781]75    REAL, DIMENSION(klon), INTENT(IN)       :: precip_rain, precip_snow
76    REAL, DIMENSION(klon), INTENT(IN)       :: temp_air, spechum
[1067]77    REAL, DIMENSION(klon), INTENT(IN)       :: AcoefH, AcoefQ, BcoefH, BcoefQ
78    REAL, DIMENSION(klon), INTENT(IN)       :: AcoefU, AcoefV, BcoefU, BcoefV
[888]79    REAL, DIMENSION(klon), INTENT(IN)       :: pref   ! pressure reference
[2240]80    REAL, DIMENSION(klon), INTENT(IN)       :: u1, v1, gustiness
[781]81    REAL, DIMENSION(klon), INTENT(IN)       :: rugoro
82    REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf
[888]83    REAL, DIMENSION(klon), INTENT(IN)       :: lwdown_m  ! downwelling longwave radiation at mean surface
84                                                         ! corresponds to previous sollwdown
[1146]85    REAL, DIMENSION(klon), INTENT(IN)       :: q2m, t2m
[888]86
[781]87! In/Output variables
88!****************************************************************************************
89    REAL, DIMENSION(klon), INTENT(INOUT)          :: snow, qsol
90    REAL, DIMENSION(klon), INTENT(INOUT)          :: agesno
91    REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil
92
93! Output variables
94!****************************************************************************************
[2243]95    REAL, DIMENSION(klon), INTENT(OUT)       :: z0m, z0h
[2227]96!albedo SB >>>
97!    REAL, DIMENSION(klon), INTENT(OUT)       :: alb1_new ! albdeo for shortwave interval 1(visible)
98!    REAL, DIMENSION(klon), INTENT(OUT)       :: alb2_new ! albedo for shortwave interval 2(near infrared)
99    REAL, DIMENSION(6), INTENT(IN) :: SFRWL
100    REAL, DIMENSION(klon,nsw), INTENT(OUT)       :: alb_dir_new,alb_dif_new
101!albedo SB <<<
[888]102    REAL, DIMENSION(klon), INTENT(OUT)       :: evap
103    REAL, DIMENSION(klon), INTENT(OUT)       :: fluxsens, fluxlat
[781]104    REAL, DIMENSION(klon), INTENT(OUT)       :: qsurf
[888]105    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new
[781]106    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l     
[1067]107    REAL, DIMENSION(klon), INTENT(OUT)       :: flux_u1, flux_v1  ! flux for U and V at first model level
[2952]108    REAL, DIMENSION(klon,nvm_lmdz), INTENT(OUT) :: veget,lai
109    REAL, DIMENSION(klon,nvm_lmdz), INTENT(OUT) :: height
[781]110
111! Local variables
112!****************************************************************************************
[888]113    REAL, DIMENSION(klon) :: p1lay_tmp
114    REAL, DIMENSION(klon) :: pref_tmp
115    REAL, DIMENSION(klon) :: swdown     ! downwelling shortwave radiation at land surface
116    REAL, DIMENSION(klon) :: epot_air           ! potential air temperature
[781]117    REAL, DIMENSION(klon) :: tsol_rad, emis_new ! output from interfsol not used
[1067]118    REAL, DIMENSION(klon) :: u0, v0     ! surface speed
[781]119    INTEGER               :: i
120
[2227]121!albedo SB >>>
122    REAL, DIMENSION(klon)      :: alb1_new,alb2_new
123!albedo SB <<<
[781]124
[2227]125
[781]126!****************************************************************************************
127! Choice between call to vegetation model (ok_veget=true) or simple calculation below
128!
129!****************************************************************************************
130   IF (ok_veget) THEN
131!****************************************************************************************
[888]132!  Call model sechiba in model ORCHIDEE
[781]133!
134!****************************************************************************************
135       p1lay_tmp(:)      = 0.0
[888]136       pref_tmp(:)       = 0.0
[781]137       p1lay_tmp(1:knon) = p1lay(1:knon)/100.
[888]138       pref_tmp(1:knon)  = pref(1:knon)/100.
139!
[2188]140!* Calculate incoming flux for SW and LW interval: swdown
[888]141!
142       swdown(:) = 0.0
143       DO i = 1, knon
144          swdown(i) = swnet(i)/(1-albedo(i))
145       END DO
146!
147!* Calculate potential air temperature
148!
149       epot_air(:) = 0.0
150       DO i = 1, knon
151          epot_air(i) = RCPD*temp_air(i)*(pref(i)/p1lay(i))**RKAPPA
152       END DO
[781]153
[888]154       ! temporary for keeping same results using lwdown_m instead of lwdown
[781]155       CALL surf_land_orchidee(itime, dtime, date0, knon, &
[2410]156            knindex, rlon, rlat, yrmu0, pctsrf, &
[781]157            debut, lafin, &
[2240]158            zlev,  u1, v1, gustiness, temp_air, spechum, epot_air, ccanopy, &
[1067]159            cdragh, AcoefH, AcoefQ, BcoefH, BcoefQ, &
[888]160            precip_rain, precip_snow, lwdown_m, swnet, swdown, &
[1146]161            pref_tmp, q2m, t2m, &
[781]162            evap, fluxsens, fluxlat, &             
[888]163            tsol_rad, tsurf_new, alb1_new, alb2_new, &
[2952]164            emis_new, z0m, z0h, qsurf, &
165            veget, lai, height)       
[781]166
[2952]167
[781]168
[888]169!* Add contribution of relief to surface roughness
[781]170
171       DO i=1,knon
[2243]172          z0m(i) = MAX(1.5e-05,SQRT(z0m(i)**2 + rugoro(i)**2))
[781]173       ENDDO
174
175    ELSE  ! not ok_veget
176!****************************************************************************************
177! No extern vegetation model choosen, call simple bucket calculations instead.
178!
179!****************************************************************************************
180       CALL surf_land_bucket(itime, jour, knon, knindex, debut, dtime,&
[1067]181            tsurf, p1lay, cdragh, precip_rain, precip_snow, temp_air, &
182            spechum, AcoefH, AcoefQ, BcoefH, BcoefQ, pref, &
[2240]183            u1, v1, gustiness, rugoro, swnet, lwnet, &
[888]184            snow, qsol, agesno, tsoil, &
[2243]185            qsurf, z0m, alb1_new, alb2_new, evap, &
[888]186            fluxsens, fluxlat, tsurf_new, dflux_s, dflux_l)
[2243]187        z0h(1:knon)=z0m(1:knon) ! En attendant mieux
[781]188
189    ENDIF ! ok_veget
190
[1067]191!****************************************************************************************
192! Calculation for all land models
193! - Flux calculation at first modele level for U and V
194!****************************************************************************************
195! Suppose zero surface speed
196    u0(:)=0.0
197    v0(:)=0.0
198    CALL calcul_flux_wind(knon, dtime, &
[2240]199         u0, v0, u1, v1, gustiness, cdragm, &
[1067]200         AcoefU, AcoefV, BcoefU, BcoefV, &
201         p1lay, temp_air, &
202         flux_u1, flux_v1)
[2227]203
204!albedo SB >>>
205
206
207     select case(NSW)
208     case(2)
209       alb_dir_new(1:knon,1)=alb1_new(1:knon)
210       alb_dir_new(1:knon,2)=alb2_new(1:knon)
211     case(4)
212       alb_dir_new(1:knon,1)=alb1_new(1:knon)
213       alb_dir_new(1:knon,2)=alb2_new(1:knon)
214       alb_dir_new(1:knon,3)=alb2_new(1:knon)
215       alb_dir_new(1:knon,4)=alb2_new(1:knon)
216     case(6)
217       alb_dir_new(1:knon,1)=alb1_new(1:knon)
218       alb_dir_new(1:knon,2)=alb1_new(1:knon)
219       alb_dir_new(1:knon,3)=alb1_new(1:knon)
220       alb_dir_new(1:knon,4)=alb2_new(1:knon)
221       alb_dir_new(1:knon,5)=alb2_new(1:knon)
222       alb_dir_new(1:knon,6)=alb2_new(1:knon)
223     end select
224alb_dif_new=alb_dir_new
225!albedo SB <<<
226
227
[1067]228   
[781]229  END SUBROUTINE surf_land
230!
231!****************************************************************************************
232
233END MODULE surf_land_mod
234!
235!****************************************************************************************
236
Note: See TracBrowser for help on using the repository browser.