OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
airmass_avhrr.f
Go to the documentation of this file.
1 C
2 C@***s* PROJECT_PFSST/l2gen_both/airmass_avhrr.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 airmass_avhrr.f
25 C
26 C LOCATION
27 C $OCSSWROOT
28 C
29 C PURPOSE
30 C Calculate atmospheric pathlength from viewing geometry.
31 C
32 C DESCRIPTION
33 C The subroutine airmass_avhrr calculates the airmass from sun to ground
34 C using Kasten's formula.
35 C NOTE: All angles must be in radians.
36 C
37 C NOAA PFSST-SEADAS BUILD VERSION
38 C Pathfinder SST V5.2 code built with SEADAS version 6.3 64 bit l2gen_both for
39 C CDR processed at University of Miami/RSMAS.
40 C
41 C PRIMARY SEADAS CODE DOCUMENTATION NASA
42 C For complete documentation of multi sensor SEADAS code see
43 C http://seadas.gsfc.nasa.gov/doc/l2gen/l2gen.html
44 C
45 C AUTHOR
46 C
47 C
48 C PFSST project embedded code
49 C Susan Walsh
50 C University of Miami/RSMAS
51 C
52 C CREATION DATE
53 C 2010
54 C
55 C COPYRIGHT
56 C THIS SOFTWARE AND ITS DOCUMENTATION ARE CONSIDERED TO BE IN THE PUBLIC DOMAIN AND
57 C THUS ARE AVAILABLE FOR UNRESTRICTED PUBLIC USE. THEY ARE FURNISHED "AS IS." THE
58 C AUTHORS, THE UNITED STATES GOVERNMENT, ITS INSTRUMENTALITIES, OFFICERS, EMPLOYEES,
59 C AND AGENTS MAKE NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE USEFULNESS OF THE
60 C SOFTWARE AND DOCUMENTATION FOR ANY PURPOSE. THEY ASSUME NO RESPONSIBILITY (1) FOR
61 C THE USE OF THE SOFTWARE AND DOCUMENTATION; OR (2) TO PROVIDE TECHNICAL SUPPORT
62 C TO USERS.
63 C
64 C MODIFICATION HISTORY
65 C
66 C See CVS revision control history embedded in actual file.
67 C
68 C
69 C INPUTS
70 C X5(real) - Angle PHI (solar zenith angle)
71 C
72 C
73 C OUTPUTS
74 C X7(real) - Air mass
75 C
76 C
77 C
78 C LANGUAGE
79 C Fortran
80 C
81 C@*****
82 c !F90
83 c
84 c
85 c subroutine AIRMASS_AVHRR(X5,X7)
86 c !Description:
87 c The subroutine airmass_avhrr calculates the airmass from sun to ground
88 c using Kasten's formula.
89 c NOTE: All angles must be in radians.
90 c !Input Parameters:
91 c X5(real) - Angle PHI (solar zenith angle)
92 c !Output Parameters:
93 c X7(real) - Air mass
94 c
95 c $Id: airmass_avhrr.f,v 1.4 2012/05/07 20:10:09 sue Exp $
96 c
97 c $Log: airmass_avhrr.f,v $
98 c Revision 1.4 2012/05/07 20:10:09 sue
99 c Add or modify the PFSST headers.
100 c
101 c Revision 1.3 2012/04/26 18:55:31 sue
102 c Changes made by seadas group for seadas6.3, newer fortran, and/or 64 bit mode.
103 c
104 c Revision 1.2 2011/10/17 15:52:36 kay
105 c Added NOAA headers
106 c
107 c Revision 1.1 2010/08/07 18:44:27 sue
108 c seadas 6.1 l2gen with modis dust and avhrr.
109 c
110 c Revision 1.1 2008/08/15 20:30:20 sue
111 c NODC versions of the pathfinder processing programs.
112 c
113 c Revision 1.1 2008/01/22 20:17:47 sue
114 c Initial version of pathnlch which reads the aci hdf data and geolocation files
115 c and creates hdf files. This version was made just to test the aci hdf files.
116 c
117 c Revision 1.3 2002/08/23 17:42:08 sue
118 c Update copyright notices to year 2002.
119 c
120 c Revision 1.2 2000/06/14 16:08:46 jim
121 c Rearrange code to eliminate divide by zero. Simplify logic. Add comments.
122 c
123 c Revision 1.1 2000/03/07 22:58:53 jim
124 c Routine to compute airmass for zenith angles near 90 degrees.
125 c
126 c
127 
128 c !Team-Unique Header:
129 C
130 C Copyright 1988-2002 by Rosenstiel School of Marine and Atmospheric Science,
131 C University of Miami, Miami, Florida.
132 C
133 C All Rights Reserved
134 C
135 C Permission to use, copy, modify, and distribute this software and its
136 C documentation for non-commercial purposes and without fee is hereby granted,
137 C provided that the above copyright notice appear in all copies and that both
138 C that copyright notice and this permission notice appear in supporting
139 C documentation, and that the names of University of Miami and/or RSMAS not be
140 C used in advertising or publicity pertaining to distribution of the software
141 C without specific, written prior permission.
142 C
143 C UNIVERSITY OF MIAMI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
144 C INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
145 C SHALL UNIVERSITY OF MIAMI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
146 C DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
147 C WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
148 C OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
149 c
150 c !References and Credits:
151 c Written by:
152 c University of Miami
153 c Rosensteil School for Marine and Atmospheric Science
154 c Division of Meteorology and Physical Oceanography
155 c 4600 Rickenbacker Cswy
156 c Miami,Fl
157 c 33149
158 C contact:SWalsh@rsmas.miami.edu
159 c
160 c !Design Notes:
161 c
162 c !END########################################################
163 
164  SUBROUTINE airmass_avhrr(X5,X7)
165 C
166 C X5 IS THE SOLAR ZENITH ANGLE
167 C X7 IS THE AIR MASS CORRECTED FOR ATMOSPHERIC REFRACTION
168 C USING KASTEN'S FORMULA
169 C
170 C ALL ANGLES MUST BE IN RADIANS
171 C
172  real X5, X7
173  real CT, ST, S, Z, R4, R5, P1, P2
174  real ANG, RAD, xx
175  integer IU
176 
177  real A1, A2, A3
178  data a1, a2, a3/-.001867,-.002875,-.0008083/
179  save a1, a2, a3
180 
181  ang(xx) = xx*180./3.14159265
182  rad(xx) = xx*3.14159265/180.
183 
184 C
185 C IS APPARENT SUN BELOW THE HORIZON?
186 C
187 C IF IT IS, SET AIRMASS TO ZERO AS A FLAG.
188 C
189  IF (ang(x5).GT.90.57) THEN
190  x7 = 0.
191  GO TO 1
192  END IF
193 C
194  ct = cos(x5)
195 C ST = SIN(X5)
196 C IF (ANG(X5).GT.90.57) GO TO 1
197  IF (ct.LT.1./3.86) GO TO 2
198 C
199 C AWAY FROM HORIZON
200 C
201  s = 1./ct
202 C IF (S.GT.3.86 .OR. S.LT.0.) GO TO 2
203  st = s-1.
204  x7 = s+a1*st+a2*st**2+a3*st**3
205  GO TO 1
206 C
207 C VERY CLOSE TO HORIZON
208 C
209 2 CONTINUE
210  r4 = 0.
211  z = ang(x5)
212  DO 3 iu=1,4
213  p1 = z-r4
214  p2 = -116.94+4.41925*p1-.056623*p1*p1+.00024364*p1*p1*p1
215  r4 = 10.**p2
216 3 CONTINUE
217  r4 = z-r4
218  r5 = cos(rad(r4))+.15*(90-r4+3.885)**(-1.253)
219  x7 = 1./r5
220 1 CONTINUE
221  RETURN
222  END
subroutine airmass_avhrr(X5, X7)