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 'common_all.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 nolyrp in the
28 c buffer ftmpa
29 c
30 c write(6,*)'begin the upwrad loop'
31  read(55,rec=nolyrp)fiib
32  read(55,rec=nolyrp)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=jjj,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(jjj,nmum1,im,dlyr)
51 c
52  do i=jjj,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=jjj,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 c
74  enddo
75 c
76 c
77 c compute the downward radiation
78 c
79  read(55,rec=1)fiib
80  do il=1,nolyr
81  ilp=il+1
82  read(55,rec=ilp)fio
83 c
84  tmsl=dtmm(il)*qsqt*const
85  trsl=dtrr(il)*conr
86  dlyr=dtot(il)
87 c
88  do i=1,jjjj
89  do j=1,jpart
90  do k=1,4
91  fiic(k,i,j)=ftmpa(k,i,j)*emtm(il,i)
92  enddo
93  enddo
94  enddo
95 c
96  call mdiffn(1,jjjj,il,dlyr)
97 c
98  do i=1,jjjj
99  do j=1,jpart
100  do k=1,4
101  fio(k,i,j)=fiib(k,i,j)*emdtm(il,i)+
102  1 ftmp(k,i,j)*(1.0d0-emdtm(il,i))
103  enddo
104  enddo
105  enddo
106 c
107 c transfer the values from fio to fiib
108 c
109  do i=1,jjjj
110  do j=1,jpart
111  do k=1,4
112  fiib(k,i,j)=fio(k,i,j)
113  enddo
114  enddo
115  enddo
116 c
117  write(55,rec=ilp)fio
118  enddo
119 c
120 c if iref=0 then copy all records to unit 64 for multiple scattering
121 c calculations
122 c
123  if(iref.eq.0 .or. itrans .eq.1)then
124  do il=1,nolyrp
125  read(55,rec=il)ftmp
126  write(64,rec=il)ftmp
127  enddo
128  eo(1)=0.0d0
129  eo(2)=0.0d0
130 c
131  endif
132  return
133  end
134 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