BUGSrad
 All Classes Files Functions Variables
rayle.f90
Go to the documentation of this file.
1 
2 
3 ! CVS: $Id: rayle.F90,v 1.2 2007/05/30 20:26:31 norm Exp $
4 ! CVS: $Name: $
5 module rayleigh
6 contains
7 !-----------------------------------------------------------------------
8 
9 subroutine rayle (&
10  nlm & !Number of layers
11  ,ib & !Index of spectral interval
12  ,pp & !Level pressure, hPa
13  ,tray & !Rayleigh optical depth
14  ,wray) !Rayleigh single-scattering albedo
15 
16  use kinds
17  use bugsrad_physconst, only: n_av, gravity, mw_dry_air, ri
18 
19  implicit none
20 
21 !-----------------------------------------------------------------------
22 ! REFERENCES:
23 ! Multitasked version of rayle.f from G. Stephens. Rayle computes the
24 ! optical depth and single scattering albedo due to Rayleigh scattering.
25 ! Laura D. Fowler (slikrock. 08-20-97)
26 
27 ! send comments to laura@slikrock.atmos.colostate.edu and
28 ! partain@atmos.colostate.edu
29 
30 ! MODIFICATIONS:
31 ! * changed declarations to adapt the code from BUGS4 to BUGS5.
32 ! Laura D. Fowler/slikrock (02-01-00).
33 ! 22 Nov 2005
34 ! Updated Rayleigh optical depth calculation. Now uses band-averaged
35 ! Rayleigh scattering cross-sections following Bodhaine et al. 1999
36 ! Band average values are weighted by a top-of-atmosphere solar
37 ! spectrum obtained from Modtran 4.1 (see Anderson et al., 2000),
38 ! and based on Kurucz, 1995
39 !
40 
41 
42 ! SUBROUTINES CALLED:
43 ! none.
44 
45 ! FUNCTIONS CALLED:
46 ! none.
47 
48 ! INCLUDED COMMONS:
49 ! none.
50 
51 ! ARGUMENT LIST VARIABLES:
52 ! INPUT ARGUMENTS:
53 ! ----------------
54  integer (kind=int_kind), intent(in):: &
55  nlm & !Number of layers.
56  ,ib !Index of spectral interval.
57 
58  real (kind=dbl_kind), intent(in), dimension(:,:):: & !(ncol,nlm+1)
59  pp !Level pressure (hPa).
60 
61 ! OUTPUT ARGUMENTS:
62 ! -----------------
63  real (kind=dbl_kind), intent(out), dimension(:,:):: & !(ncol,nlm)
64  wray & !Rayleigh single scattering albedo (-).
65  ,tray !Rayleigh optical depth (-).
66 
67 ! LOCAL VARIABLES:
68  integer (kind=int_kind):: &
69  i & !Horizontal index.
70  ,l !Vertical index.
71  real (kind=dbl_kind) :: &
72  fact !multiplier derived from scattering cross-section
73  !for scaling from pressure to optical depth
74 
75 !-----------------------------------------------------------------------
76 
77 !---- computes rayleigh scattering:
78 ! The factor of 10. adjusts units from g-cm to kg-m and takes into
79 ! account that pressure is in hPa.
80 !---- Do top level first
81  fact=ri(ib)*n_av/(mw_dry_air*gravity)*10.
82  tray(:,1) = pp(:,2)*fact
83  !Now remaining levels
84  do l = 2, nlm
85  tray(:,l) = (pp(:,l+1)-pp(:,l))*fact
86  enddo
87  wray(:,:) = 1.0
88  return
89  end subroutine rayle
90 end module rayleigh
91 
92 !-----------------------------------------------------------------------