source: LMDZ6/trunk/libf/phylmd/surf_land_mod.F90 @ 3435

Last change on this file since 3435 was 3435, checked in by Laurent Fairhead, 5 years ago

"Historic" :-) commit merging the physics branch used for DYNAMICO with the LMDZ trunk.
The same physics branch can now be used seamlessly with the traditional lon-lat LMDZ
dynamical core and DYNAMICO.
Testing consisted in running a lon-lat LMDZ bucket simulation with the NPv6.1 physics package
with the original trunk sources and the merged sources. Tests were succesful in the sense that
numeric continuity was preserved in the restart files from both simulation. Further tests
included running both versions of the physics codes for one year in a LMDZOR setting in which
the restart files also came out identical.

Caution:

  • as the physics package now manages unstructured grids, grid information needs to be transmitted

to the surface scheme ORCHIDEE. This means that the interface defined in surf_land_orchidee_mod.F90
is only compatible with ORCHIDEE version orchidee2.1 and later versions. If previous versions of
ORCHIDEE need to be used, the CPP key ORCHIDEE_NOUNSTRUCT needs to be set at compilation time.
This is done automatically if makelmdz/makelmdz_fcm are called with the veget orchidee2.0 switch

  • due to a limitation in XIOS, the time at which limit conditions will be read in by DYNAMICO will be

delayed by one physic timestep with respect to the time it is read in by the lon-lat model. This is caused
by the line

IF (MOD(itime-1, lmt_pas) == 0 .OR. (jour_lu /= jour .AND. grid_type /= unstructured)) THEN ! time to read

in limit_read_mod.F90

Work still needed on COSP integration and XML files for DYNAMICO

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