BUGSrad
 All Classes Files Functions Variables
comscp2.f
Go to the documentation of this file.
1 
2 
3 ! CVS: $Id: comscp2.F,v 1.3 2001/04/30 08:47:14 norm Exp $
4 ! CVS: $Name: $
5 
6 
7 !-----------------------------------------------------------------------
8 
9  subroutine comscp2
10  + ( ncol , nlm , tg , fwcld
11  +, fwclr , tccld1 , tcclr1 , tccld
12  +, tcclr , wccld , wcclr
13  + )
14 
15  use kinds
16 
17  implicit none
18 
19 !-----------------------------------------------------------------------
20 ! REFERENCES:
21 ! comscp2 combines the single scattering properties computed in comscp1
22 ! to the single scattering properties due to non-gray absorption.
23 ! Laura D. Fowler (slikrock. 08-12-97).
24 
25 ! send comments to laura@slikrock.atmos.colostate.edu and
26 ! partain@atmos.colostate.edu
27 
28 ! MODIFICATIONS:
29 ! * changed declarations to adapt the code from BUGS4 to BUGS5.
30 ! Laura D. Fowler/slikrock (02-01-00).
31 
32 ! SUBROUTINES CALLED:
33 ! none.
34 
35 ! FUNCTIONS CALLED:
36 ! none.
37 
38 ! INCLUDED COMMONS:
39 ! none.
40 
41 ! ARGUMENT LIST VARIABLES:
42 ! All arrays indexed as nlm correspond to variables defined in the
43 ! middle of layers. In this subroutine, all the arrays are defined as
44 ! local arrays in BUGSswr.
45 
46 ! INPUT ARGUMENTS:
47 ! ----------------
48  integer (kind=int_kind), intent(in)::
49  & ncol !Length of sub-domain..
50  &, nlm !Number of layers.
51 
52  real (kind=dbl_kind), dimension(ncol,nlm)::
53  & tg !Optical depth of non-gray gases (-).
54  &, fwclr !Clear-sky single scattering albedo from comscp1 (-).
55  &, fwcld !
56 
57 ! INPUT/OUTPUT ARGUMENTS:
58 ! -----------------
59  real (kind=dbl_kind), dimension(ncol,nlm)::
60  & tcclr1 !Clear-sky optical depth (-).
61  &, tccld1 !All-sky optical depth (-).
62  &, tcclr !Clear-sky optical depth (-).
63  &, tccld !All-sky optical depth (-).
64 
65 ! OUTPUT ARGUMENTS:
66 ! -----------------
67  real (kind=dbl_kind), intent(out), dimension(ncol,nlm)::
68  & wcclr !Clear-sky single scattering albedo (-).
69  &, wccld !All-sky single scattering albedo (-).
70 
71 ! LOCAL LIST VARIABLES:
72 
73  integer (kind=int_kind)::
74  & i !Horizontal index.
75  &, l !Vertical index.
76 
77 !-----------------------------------------------------------------------
78 
79  do l = 1, nlm
80  do i = 1, ncol
81 
82  tcclr(i,l) = tcclr1(i,l) + tg(i,l)
83  tccld(i,l) = tccld1(i,l) + tg(i,l)
84 
85  if(tcclr(i,l).gt.0.) then
86  wcclr(i,l) = fwclr(i,l)/tcclr(i,l)
87  else
88  wcclr(i,l) = 0.
89  endif
90  wcclr(i,l) = min(.999999_dbl_kind,wcclr(i,l))
91 
92  if(tccld(i,l).gt.0.) then
93  wccld(i,l) = fwcld(i,l)/tccld(i,l)
94  else
95  wccld(i,l) = 0.
96  endif
97  wccld(i,l) = min(.999999_dbl_kind,wccld(i,l))
98 
99  enddo
100  enddo
101 
102  return
103  end subroutine comscp2
104 
105 c-----------------------------------------------------------------------