source: LMDZ5/branches/testing/libf/phylmd/surf_land_mod.F90 @ 2314

Last change on this file since 2314 was 2298, checked in by Laurent Fairhead, 9 years ago

Merged trunk changes -r2237:2291 into testing branch

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