/[lmdze]/trunk/phylmd/Interface_surf/calcul_fluxs.f
ViewVC logotype

Diff of /trunk/phylmd/Interface_surf/calcul_fluxs.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/Sources/phylmd/Interface_surf/calcul_fluxs.f revision 207 by guez, Thu Sep 1 10:30:53 2016 UTC trunk/phylmd/Interface_surf/calcul_fluxs.f revision 300 by guez, Thu Aug 2 15:55:01 2018 UTC
# Line 4  module calcul_fluxs_m Line 4  module calcul_fluxs_m
4    
5  contains  contains
6    
7    SUBROUTINE calcul_fluxs(dtime, tsurf, p1lay, cal, beta, coef1lay, ps, &    SUBROUTINE calcul_fluxs(tsurf, p1lay, cal, beta, coef1lay, ps, qsurf, &
8         qsurf, radsol, dif_grnd, t1lay, q1lay, u1lay, v1lay, petAcoef, &         radsol, t1lay, q1lay, u1lay, v1lay, tAcoef, qAcoef, tBcoef, &
9         peqAcoef, petBcoef, peqBcoef, tsurf_new, evap, fluxlat, flux_t, &         qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l, dif_grnd)
        dflux_s, dflux_l)  
10    
11      ! Cette routine calcule les flux en h et q à l'interface et une      ! Cette routine calcule les flux en h et q à l'interface et une
12      ! température de surface.      ! température de surface.
13    
14      ! L. Fairhead April 2000      ! L. Fairhead, April 2000
15    
16      USE fcttre, ONLY: dqsatl, dqsats, foede, foeew, qsatl, qsats      ! Note that, if cal = 0, beta = 1 and dif_grnd = 0, then tsurf_new
17        ! = tsurf and qsurf = qsat.
18    
19        ! Libraries:
20      use nr_util, only: assert_eq      use nr_util, only: assert_eq
21    
22        use comconst, only: dtphys
23        USE fcttre, ONLY: foede, foeew
24      USE suphec_m, ONLY: rcpd, rd, retv, rlstt, rlvtt, rtt      USE suphec_m, ONLY: rcpd, rd, retv, rlstt, rlvtt, rtt
25      USE yoethf_m, ONLY: r2es, r5ies, r5les, rvtmp2      USE yoethf_m, ONLY: r2es, r5ies, r5les, rvtmp2
26    
     real, intent(IN):: dtime  
27      real, intent(IN):: tsurf(:) ! (knon) température de surface      real, intent(IN):: tsurf(:) ! (knon) température de surface
28    
29      real, intent(IN):: p1lay(:) ! (knon)      real, intent(IN):: p1lay(:) ! (knon)
# Line 34  contains Line 38  contains
38      real, intent(IN):: radsol(:) ! (knon)      real, intent(IN):: radsol(:) ! (knon)
39      ! rayonnement net au sol (longwave + shortwave)      ! rayonnement net au sol (longwave + shortwave)
40    
41      real, intent(IN):: dif_grnd(:) ! (knon)      real, intent(IN):: dif_grnd ! coefficient de diffusion vers le sol profond
     ! coefficient de diffusion vers le sol profond  
   
