OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
multp2d.f
Go to the documentation of this file.
1  subroutine multp2d
2 c
3 c compute the multiple scattering contribution when the atmosphere is
4 c illuminated from the bottom. also, for each level, store the
5 c upwelling/downwelling diffuse radiation.
6 c
7 c*************************************************************************
8 c.....includes the common blocks
9  implicit real*8 (a-h,o-z)
10  include 'common_all.cmn'
11 c
12 c**************************************************************************
13 c
14 c compute the downward diffuse radiation at each level
15 c
16  read(irad,rec=1)fiib
17  write(iwrt,rec=1)fiib
18  do il=1,nolyr
19  ilp=il+1
20  ilm=il-1
21  if(il.eq.1)then
22  read(iwrt,rec=il)fiib
23  read(irad,rec=ilp)fio
24 c determine average intensity at the center of the layer il
25  do i=1,nmum1
26  do j=1,jpart
27  do k=1,4
28  fiic(k,i,j)=0.50d0*(fio(k,i,j)+fiib(k,i,j))
29  ftmp(k,i,j)=0.0d0
30  enddo
31  enddo
32  enddo
33  tmsl=dtmm(il)*qsqt*const
34  trsl=dtrr(il)*conr
35  dlyr=dtot(il)
36  if(ifc.eq.0)tmsl=0.0d0
37  call mdiffn(1,jjjj,il,dlyr)
38  do i=1,jjjj
39  do j=1,jpart
40  do k=1,4
41  fio(k,i,j)=fiib(k,i,j)*emdtm(il,i)+
42  1 ftmp(k,i,j)*(1.0d0-emdtm(il,i))
43  enddo
44  enddo
45  enddo
46  write(iwrt,rec=ilp)fio
47  else
48  read(iwrt,rec=ilm)fiib
49  do i=1,nmum1
50  do j=1,jpart
51  do k=1,4
52  fiic(k,i,j)=fio(k,i,j)
53  ftmp(k,i,j)=0.0d0
54  enddo
55  enddo
56  enddo
57  read(irad,rec=ilp)fio
58  tmsl=(dtmm(ilm)+dtmm(il))*qsqt*const
59  trsl=(dtrr(ilm)+dtrr(il))*conr
60  dlyr=(dtot(ilm)+dtot(il))
61  if(ifc.eq.0)tmsl=0.0d0
62  call mdiffn(1,jjjj,il,dlyr)
63  do i=1,jjjj
64  do j=1,jpart
65  do k=1,4
66  fio(k,i,j)=fiib(k,i,j)*emdtm(ilm,i)*emdtm(il,i)+
67  1 ftmp(k,i,j)*(1.0d0-emdtm(ilm,i)*emdtm(il,i))
68  enddo
69  enddo
70  enddo
71  write(iwrt,rec=ilp)fio
72  endif
73  enddo
74 c
75 c compute the upward diffuse radiation at each level
76  do il=1,nolyr
77  im=nolyr-il+1
78  imp=im+1
79  impp=imp+1
80  if(il.eq.1)then
81  read(iwrt,rec=imp)fiib
82  read(iwrt,rec=im)fio
83  do i=1,nmum1
84  do j=1,jpart
85  do k=1,4
86  fiic(k,i,j)=0.50d0*(fio(k,i,j)+fiib(k,i,j))
87  ftmp(k,i,j)=0.0d0
88  enddo
89  enddo
90  enddo
91  tmsl=dtmm(im)*qsqt*const
92  trsl=dtrr(im)*conr
93  dlyr=dtot(im)
94  if(ifc.eq.0)tmsl=0.0d0
95  call mdiffn(jjj,nmum1,im,dlyr)
96  do i=jjj,nmum1
97  do j=1,jpart
98  do k=1,4
99  fio(k,i,j)=fiib(k,i,j)*emdtm(im,i)+
100  1 ftmp(k,i,j)*(1.0d0-emdtm(im,i))
101  enddo
102  enddo
103  enddo
104  write(iwrt,rec=im)fio
105  else
106  read(iwrt,rec=impp)fiib
107  do i=1,nmum1
108  do j=1,jpart
109  do k=1,4
110  fiic(k,i,j)=fio(k,i,j)
111  ftmp(k,i,j)=0.0d0
112  enddo
113  enddo
114  enddo
115  read(iwrt,rec=im)fio
116  tmsl=(dtmm(imp)+dtmm(im))*qsqt*const
117  trsl=(dtrr(imp)+dtrr(im))*conr
118  dlyr=(dtot(imp)+dtot(im))
119  if(ifc.eq.0)tmsl=0.0d0
120  call mdiffn(jjj,nmum1,im,dlyr)
121  do i=jjj,nmum1
122  do j=1,jpart
123  do k=1,4
124  fio(k,i,j)=fiib(k,i,j)*emdtm(imp,i)*emdtm(im,i)+
125  1 ftmp(k,i,j)*(1.0d0-emdtm(imp,i)*emdtm(im,i))
126  enddo
127  enddo
128  enddo
129  write(iwrt,rec=im)fio
130  endif
131  enddo
132 c
133  return
134  end
135 c***********************************************************************
subroutine const(NGAUSS, NMAX, MMAX, P, X, W, AN, ANN, S, SS, NP, EPS)
Definition: ampld.lp.f:924
subroutine multp2d
Definition: multp2d.f:2
subroutine mdiffn(ib, ie, il, dlyr)
Definition: mdiffn.f:2
Definition: RsViirs.h:71