OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
readctl.f
Go to the documentation of this file.
1  subroutine readctl(navctl,ierr)
2 c
3 c readctl(navctl,ierr)
4 c
5 c purpose: read in the navigation processing control parameters
6 c
7 c calling arguments:
8 c
9 c name Type i/o description
10 c -------- ---- --- -----------
11 c navctl struct o navigation processing control structure
12 c ierr i*4 o return code, 0 is good
13 c
14 c by: w. robinson, gsc, 22 mar 93
15 c
16 c notes:
17 c
18 c modification history:
19 c
20  implicit none
21 c
22 #include "navctl_s.fin"
23 c
24  type(navctl_struct) :: navctl
25  integer*4 iret, istat, i, j, k, ierr
26  character*256 line,filnm
27 c
28 c
29 c start, open the file of nav control parameters
30 c
31  ierr = -1
32  filnm = '$NAVCTL/navctl.dat'
33  call filenv(filnm,filnm)
34  open(file=filnm,unit=7,status='old',iostat=istat)
35  if( istat .ne. 0 )then
36  ierr = -1
37  write(6,100)
38  100 format(' READCTL: unable to open the file navctl.dat')
39  else
40 c
41 c read in attitude processing flag
42 c
43  call inline( 7, '!', line, iret )
44  if( iret .ne. 0 ) go to 990
45  read(line,300,err=990)navctl%procatt
46 c
47  call inline( 7, '!', line, iret )
48  if( iret .ne. 0 ) go to 990
49  read(line,300,err=990)navctl%redoyaw
50 c
51  call inline( 7, '!', line, iret )
52  if( iret .ne. 0 ) go to 990
53  read(line,200,err=990)navctl%yawtol
54 c
55  call inline( 7, '!', line, iret )
56  if( iret .ne. 0 ) go to 990
57  read(line,300,err=990)navctl%nefpts
58 c
59  call inline( 7, '!', line, iret )
60  if( iret .ne. 0 ) go to 990
61  read(line,300,err=990)navctl%neskip
62 c
63  call inline( 7, '!', line, iret )
64  if( iret .ne. 0 ) go to 990
65  read(line,300,err=990)navctl%nsfpts
66 c
67  call inline( 7, '!', line, iret )
68  if( iret .ne. 0 ) go to 990
69  read(line,300,err=990)navctl%nsskip
70 c
71  do i = 1,3
72  do j = 1,3
73  call inline( 7, '!', line, iret )
74  if( iret .ne. 0 ) go to 990
75  read(line,200,err=990)navctl%msenoff(j,i)
76  end do
77  end do
78 c
79  do i = 1,3
80  call inline( 7, '!', line, iret )
81  if( iret .ne. 0 ) go to 990
82  read(line,200,err=990)navctl%tiltcos(i)
83  end do
84 c
85  do i = 1,3
86  call inline( 7, '!', line, iret )
87  if( iret .ne. 0 ) go to 990
88  read(line,200,err=990)navctl%tiltcos2(i)
89  end do
90 c
91  call inline( 7, '!', line, iret )
92  if( iret .ne. 0 ) go to 990
93  read(line,200,err=990)navctl%tiltfor
94 c
95  call inline( 7, '!', line, iret )
96  if( iret .ne. 0 ) go to 990
97  read(line,200,err=990)navctl%tiltaft
98 c
99  do i = 1,3
100  do j = 1,3
101  do k = 1,3
102  call inline( 7, '!', line, iret )
103  if( iret .ne. 0 ) go to 990
104  read(line,200,err=990)navctl%sun_mat(k,j,i)
105  end do
106  end do
107  end do
108 c
109  do i = 1,3
110  do j = 1,2
111  call inline( 7, '!', line, iret )
112  if( iret .ne. 0 ) go to 990
113  read(line,200,err=990)navctl%sun_scal(j,i)
114  end do
115  end do
116 c
117  do i = 1,3
118  do j = 1,2
119  call inline( 7, '!', line, iret )
120  if( iret .ne. 0 ) go to 990
121  read(line,200,err=990)navctl%sun_bias(j,i)
122  end do
123  end do
124 c
125  do i = 1,2
126  do j = 1,3
127  do k = 1,3
128  call inline( 7, '!', line, iret )
129  if( iret .ne. 0 ) go to 990
130  read(line,200,err=990)navctl%ear_mat(k,j,i)
131  end do
132  end do
133  end do
134 c
135  call inline( 7, '!', line, iret )
136  if( iret .ne. 0 ) go to 990
137  read(line,200,err=990)navctl%ear1sca
138 c
139  call inline( 7, '!', line, iret )
140  if( iret .ne. 0 ) go to 990
141  read(line,200,err=990)navctl%ear2sca
142 c
143  call inline( 7, '!', line, iret )
144  if( iret .ne. 0 ) go to 990
145  read(line,200,err=990)navctl%e1biasic
146 c
147  call inline( 7, '!', line, iret )
148  if( iret .ne. 0 ) go to 990
149  read(line,200,err=990)navctl%e2biasic
150 c
151  call inline( 7, '!', line, iret )
152  if( iret .ne. 0 ) go to 990
153  read(line,200,err=990)navctl%e1biasoc
154 c
155  call inline( 7, '!', line, iret )
156  if( iret .ne. 0 ) go to 990
157  read(line,200,err=990)navctl%e2biasoc
158 c
159  call inline( 7, '!', line, iret )
160  if( iret .ne. 0 ) go to 990
161  read(line,300,err=990)navctl%lvdbug
162 c
163 c close the file
164 c
165  ierr = 0
166  990 continue
167  close(unit=7)
168 c
169  if( ierr .ne. 0 ) write(6,400)
170  400 format(' READCTL: not all nav parameters provided.')
171  end if
172 c
173 c and end
174 c
175  return
176  200 format(f12.4)
177  300 format(i12)
178  end
int navigation(int32_t fileID)
Definition: l1_octs_hdf.c:696
===========================================================================V4.1.3 12/18/2002============================================================================Changes which do not affect scientific output:1. The R *LUT was eliminated and the equivalent formulation for R *, i.e. 1/(m1 *e_sun_over_pi), was substituted for it in the only instance of its use, which is in the calculation of the RSB uncertainty index. This reduces the size of the Reflective LUT HDF file by approximately 1/4 to 1/3. The equivalent formulation of R *differed from the new by at most 0.056% in test granules and uncertainty differences of at most 1 count(out of a range of 0-15) were found in no more than 1 in 100, 000 pixels. 2. In Preprocess.c, a small error where the trailing dropped scan counter was incremented when the leading dropped scan counter should have been was fixed. This counter is internal only and is not yet used for any purpose. 3. NEW MYD02OBC Metadata Configuration Files. MCST wishes to have the OBC files archived even when the Orbit Number is recorded as "-1". Accordingly, ECS has delivered new MCF files for OBC output having all elements in the OrbitCalculatedSpatialDomain container set to "MANDATORY=FALSE". 4. pgs_in.version is now reset to "1" in Metadata.c before the call to look up the geolocation gringpoint information.============================================================================V4.1.1 CODE SPECIFIC TO MODIS/AQUA(FM1) 10/03/2002============================================================================Two changes were made to the code which do not affect scientific output:1. A bug which caused PGE02 to fail when scans were dropped between granules was fixed.(The length of the error message generated was shortened.) 2. Messages regarding an invalid MCST LUT Version or an invalid Write High Resolution Night Mode Output value in the PCF file were added.==============================================================================V4.1.0 CODE SPECIFIC TO MODIS/AQUA(FM1)(NEVER USED IN PRODUCTION) 07/30/2002==============================================================================Changes which impact scientific output of code:1. The LUT type of the RVS corrections was changed to piecewise linear. In addition the RVS LUTs were changed from listing the RVS corrections to listing the quadratic coefficients necessary to make the RVS corrections. The coefficients are now calculated by interpolating on the granule collection time and the RVS corrections are then generated using the interpolated coefficients. Previously used Emissive and Reflective RVS LUT tables were eliminated and new ones introduced. Several changes were made to the code which should not affect scientific output. They are:1. The ADC correction algorithm and related LUTs were stripped from the code.(The ADC correction has always been set to "0" so this has no scientific impact.) 2. Some small changes to the code, chiefly to casting of variables, were added to make it LINUX-compatible. Output of code run on LINUX machines displays differences of at most 1 scaled integer(SI) from output of code run on IRIX machines. The data type of the LUT "dn_sat_ev" was changed to float64 to avoid discrepancies seen between MOD_PR02 run on LINUX systems and IRIX systems where values were flagged under one operating system but not the other. 3. Checking for non-functioning detectors, sector rotation, incalculable values of the Emissive calibration factor "b1", and incalculable values of SV or BB averages was moved outside the loop over frames in Emissive_Cal.c since none of these quantities are frame-dependent. 4. The code was altered so that if up to five scans are dropped between the leading/middle or middle/trailing granules, the leading or trailing granule will still be used in emissive calibration to form a cross-granule average. QA bits 25 and 26 are set for a gap between the leading/middle and middle/trailing granules respectively. This may in rare instances lead to a change in emissive calibration coefficients for scans at the beginning or end of a granule. 5.(MODIS/AQUA ONLY) The name of the seed(error message) file was changed from "MODIS_36100.h" to "MODIS_36110.h". 6. Metadata.c was changed so that the source of the geolocation metadata is the input geolocation file rather than the L1A granule. 7. To reduce to overall size of the reflective LUT HDF files, fill values were eliminated from all LUTs previously dimensioned "BDSM"([NUM_REFLECTIVE_BANDS] *[MAX_DETECTORS_PER_BAND] *[MAX_SAMPLES_PER_BAND] *[NUM_MIRROR_SIDES]) in the LUT HDF files. Each table piece is stored in the HDF file with dimensions NUM_REFLECTIVE_INDICES, where NUM_REFLECTIVE_INDICES=[NUM_250M_BANDS *DETECTORS_PER_250M_BAND *SAMPLES_PER_250M_BAND *NUM_MIRROR_SIDES]+[NUM_500M_BANDS *DETECTORS_PER_500M_BAND *SAMPLES_PER_500M_BAND *NUM_MIRROR_SIDES]+[NUM_1000M_BANDS *DETECTORS_PER_1KM_BAND *SAMPLES_PER_1KM_BAND *NUM_MIRROR_SIDES] with SAMPLES_PER_250M_BAND=4, SAMPLES_PER_500M_BAND=2, and SAMPLES_PER_1KM_BAND=1. Values within each table piece appear in the order listed above. The overall dimensions of time dependent BDSM LUTs are now[NUM_TIMES] *[NUM_REFLECTIVE_INDICES], where NUM_TIMES is the number of time dependent table pieces. 8. Checking for non-functioning detectors, sector rotation, incalculable values of the Emissive calibration factor "b1", and incalculable values of SV or BB averages was moved outside the loop over frames in Emissive_Cal.c since none of these quantities are frame-dependent. 9. The code was altered so that if up to five scans are dropped between the leading/middle or middle/trailing granules, the leading or trailing granule will still be used in emissive calibration to form a cross-granule average. QA bits 25 and 26 are set for a gap between the leading/middle and middle/trailing granules respectively. This may in rare instances lead to a change in emissive calibration coefficients for scans at the beginning or end of a granule. 10. The array of b1s in Preprocess.c was being initialized to -1 outside the loop over bands, which meant that if b1 could not be computed, the value of b1 from the previous band for that scan/detector combination was used. The initialization was moved inside the band loop.============================================================================V3.1.0(Original Aqua-specific code version) 02/06/2002============================================================================AQUA-Specific changes made:1. A correction to a problem with blackbody warmup on bands 33, 35, and 36 was inserted. PC Bands 33, 35, and 36 on MODIS Aqua saturate on BB warmup before 310K, which means current code will not provide correct b1 calibration coefficients when the BB temperatures are above the saturation threshold. A LUT with default b1s and band-dependent temperature thresholds will be inserted in code. If the BB temperature is over the saturation threshold for the band, the default b1 from the table is used. 2. The number of possible wavelengths in the Emissive LUT RSR file was changed to 67 in order to accommodate the Aqua RSR tables. 3. Several changes to the upper and lower bound limits on LUT values were inserted. Changes to both Aqua and Terra Code:1. A check was put into Emissive_Cal.c to see whether the value of b1 being used to calibrate a pixel is negative. If so, the pixel is flagged with the newly created flag TEB_B1_NOT_CALCULATED, value 65526, and the number of pixels for which this occurs is counted in the QA_common table. 2. The array of b1s in Preprocess.c was being initialized to -1 outside the loop over bands, which meant that if b1 could not be computed, the value of b1 from the previous band for that scan/detector combination was used. The initialization was moved inside the band loop. 3. Minor code changes were made to eliminate compiler warnings when the code is compiled in 64-bit mode. 4. Temperature equations were upgraded to be MODIS/Aqua or MODIS/Terra specific and temperature conversion coefficients for Aqua were inserted.========================================================================================================================================================ALL CHANGES BELOW ARE TO COMMON TERRA/AQUA CODE USED BEFORE 02/06/2002========================================================================================================================================================v3.0.1 11/26/2001============================================================================Several small changes to the code were made, none of which changes the scientific output:1. The code was changed so that production of 250m and 500m resolution data when all scans of a granule are in night mode may be turned off/on through the PCF file. 2. A check on the times of the leading and trailing granules was inserted. If a leading or trailing granule does not immediately precede or follow(respectively) the middle granule, it is treated as a missing granule and a warning message is printed. 3. The code now reads the "MCST Version Number"(e.g. "3.0.1.0_Terra") from the PCF file and checks it against the MCST Version number contained in the LUT HDF files. This was done to allow the user to make sure the code is being run using the correct LUT files.(The designators "0_Terra", "1_Terra", etc.) refer to the LUT versions.) 4. A small bug in Preprocess.c was corrected code
Definition: HISTORY.txt:661
subroutine readctl(navctl, ierr)
Definition: readctl.f:2
subroutine filenv(infil, outfil)
Definition: filenv.f:2
===========================================================================V5.0.48(Terra) 03/20/2015 Changes shown below are differences from MOD_PR02 V5.0.46(Terra)============================================================================Changes noted for V6.1.20(Terra) below were also instituted for this version.============================================================================V6.1.20(Terra) 03/12/2015 Changes shown below are differences from MOD_PR02 V6.1.18(Terra)============================================================================Changes from v6.1.18 which may affect scientific output:A situation can occur in which a scan which contains sector rotated data has a telemetry value indicating the completeness of the sector rotation. This issue is caused by the timing of the instrument command to perform the sector rotation and the recording of the telemetry point that reports the status of sector rotation. In this case a scan is considered valid by L1B and pass through the calibration - reporting extremely high radiances. Operationally the TEB calibration uses a 40 scan average coefficient, so the 20 scans(one mirror side) after the sector rotation are contaminated with anomalously high radiance values. A similar timing issue appeared before the sector rotation was fixed in V6.1.2. Our analysis indicates the ‘SET_FR_ENC_DELTA’ telemetry correlates well with the sector rotation encoder position. The use of this telemetry point to determine scans that are sector rotated should fix the anomaly occured before and after the sector rotation(usually due to the lunar roll maneuver). The fix related to the sector rotation in V6.1.2 is removed in this version.============================================================================V6.1.18(Terra) 10/01/2014 Changes shown below are differences from MOD_PR02 V6.1.16(Terra)============================================================================Added doi attributes to NRT(Near-Real-Time) product.============================================================================V6.1.16(Terra) 01/27/2014 Changes shown below are differences from MOD_PR02 V6.1.14(Terra)============================================================================Migrate to SDP Toolkit 5.2.17============================================================================V6.1.14(Terra) 06/26/2012 Changes shown below are differences from MOD_PR02 V6.1.12(Terra)============================================================================Added the doi metadata to L1B product============================================================================V6.1.12(Terra) 04/25/2011 Changes shown below are differences from MOD_PR02 V6.1.8(Terra)============================================================================1. The algorithm to calculate uncertainties for reflective solar bands(RSB) is updated. The current uncertainty in L1B code includes 9 terms from prelaunch analysis. The new algorithm regroups them with the new added contributions into 5 terms:u1:the common term(AOI and time independent) and
Definition: HISTORY.txt:126
subroutine inline(lun, icomm, line, iret)
Definition: inline.f:2