42      real, intent(IN):: t1lay(:), q1lay(:), u1lay(:), v1lay(:) ! (knon)      real, intent(IN):: t1lay(:), q1lay(:), u1lay(:), v1lay(:) ! (knon)
43    
44      real, intent(IN):: petAcoef(:), peqAcoef(:) ! (knon)      real, intent(IN):: tAcoef(:), qAcoef(:) ! (knon)
45      ! coefficients A de la résolution de la couche limite pour T et q      ! coefficients A de la résolution de la couche limite pour T et q
46    
47      real, intent(IN):: petBcoef(:), peqBcoef(:) ! (knon)      real, intent(IN):: tBcoef(:), qBcoef(:) ! (knon)
48      ! coefficients B de la résolution de la couche limite pour t et q      ! coefficients B de la résolution de la couche limite pour t et q
49    
50      real, intent(OUT):: tsurf_new(:) ! (knon) température au sol      real, intent(OUT):: tsurf_new(:) ! (knon) température au sol
# Line 57  contains Line 59  contains
59    
60      ! Local:      ! Local:
61      integer i      integer i
62      integer knon ! nombre de points a traiter      integer knon ! nombre de points \`a traiter
63      real, dimension(size(ps)):: mh, oh, mq, nq, oq, dq_s_dt, coef ! (knon)      real, dimension(size(ps)):: mh, oh, mq, nq, oq, dq_s_dt, coef ! (knon)
64      real qsat(size(ps)) ! (knon) mass fraction      real qsat(size(ps)) ! (knon) mass fraction
65      real sl(size(ps)) ! (knon) chaleur latente d'évaporation ou de sublimation      real sl(size(ps)) ! (knon) chaleur latente d'évaporation ou de sublimation
# Line 67  contains Line 69  contains
69    
70      !---------------------------------------------------------------------      !---------------------------------------------------------------------
71    
72      knon = assert_eq((/size(tsurf), size(p1lay), size(cal), size(beta), &      knon = assert_eq([size(tsurf), size(p1lay), size(cal), size(beta), &
73           size(coef1lay), size(ps), size(qsurf), size(radsol), size(dif_grnd), &           size(coef1lay), size(ps), size(qsurf), size(radsol), size(t1lay), &
74           size(t1lay), size(q1lay), size(u1lay), size(v1lay), size(petAcoef), &           size(q1lay), size(u1lay), size(v1lay), size(tAcoef), size(qAcoef), &
75           size(peqAcoef), size(petBcoef), size(peqBcoef), size(tsurf_new), &           size(tBcoef), size(qBcoef), size(tsurf_new), size(evap), &
76           size(evap), size(fluxlat), size(flux_t), size(dflux_s), &           size(fluxlat), size(flux_t), size(dflux_s), size(dflux_l)], &
77           size(dflux_l)/), "calcul_fluxs knon")           "calcul_fluxs knon")
78    
79      ! Traitement de l'humidité du sol      ! Traitement de l'humidité du sol
80    
# Line 90  contains Line 92  contains
92      sl = merge(RLSTT, RLVTT, tsurf < RTT)      sl = merge(RLSTT, RLVTT, tsurf < RTT)
93    
94      ! Q      ! Q
95      oq = 1. - (beta * coef * peqBcoef * dtime)      oq = 1. - beta * coef * qBcoef * dtphys
96      mq = beta * coef * (peqAcoef - qsat + dq_s_dt * tsurf) / oq      mq = beta * coef * (qAcoef - qsat + dq_s_dt * tsurf) / oq
97      nq = beta * coef * (- 1. * dq_s_dt) / oq      nq = - beta * coef * dq_s_dt / oq
98    
99      ! H      ! H
100      oh = 1. - (coef * petBcoef * dtime)      oh = 1. - coef * tBcoef * dtphys
101      mh = coef * petAcoef / oh      mh = coef * tAcoef / oh
102      dflux_s = - (coef * RCPD)/ oh      dflux_s = - coef * RCPD / oh
103    
104      ! Tsurface      tsurf_new = (tsurf + cal / RCPD * dtphys * (radsol + mh + sl * mq) &
105      tsurf_new = (tsurf + cal / RCPD * dtime * (radsol + mh + sl * mq) &           + dif_grnd * t_grnd * dtphys) / (1. - dtphys * cal / RCPD * (dflux_s &
106           + dif_grnd * t_grnd * dtime) / (1. - dtime * cal / RCPD * (dflux_s &           + sl * nq) + dtphys * dif_grnd)
          + sl * nq) + dtime * dif_grnd)  
   
107      evap = - mq - nq * tsurf_new      evap = - mq - nq * tsurf_new
108      fluxlat = - evap * sl      fluxlat = - evap * sl
109      flux_t = mh + dflux_s * tsurf_new      flux_t = mh + dflux_s * tsurf_new
110      dflux_l = sl * nq      dflux_l = sl * nq
111        qsurf = (qAcoef - qBcoef * evap * dtphys) * (1. - beta) + beta * (qsat &
     ! Nouvelle valeur de l'humidité au dessus du sol :  
     qsurf = (peqAcoef - peqBcoef * evap * dtime) * (1. - beta) + beta * (qsat &  
112           + dq_s_dt * (tsurf_new - tsurf))           + dq_s_dt * (tsurf_new - tsurf))
113    
114    END SUBROUTINE calcul_fluxs    END SUBROUTINE calcul_fluxs

Legend:
Removed from v.207  
changed lines
  Added in v.300

  ViewVC Help
Powered by ViewVC 1.1.21