OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
fltocn_diff.f
Go to the documentation of this file.
1  subroutine fltocn_diff
2 c
3 c treat the lower boundary of the atmosphere as flat ocean and
4 c reflect all incident light (diffuse) according to
5 c fresnel law
6 c
7 c***********************************************************************
8 c.....include the common and declaration statemnets.....................
9  implicit real*8 (a-h,o-z)
10 c
11  include 'afrt_rt2.cmn'
12  real*8 zx(4,4),temp(4,2*nsz,nph)
13 c***********************************************************************
14 c write(*,*)'welcome to fltocn'
15  xzx=-1.0d-8
16  xr=1.3340d0
17  xi=0.0d0
18 c
19  do 500 it=1,(nx-1)
20  itp=(nmum1-it)+1
21  cost=cosmu(it)
22  thetac= dacos(cost)
23  sinsq = (1.0d0-cost**2)
24  sinsq2 = sinsq**2
25  a=(xr**2-xi**2-1.0d0+cost**2)
26  b=(-2.0d0*xr*xi)
27  r=dsqrt(a**2+b**2)
28  tmr=cost**2*r
29  xp=dsqrt(2.0d0*r+2.0d0*a)
30  xmm=(2.0d0*r-2.0d0*a)
31  if(xmm .lt. 0.0d0 .and. xmm .gt. xzx) xmm=-xmm
32  xm=dsqrt(xmm)
33  dnmr1=(sinsq2+tmr+cost*sinsq*xp)
34  qrmu=(sinsq2-tmr)/dnmr1
35  qimu=(cost*sinsq*xm)/dnmr1
36  dnmr2=(cost**2+r+cost*xp)
37  rrr=(cost**2-r)/dnmr2
38  rri=(cost*xm)/dnmr2
39  rer=qrmu*rrr-qimu*rri
40  rei=qimu*rrr+qrmu*rri
41  r11=rer**2+rei**2
42  r22=rrr**2+rri**2
43  r33=rer*rrr+rei*rri
44  r34=rri*rer-rei*rrr
45  zx(1,1)=r11
46  zx(2,2)=r22
47  zx(3,3)=r33
48  zx(3,4)=r34
49  zx(4,3)=-r34
50  zx(4,4)=r33
51 c
52 c apply the zx matrix to the incident radiation
53 c solid angle of the incident beam=solid angle of the reflected beam
54  do ip=1,jpart
55  do i=1,4
56  sum2=0.0d0
57  do j=1,4
58  sum2=sum2+zx(i,j)*fio(j,it,ip)
59  enddo
60  temp(i,itp,ip)=sum2
61  enddo
62  enddo
63  500 continue
64 c
65 c tranfer the stokes parameter from the temp buffer to fio
66 c only for the upward direction. also add water-leaving radiances
67 c
68  read(55,rec=nolyr+1)fiib
69  do it=(nx-1)+1,nmum1
70  do ip=1,jpart
71  do i=1,4
72  fio(i,it,ip)=temp(i,it,ip)+fiib(i,it,ip)
73  enddo
74  enddo
75  enddo
76 c
77 c write(6,*)'Upwelling radiances just above ocn surface'
78 c do i=nx,nmum1
79 c call radnce(pi,conv,cosmu,the,fio,i,jpart,jphi)
80 c enddo
81 
82 c
83  return
84  end
85 c***********************************************************************
#define real
Definition: DbAlgOcean.cpp:26
subroutine fltocn_diff
Definition: fltocn_diff.f:2
Definition: RsViirs.h:71