source: trunk/LMDZ.GENERIC/libf/phystd/totalcloudfrac.F90 @ 374

Last change on this file since 374 was 253, checked in by emillour, 13 years ago

Generic GCM

  • Massive update to version 0.7

EM+RW

File size: 1.8 KB
Line 
1      subroutine totalcloudfrac(rneb,totalrneb)
2
3      implicit none
4
5!==================================================================
6!     
7!     Purpose
8!     -------
9!     Calculates the total cloud fraction
10!     
11!     Authors
12!     -------
13!     Adapted from the LMDTERRE code by B Charnay (2010)
14!     
15!==================================================================
16
17#include "dimensions.h"
18#include "dimphys.h"
19#include "comcstfi.h"
20#include "tracer.h"
21#include "fisice.h"
22#include "comgeomfi.h"
23#include "comdiurn.h"
24
25      real rneb(ngridmx,nlayermx)             ! cloud fraction     
26      real totalrneb(ngridmx)                 ! total cloud fraction
27
28      integer recovery
29      parameter(recovery=1)
30
31! hypothesis behind recovery. value:
32! 1 = random recovery
33! 2 = maximal recovery
34! 3 = minimal recovery
35
36
37!     Local variables
38      integer ig, l
39      real clear
40
41      do ig=1,ngridmx
42         totalrneb(ig) = 0.
43
44         if (recovery.eq.1) then
45            clear = (1.-rneb(ig,1))
46            do l=2,nlayermx       
47               clear = clear*(1.-rneb(ig,l))
48            enddo
49            totalrneb(ig) = 1.-clear
50
51         elseif (recovery.eq.2) then
52            totalrneb(ig) = rneb(ig,1)
53            do l=2,nlayermx       
54               totalrneb(ig) = max(rneb(ig,l),totalrneb(ig))
55            enddo
56           
57         elseif (recovery.eq.3) then
58            totalrneb(ig) = rneb(ig,1)
59            do l=2,nlayermx       
60               totalrneb(ig) = min(rneb(ig,l),totalrneb(ig))
61            enddo
62         endif                  ! (recovery=)
63         
64         totalrneb(ig) = min(1.,totalrneb(ig))
65         totalrneb(ig) = max(0.,totalrneb(ig))
66         
67      enddo                     ! (ig=)
68     
69     
70    end subroutine totalcloudfrac
Note: See TracBrowser for help on using the repository browser.