OB.DAAC Logo
NASA Logo
Ocean Color Science Software

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