source: LMDZ5/trunk/libf/phylmd/surf_land_mod.F90 @ 2477

Last change on this file since 2477 was 2410, checked in by jghattas, 9 years ago

Added the variable yrmu0(cosine of the solar zenith angle) into ORCHIDEE:

Current version of LMDZ can now be used with ORCHIDEE trunk revisions from rev 2961 and newer. For revision 1078-2960 on ORCHIDEE trunk, a small modification (change coszang into sinang) in surf_land_orchidee_mod.f90 is needed. For older versions than ORCHIDEE trunk revision 1078, the interface in surf_land_orchidee_noopenmp_mod.f90 should be used (add cpp key ORCHIDEE_NOOPENMP).

For details see ticket https://forge.ipsl.jussieu.fr/orchidee/ticket/217

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