OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
raygetpol.f
Go to the documentation of this file.
1 C
2 C@***s* PROJECT_PFSST/l2gen_both/raygetpol.f
3 C
4 C This header contains documentation required by the NOAA Climate Data Record
5 C Program (CDRP), which is managed at the NOAA National Climatic Data Center (NCDC).
6 C Only the code that applies to AVHRR SST data is documented in this header.
7 C
8 C The AVHRR Pathfinder Sea Surface Temperature (PFSST) processing code was originally
9 C developed at the University of Miami. In 2010, the code was integrated into
10 C the multi-sensor SeaWiFS Data Analysis System (SeaDAS) obtained from NASA GSFC.
11 C SeaDAS was used for processing the PFSST beginning with the Pathfinder Version
12 C 5.2 (PFV5.2) dataset, produced jointly by the University of Miami and the NOAA
13 C National Oceanographic Data Center (NODC). These data are provided to the
14 C public and archived at NODC, and have been transitioned along with the production
15 C code and documentation to the CDRP at NCDC.
16 C
17 C This NOAA required header is specifically written for Pathfinder SST and may
18 C not be relevant to other sensors or products processed by SeaDAS. Please
19 C review the SEADAS software distribution policy for public domain software
20 C located at http://seadas.gsfc.nasa.gov/copying.html for more information and
21 C documentation
22 C
23 C NAME
24 C raygetpol.f
25 C
26 C LOCATION
27 C $OCSSWROOT
28 C
29 C
30 C PURPOSE
31 C get coefficients needed to compute Rayleigh radiance
32 C
33 C DESCRIPTION
34 C
35 C The subroutine RAYGET called by l2gen_both obtains the azimuthal coefficients for Rayleigh
36 C radiance calculations. The coefficients are also obtained for various
37 C solar and satellite zenith angles. The coefficients obtained by this
38 C routine are used in computing calibrated radiance for AVHRR channels 1 and 2.
39 C
40 C NOAA PFSST-SEADAS BUILD VERSION
41 C Pathfinder SST V5.2 code built with SEADAS version 6.3 64 bit l2gen_both for
42 C CDR processed at University of Miami/RSMAS
43 C
44 C PRIMARY SEADAS CODE DOCUMENTATION NASA
45 C For complete documentation of multi sensor SEADAS code see
46 C http://seadas.gsfc.nasa.gov/seadas/doc/toplevel/sds_program.html
47 C http://seadas.gsfc.nasa.gov/seadas/doc/l2gen/l2gen.html
48 C
49 C AUTHOR
50 C
51 C
52 C PFSST project embedded code
53 C Susan Walsh
54 C University of Miami/RSMAS
55 C
56 C CREATION DATE
57 C 2010
58 C
59 C COPYRIGHT
60 C THIS SOFTWARE AND ITS DOCUMENTATION ARE CONSIDERED TO BE IN THE PUBLIC DOMAIN AND
61 C THUS ARE AVAILABLE FOR UNRESTRICTED PUBLIC USE. THEY ARE FURNISHED "AS IS." THE
62 C AUTHORS, THE UNITED STATES GOVERNMENT, ITS INSTRUMENTALITIES, OFFICERS, EMPLOYEES,
63 C AND AGENTS MAKE NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE USEFULNESS OF THE
64 C SOFTWARE AND DOCUMENTATION FOR ANY PURPOSE. THEY ASSUME NO RESPONSIBILITY (1) FOR
65 C THE USE OF THE SOFTWARE AND DOCUMENTATION; OR (2) TO PROVIDE TECHNICAL SUPPORT
66 C TO USERS.
67 C
68 C MODIFICATION HISTORY
69 C
70 C See CVS revision control history embedded in actual file.
71 C
72 C LANGUAGE
73 C Fortran
74 C
75 C*****
76 C##############################################################
77 C
78 C !F90
79 C
80 C !Description:
81 C The subroutine RAYGET obtains the azimuthal coefficients for Rayleigh
82 C radiance calculations. The coefficients are also obtained for various
83 C solar and satellite zenith angles. The coefficients obtained by this
84 C routine are for avhrr channels 1 and 2.
85 C
86 C !Subroutines and Functions:
87 C subroutine RAYGET(LUN,THETA,THETA0,PHI0,PHI1,PHI2,TAU,ISFLAG)
88 C !Input Parameters:
89 C LUN(integer) - logical unit for file access
90 C !Output Parameters:
91 C THETA(real array, size M_M) - Viewing angles
92 C THETA0(real array, size N_N) - Sun angles
93 C PHI0(real array, size M_M,N_N,C_H) - Azimuthal function
94 C PHI1(real array, size M_M,N_N,C_H) - Azimuthal function
95 C PHI2(real array, size M_M,N_N,C_H) - Azimuthal function
96 C TAU(real array, size N_N,C_H) - Rayleigh optical depth
97 C ISFLAG(integer array, size C_H) - channel present flag
98 C
99 C !Revision History:
100 C !Team_Unique Header:
101 C
102 C Copyright 1988-1998 by Rosenstiel School of Marine and Atmospheric Science,
103 C University of Miami, Miami, Florida.
104 C
105 C All Rights Reserved
106 C
107 C Permission to use, copy, modify, and distribute this software and its
108 C documentation for non-commercial purposes and without fee is hereby granted,
109 C provided that the above copyright notice appear in all copies and that both
110 C that copyright notice and this permission notice appear in supporting
111 C documentation, and that the names of University of Miami and/or RSMAS not be
112 C used in advertising or publicity pertaining to distribution of the software
113 C without specific, written prior permission.
114 C
115 C UNIVERSITY OF MIAMI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
116 C INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
117 C SHALL UNIVERSITY OF MIAMI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
118 C DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
119 C WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
120 C OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
121 C
122 C !References and Credits:
123 C Written by:
124 C University of Miami
125 C Rosensteil School for Marine and Atmospheric Sciences
126 C Division of Meteorology and Oceanography
127 C 4600 Rickenbacker Cswy
128 C Miami,Fl
129 C 33149
130 C Contact: SWalsh@rsmas.miami.edu
131 C
132 C !Design Notes:
133 C
134 C !End##############################################################
135 
136  subroutine rayget(lun,theta,theta0,phi0,phi1,phi2,tau,isflag)
137  implicit none
138 
139 
140 C
141  integer, parameter :: N_AMSIZ = 384
142 
143 C Read Rayleigh multiple scattering polarization data
144 
145  integer, parameter :: M_M = 41
146  integer, parameter :: N_N = 45
147  integer, parameter :: C_H = 2
148 
149  integer*4 lenstr;
150  integer*4 lun
151  real*4 theta(m_m) ! Viewing angles
152  real*4 theta0(n_n) ! Sun angles
153  real*4 phi0(m_m,n_n,c_h) ! Azimuthal function
154  real*4 phi1(m_m,n_n,c_h) !
155  real*4 phi2(m_m,n_n,c_h) !
156  real*4 tau(n_n,c_h) ! Rayleigh optical depth
157  integer*4 isflag(c_h) ! Channel present flag
158 
159  character*(80) msgbuf
160  character caldir*255
161  character*(n_amsiz) filenm
162  character*7 files(c_h)
163  integer*4 i, j, k
164 
165  integer*4 ii, jj
166  integer*4 flen
167 
168 10 format(//(1x,5f13.0))
169 20 format(//(1x,2f13.0))
170 
171 C call mergec (files(1), "/avhch1"//char(0))
172 C call mergec (files(2), "/avhch2"//char(0))
173  files(1) = '/avhch1';
174  files(2) = '/avhch2';
175 
176  call getenv('OCDATAROOT', caldir)
177  flen = lenstr(caldir)
178  if (flen .eq. 0) then
179  write(*,*)
180  & '-E- RAYGETPOL: Environment variable OCDATAROOT undefined'
181  call exit(1)
182  end if
183 
184  do k=1,c_h
185 
186 C call mergec (filenm, caldir)
187 C call append (filenm, files(k))
188 
189 C call append (filenm, "pol.new"//char(0)) ! zero interpolated data
190 
191  filenm = caldir(1:flen)//'/avhrr/cal'//files(k)(1:7)//'pol.new'
192  write(*,*) 'Loading '//filenm(1:lenstr(filenm))
193  open(unit=lun,file=filenm,status='old',form='formatted',
194  & iostat=isflag(k))
195  if (isflag(k) .eq. 0) then
196  read(lun,10) theta
197  do i=1,n_n
198 
199  read(lun,20) theta0(i),tau(i,k)
200  read(lun,10) (phi0(j,i,k),j=1,m_m)
201 
202 C# note: .new files have 0's for theta0 == 0
203  read(lun,10) (phi1(j,i,k),j=1,m_m)
204  read(lun,10) (phi2(j,i,k),j=1,m_m)
205  end do
206 
207  close(unit=lun)
208  cycle ! found data for this channel
209  end if
210 
211  write(*,*)
212  & '-E- RAYGETPOL: No data found for ', filenm
213  call exit(1)
214  end do
215 
216  end
#define real
Definition: DbAlgOcean.cpp:26
subroutine rayget(lun, theta, theta0, phi0, phi1, phi2, tau, isflag)
Definition: raygetpol.f:137