Changeset 1308 for trunk/LMDZ.GENERIC/libf/phystd/totalcloudfrac.F90
- Timestamp:
- Jul 10, 2014, 3:19:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/totalcloudfrac.F90
r858 r1308 1 subroutine totalcloudfrac(ngrid,n q,rneb,totalrneb,pplev,pq,tau)1 subroutine totalcloudfrac(ngrid,nlayer,nq,rneb,totalrneb,pplev,pq,tau) 2 2 3 3 use watercommon_h … … 19 19 !================================================================== 20 20 21 #include "dimensions.h"22 #include "dimphys.h"21 !#include "dimensions.h" 22 !#include "dimphys.h" 23 23 #include "comcstfi.h" 24 24 #include "callkeys.h" 25 25 26 26 integer,intent(in) :: ngrid ! number of atmospheric columns 27 integer,intent(in) :: nlayer ! number of atmospheric layers 27 28 integer,intent(in) :: nq ! number of tracers 28 real,intent(in) :: rneb(ngrid,nlayer mx) ! cloud fraction29 real,intent(in) :: rneb(ngrid,nlayer) ! cloud fraction 29 30 real,intent(out) :: totalrneb(ngrid) ! total cloud fraction 30 real,intent(in) :: pplev(ngrid,nlayer mx+1) ! inter-layer pressure (Pa)31 real,intent(in) :: pq(ngrid,nlayer mx,nq) ! tracers (.../kg_of_air)32 real,intent(in) :: tau(ngrid,nlayer mx)31 real,intent(in) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa) 32 real,intent(in) :: pq(ngrid,nlayer,nq) ! tracers (.../kg_of_air) 33 real,intent(in) :: tau(ngrid,nlayer) 33 34 34 real, dimension(nlayer mx+1) :: masse35 real, dimension(nlayer+1) :: masse 35 36 integer, parameter :: recovery=7 36 37 integer ltau_max … … 47 48 real clear,tau_min 48 49 real, parameter :: tau_c=0.1 !threshold of optical depth for the calculation of total cloud fraction 49 real rneb2(nlayer mx)50 real rneb2(nlayer) 50 51 51 52 … … 55 56 if (recovery.eq.1) then 56 57 clear = (1.-rneb(ig,1)) 57 do l=2,nlayer mx58 do l=2,nlayer 58 59 clear = clear*(1.-rneb(ig,l)) 59 60 enddo … … 62 63 elseif (recovery.eq.2) then 63 64 totalrneb(ig) = rneb(ig,1) 64 do l=2,14 !nlayer mx65 do l=2,14 !nlayer 65 66 totalrneb(ig) = max(rneb(ig,l),totalrneb(ig)) 66 67 enddo … … 68 69 elseif (recovery.eq.3) then 69 70 totalrneb(ig) = rneb(ig,1) 70 do l=2,nlayer mx71 do l=2,nlayer 71 72 totalrneb(ig) = min(rneb(ig,l),totalrneb(ig)) 72 73 enddo … … 77 78 elseif (recovery.eq.5) then 78 79 totalrneb(ig) = rneb(ig,1) 79 do l=1,nlayer mx80 do l=1,nlayer 80 81 masse(l)=pq(ig,l,igcm_h2o_ice)*(pplev(ig,l)-pplev(ig,l+1)) 81 82 enddo … … 85 86 elseif (recovery.eq.6) then 86 87 totalrneb(ig) = 0. 87 do l=1,nlayer mx88 do l=1,nlayer 88 89 masse(l)=pq(ig,l,igcm_h2o_ice)*(pplev(ig,l)-pplev(ig,l+1)) 89 90 masse(l)=max(masse(l),0.) 90 91 enddo 91 92 massetot=sum(masse,dim=1) 92 do l=1,nlayer mx93 do l=1,nlayer 93 94 totalrneb(ig) = totalrneb(ig)+rneb(ig,l)*masse(l)/massetot 94 95 enddo … … 96 97 elseif (recovery.eq.7) then 97 98 98 rneb2(:)=rneb(ig,1:nlayer mx)99 tau_min=MIN(tau_c,MAXVAL(tau(ig,1:nlayer mx))/2.)100 do l=1,nlayer mx99 rneb2(:)=rneb(ig,1:nlayer) 100 tau_min=MIN(tau_c,MAXVAL(tau(ig,1:nlayer))/2.) 101 do l=1,nlayer 101 102 if(tau(ig,l)<tau_min) rneb2(l)=0. 102 103 enddo 103 totalrneb(ig)=maxval(rneb2(1:nlayer mx))104 totalrneb(ig)=maxval(rneb2(1:nlayer)) 104 105 105 106 endif ! (recovery=)
Note: See TracChangeset
for help on using the changeset viewer.