source: LMDZ6/branches/LMDZ-QUEST/libf/phylmd/borne_var_surf.F90 @ 3740

Last change on this file since 3740 was 3400, checked in by Laurent Fairhead, 6 years ago

Due to a difficult to correct bug, near surface fields can take abnormal values in very specific circumstances.
While waiting to find a correction, these modifications will force the values of these fields within reasonable bounds.
To get back to the previous behaviour of the model, use iflag_bug_t2m_ipslcm61 = 1 (it is 0 by default)

File size: 1.9 KB
Line 
1SUBROUTINE borne_var_surf(klon,nbsrf,                        &
2         t1,q1,u1,v1,                                        &
3         ftsol,pctsrf,                                       &
4         t2m, q2m, u10m, v10m,                               &
5         zt2m_cor, zq2m_cor, zu10m_cor, zv10m_cor)
6
7IMPLICIT NONE
8
9!==================================================================
10! Declarations
11!==================================================================
12
13! arguments
14INTEGER klon,nbsrf
15REAL,DIMENSION(klon),INTENT(IN) :: t1, q1, u1, v1
16REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: t2m, q2m, u10m, v10m
17REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: ftsol, pctsrf
18REAL,DIMENSION (klon) :: zt2m_cor, zq2m_cor, zu10m_cor, zv10m_cor
19
20
21! local
22INTEGER i,nsrf
23REAL,DIMENSION (klon,nbsrf) :: t2m_cor, q2m_cor, u10m_cor, v10m_cor
24
25!==================================================================
26! Correction of sub surface variables
27!==================================================================
28
29DO nsrf=1,nbsrf
30   DO i=1,klon
31      t2m_cor(i,nsrf)=MIN(t2m(i,nsrf),MAX(t1(i),ftsol(i,nsrf)))
32      t2m_cor(i,nsrf)=MAX(t2m_cor(i,nsrf),MIN(t1(i),ftsol(i,nsrf)))
33      q2m_cor(i,nsrf)=MAX(q2m(i,nsrf),0.)
34      u10m_cor(i,nsrf)=SIGN(MIN(ABS(u1(i)),ABS(u10m(i,nsrf))),u1(i))
35      v10m_cor(i,nsrf)=SIGN(MIN(ABS(v1(i)),ABS(v10m(i,nsrf))),v1(i))
36   ENDDO
37ENDDO
38
39!==================================================================
40! Agregation of sub surfaces
41!==================================================================
42
43zt2m_cor=0.
44zq2m_cor=0.0001
45zu10m_cor=0.
46zv10m_cor=0.
47DO nsrf = 1, nbsrf
48   DO i = 1, klon
49      zt2m_cor(i)  = zt2m_cor(i)  + t2m_cor(i,nsrf)  * pctsrf(i,nsrf)
50      zq2m_cor(i)  = zq2m_cor(i)  + q2m_cor(i,nsrf)  * pctsrf(i,nsrf)
51      zu10m_cor(i) = zu10m_cor(i) + u10m_cor(i,nsrf) * pctsrf(i,nsrf)
52      zv10m_cor(i) = zv10m_cor(i) + v10m_cor(i,nsrf) * pctsrf(i,nsrf)
53   ENDDO
54ENDDO
55
56RETURN
57END
58
59
Note: See TracBrowser for help on using the repository browser.