/[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

revision 279 by guez, Fri Jul 20 14:30:23 2018 UTC revision 299 by guez, Thu Aug 2 14:27:11 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, qsurf, &    SUBROUTINE calcul_fluxs(tsurf, p1lay, cal, beta, coef1lay, ps, qsurf, &
8         radsol, dif_grnd, t1lay, q1lay, u1lay, v1lay, petAcoef, peqAcoef, &         radsol, dif_grnd, t1lay, q1lay, u1lay, v1lay, tAcoef, qAcoef, tBcoef, &
9         petBcoef, peqBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l)         qBcoef, tsurf_new, evap, fluxlat, flux_t, 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.
# Line 16  contains Line 16  contains
16      ! Note that, if cal = 0, beta = 1 and dif_grnd = 0, then tsurf_new      ! Note that, if cal = 0, beta = 1 and dif_grnd = 0, then tsurf_new
17      ! = tsurf and qsurf = qsat.      ! = 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      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 42  contains Line 43  contains
43    
44      real, intent(IN):: t1lay(:), q1lay(:), u1lay(:), v1lay(:) ! (knon)      real, intent(IN):: t1lay(:), q1lay(:), u1lay(:), v1lay(:) ! (knon)
45    
46      real, intent(IN):: petAcoef(:), peqAcoef(:) ! (knon)      real, intent(IN):: tAcoef(:), qAcoef(:) ! (knon)
47      ! 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
48    
49      real, intent(IN):: petBcoef(:), peqBcoef(:) ! (knon)      real, intent(IN):: tBcoef(:), qBcoef(:) ! (knon)
50      ! 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
51    
52      real, intent(OUT):: tsurf_new(:) ! (knon) température au sol      real, intent(OUT):: tsurf_new(:) ! (knon) température au sol
# Line 72  contains Line 73  contains
73    
74      knon = assert_eq([size(tsurf), size(p1lay), size(cal), size(beta), &      knon = assert_eq([size(tsurf), size(p1lay), size(cal), size(beta), &
75           size(coef1lay), size(ps), size(qsurf), size(radsol), size(dif_grnd), &           size(coef1lay), size(ps), size(qsurf), size(radsol), size(dif_grnd), &
76           size(t1lay), size(q1lay), size(u1lay), size(v1lay), size(petAcoef), &           size(t1lay), size(q1lay), size(u1lay), size(v1lay), size(tAcoef), &
77           size(peqAcoef), size(petBcoef), size(peqBcoef), size(tsurf_new), &           size(qAcoef), size(tBcoef), size(qBcoef), size(tsurf_new), &
78           size(evap), size(fluxlat), size(flux_t), size(dflux_s), &           size(evap), size(fluxlat), size(flux_t), size(dflux_s), &
79           size(dflux_l)], "calcul_fluxs knon")           size(dflux_l)], "calcul_fluxs knon")
80    
# Line 93  contains Line 94  contains
94      sl = merge(RLSTT, RLVTT, tsurf < RTT)      sl = merge(RLSTT, RLVTT, tsurf < RTT)
95    
96      ! Q      ! Q
97      oq = 1. - beta * coef * peqBcoef * dtime      oq = 1. - beta * coef * qBcoef * dtphys
98      mq = beta * coef * (peqAcoef - qsat + dq_s_dt * tsurf) / oq      mq = beta * coef * (qAcoef - qsat + dq_s_dt * tsurf) / oq
99      nq = - beta * coef * dq_s_dt / oq      nq = - beta * coef * dq_s_dt / oq
100    
101      ! H      ! H
102      oh = 1. - coef * petBcoef * dtime      oh = 1. - coef * tBcoef * dtphys
103      mh = coef * petAcoef / oh      mh = coef * tAcoef / oh
104      dflux_s = - coef * RCPD / oh      dflux_s = - coef * RCPD / oh
105    
106      tsurf_new = (tsurf + cal / RCPD * dtime * (radsol + mh + sl * mq) &      tsurf_new = (tsurf + cal / RCPD * dtphys * (radsol + mh + sl * mq) &
107           + dif_grnd * t_grnd * dtime) / (1. - dtime * cal / RCPD * (dflux_s &           + dif_grnd * t_grnd * dtphys) / (1. - dtphys * cal / RCPD * (dflux_s &
108           + sl * nq) + dtime * dif_grnd)           + sl * nq) + dtphys * dif_grnd)
109      evap = - mq - nq * tsurf_new      evap = - mq - nq * tsurf_new
110      fluxlat = - evap * sl      fluxlat = - evap * sl
111      flux_t = mh + dflux_s * tsurf_new      flux_t = mh + dflux_s * tsurf_new
112      dflux_l = sl * nq      dflux_l = sl * nq
113      qsurf = (peqAcoef - peqBcoef * evap * dtime) * (1. - beta) + beta * (qsat &      qsurf = (qAcoef - qBcoef * evap * dtphys) * (1. - beta) + beta * (qsat &
114           + dq_s_dt * (tsurf_new - tsurf))           + dq_s_dt * (tsurf_new - tsurf))
115    
116    END SUBROUTINE calcul_fluxs    END SUBROUTINE calcul_fluxs

Legend:
Removed from v.279  
changed lines
  Added in v.299

  ViewVC Help
Powered by ViewVC 1.1.21