This section lists alphabetically all of the subroutines and functions beginning with the symbol _ and the letters A-H contained in the MODIS ocean color processing codes. A brief description and the location of each subroutine is also given. For subroutines and functions beginning with the letters I-Z, please see Table 8b: Subroutines and Functions (I-Z).
NOTE : Subroutines which have the same name as the file they are contained within (such as the subroutine fresnel in the file fresnel.f90) are not listed here. A description of them can be found in Table 7a : Processing Files (A-L) and Table 7b : Processing Files (M-Z).
_ | A | B | C | D | E | F | G | H | I - Z
| Subroutine/Function | Location | Description |
|---|---|---|
| _ClearNodes | get.c | Clearing the "seen" flag of tree. |
| _CutDownTree | cuttree.c | Release all dynamic storage. |
| _Dsp_GetRawCommandLine | get.c | Parse a command line and fill-in user structure. |
| _Dsp_Init | dsplib.c | Initialize display access, register as a display task. Save the value of sys$input, sys$output and sys$error. |
| A | ||
| a_to_f | atof.c | Convert a string to a number. |
| angle_indices | wang3.f | This subroutine computes two indices. |
| anlycli | hdf-io1.f90 | Close level-1a input file for ANLY type program. |
| anlyclo | hdf-io1.f90 | Close level-2 output file for ANLY type program. |
| anlyopi | hdf-io1.f90 | Open level-1a input file for ANLY type program and calculates offsets to each band. |
| anlyopo | hdf-io1.f90 | Open level-2 output file for ANLY type program and calculates offset to first byte for each data and QC band. |
| anlyrdi | hdf-io1.f90 | Read record from level-1a input file for ANLY type program and returns the raw digital counts and calibrated level-1a data for the requested scan line. |
| anlyupo | hdf-io1.f90 | Update the fluor products in a record in the level-2 DR1 output file. |
| anlywc | hdf-io1.f90 | Write calibration for specified band to output file. |
| anlywto | hdf-io1.f90 | Write a record to the level-2 output file and qc file. |
| aph | modis_chl.1.c | Returns a_phi at a given waveband as a function of aph675. |
| argdfb | arg.c | Set default value of an argument as a byte. |
| argdfi | arg.c | Set default value of an argument as an integer. |
| argdfl | arg.c | Set default value of an argument as a logical. |
| argdfr | arg.c | Set default value for an argument as a real number. |
| argdfs | arg.c | Set default string of an argument. |
| argkey | arg.c | Set keyword name of a command line argument. |
| arglev | arg.c | Set level of a command line argument. |
| argmax | arg.c | Set maximum value allowed for an argument. |
| argmin | arg.c | Set minimum value allowed for an argument. |
| argpos | arg.c | Set position of a command line argument. |
| argret | arg.c | Set return flag for an argument. |
| argrvl | arg.c | Set return value for an argument. |
| argtyp | arg.c | Set type of argument. |
| avcons | avhrrsub5.f90 | The constant initializer for the subroutine AVLOOP. The subroutine AVCON begins by obtaining ozone optical thickness with a call to getozone. Clear water radiance values and the solar constant are then corrected for time of year. The subroutine rayget is then called to obtain the Rayleigh optical thickness, tau. The subroutine AVCONS then converts epsilon values to an internal form. |
| avhrrsub5 | avhrrsub5.f90 | Wrapper for the subroutines AVCONS, AVINIT, and AVLOOP, for persistent storage. This routine is never called directly. |
| avinit | avhrrsub5.f90 | Initialize subroutine for looping in anly module. |
| avloop | avhrrsub5.f90 | Calculates and collects coefficients and parameters need for the atmospheric correction. The subroutine begins by calculating solar angles and the "airmass" parameters. The routine then calculates the Rayleigh radiance, <rayly>, given the present geometry. The sun glitter coefficent, <aglint>, is obtained by a call to the subroutine gliter. The routine then calls the subroutine hmf8 to obtain the aerosol radiance coefficient and calculates the aerosol structure function, <aerosol>. The routine then calculates the remaining coeficients, <absorb>, <abst>, <abso3>, which relate to the atmospheric correction procedure (conversion of tLw to nLw, etc.). |
| B | ||
| BadArgument | arg.c | Bad argument, tell user which argument/keyword was bad. |
| bin9kminit | bin9kmf.f90 | Initialize bin transformations by calculating resolution dependent constants and short cut lookup tables that are present in the bin9km common area. |
| bin9kmset | bin9kmf.f90 | Select desired set of tables (stored in bin9km common). |
| BitsPerEntry | utils.c | Calculate how big a pixel is in bits. |
| BytesPerBand | utils.c | Calculate how many bytes per band. |
| C | ||
| carder_cweps | cweps-1.2.f | Compute epsilon(531,667) using clear-water Rrs values read from file. Use to flag pixels for high iron bearing aerosols or dust. Needs total and Rayleigh reflectances and diffuse transmittance from atm. corr. code. |
| carder_interp | modis_chl.1.c | From the input reflectance data the routine calls a function bb to
calculate backscatter; bb. The main subroutine then calculates the reflectance/bb ratios;
Rrs, and the absorption ratios (Rrs 412nm: Rrs 443nm, and Rrs 490: Rrs 510); r1, r2.
The routine then calls a function interp_block to compare the absorption ratios to
those found in the LUT. If a match is found interp_block does a bilinear interpolation
using LUT for chlorophyll and gelbstoff absorption to obtain aph675 and ag400 for the
measured reflectance data. The main subroutine then calculates the chlorophyll
concentration as a fn(aph675). If no match was found chlorophyll concentration is
calculated by a CZCS type algorithm and the aph675 and ag400 are set to -1. The main
subroutine returns the chlorophyll concentration, absorption at 675nm, and 400nm as pointers. |
| carder_interp_init | modis_chl.1.c | Loads initialization data, coefficients and computes static tables. |
| carder_ipar | ipar-1.2.f | Computes instantaneous photosynthetically available radiance (IPAR) just below the surface, and absorbed radiation by phytoplankton (ARP) in the top attenuation depth at 685 nm, integrated from 400-700 nm. Requires above surface downwelling irradiance and other meteorological data from other MODIS products. ARP is used as input to the MODIS chlorophyll fluorescence efficiency algorithm. |
| CheckArgument | get.c | Load up an argument and validate it. Only need to check INT's and REAL's. |
| CheckForExtraArgs | get.c | Walk the parse tree and see if any arguments were not touched. |
| CheckPositionalArgs | get.c | Walk the parse tree and make sure positional args are correct. |
| ck_files_in_buf | getanc.c | Checks whether the requested data is already in the buffers and if so, sets the rd_flag. |
| clark_init | clarkio-v1.0.c | Initialization routine for Clark package. Subroutine to read in initialization constants from data file. |
| ClearFlag | utils.c | Clear an event flag. |
| ClearNodes | get.c | Traverse the tree clearing the "seen" flag. |
| closeHDF | HDFroutines.c | Closes the HDF file. |
| cocons | colorsub8.c | The constant initializer for the subroutine coloop. It begins by obtaining aerosol scaling coefficients with a call to the subroutine calaersol. Clear water radiance values are obtained by calling the subroutine callcw, the solar constant is obtained by a call to the subroutine calf0, and ozone conversion coefficients are obtained by a call to the subroutine caldob. The subroutine cocons then corrects the solar constant and clear water radiance values for the time of year. The subroutine rayget is then called to obtain Rayleigh optical thickness, tau. The subroutine cocons then converts epsilon values to an internal form. |
| coinit | colorsub8.c | Initializes for looping over scan lines. |
| coloop | colorsub8.c | Calculates and collects coefficients and parameters needed for the
atmospheric correction which is performed by the anly module. The subroutine begins
by calculating solar angles and the "airmass" parameters. The routine then calculates the Rayleigh reflectance, <rayly>, given the present geometry. The routine then tries to improve the rayleigh radiance estimate by using information from ancillary data. Climatology for current grid points are obtained by a call to get_climatology. The routine then calculates windspeed and direction, and new Rayleigh coefficients by applying ozone, and pressure corrections. The sunglitter coefficent, <aglint>, is obtained by a call to the subroutine gliter. The routine then calls the subroutine hmf8 to obtain the aerosol radiance coefficient and calculates the aerosol structure function, <aerosol>. The whitecap correction factor, <awhite>, is then calculated using information on windspeed. The routine then calculates the remaining coeficients, <absorb>, <abst>, <abso3>, which relate to the atmospheric correction procedure (conversion of tLw to nLw, etc.). |
| CONANG | dataintp.f | Subroutine to convert an angle from one unit to another. |
| ConvertOldDate | utils.c | Convert a string of the form dd-mmm-yy to an integer of the form
YYYYMMDD. The string may not have a NULL at the end. |
| ConvertOldTime | utils.c | Convert a string of the form HH:MM:SS to an integer of the form HHMMSS. The string may not have a NULL at the end. |
| copyCloudByteAttrs | L1B_Geo_Cld_Interface | Copy the byte1, byte2, byte3, and byte4 attributes of the Cloud_Mask sds in the MOD35 cloudmask file to the specified SDS in specified out file. This function must be called after mod_get_l1b_open_v2 and before mod_get_l1b_open_v2. |
| CopyLow | get.c | Copy and convert to lower case. |
| CopyNoBlanks | atof.c | Copy a string and remove leading and trailing blanks. |
| CopyPSA | v2_meta.c | Copy a PSA. |
| CutDownTree | cuttree.c | Defoilate a (parse) tree. |
| D | ||
| DEG1PI | dataintp.f | Function to convert decimal degree angle into -PI to PI radians. |
| DEG360 | dataintp.f | Function to put a decimal degree value into the range of 0 to 360. |
| DEGRAD | dataintp.f | Function to convert a degree to radians. |
| DelImageStruct | utils.c | Destroy an IMGFILE structure. |
| diffuse_transmittance | wang3.f | diffuse_transmittance subroutine reads the inputs of aerosol model, viewing angle and aerosol optical thicknesses and produces the diffuse transmittance at all eight wavelengths. |
| dmatrix | hogemods-v2.0.c | Function to allocate a two dimensional matrix. |
| dom_gen | hogemods-v2.0.c | Function to produce spectral model of dissolved organic matter (dom). |
| Dsp_BigEndian | dsplib.c | Return byte order indication. |
| Dsp_CallerRunning | dsplib.c | See if caller is running. |
| Dsp_ClearFlag | dsplib.c | Clear event flag. |
| Dsp_Date | dsplib.c | Return the current date. |
| Dsp_ErrMsg | errmsg.c | Return error string into a user buffer. |
| Dsp_ErrorMsg | errmsg.c | Return the English string associated with a DSP error number. |
| Dsp_EvlCal | evlcal.c | Calibrated value to be changed to counts (integer). |
| Dsp_EvrCal | evlcal.c | Change a calibrated real value into counts. |
| Dsp_FillLevel | get.c | Fill all keywords equal to `level', recurse when encountering a lower level (i.e. level number is greater) return to caller when encountering a higher level (i.e. lower level number). |
| Dsp_FreeFlag | utils.c | Free an event flag. |
| Dsp_GetCommandLine | get.c | Parse a command line and fill-in user structure. |
| Dsp_GetErrno | get.c | Get error number. |
| Dsp_GetFlag | utils.c | Return a free event flag. |
| Dsp_GetPosArg | get.c | Return a positional argument. |
| Dsp_GetProgramName | dsplib.c | Return the name of the program as defined in the Dsp_Init call. |
| Dsp_GetRawCommandLine | get.c | Parse a command line and fill-in user structure. |
| Dsp_GetReturnStatus | dsplib.c | Gets the reply status. |
| Dsp_GetTHECommandLine | get.c | Get THE command line that got us started. |
| Dsp_idate | dsplib.c | Return the current day, month, and year. |
| Dsp_Init | init.c | Initialize Fortran display programs. |
| Dsp_Init_C | dsplib.c | Initialize a display program written in `C'. |
| Dsp_Message | dsplib.c | Prepend the program name to the message string and use Dsp_Print to output the message. |
| Dsp__ParseCommandLine | parser.c | Returns pointer to list of links for positional arguments and a pointer to list of links to keyword arguments. |
| Dsp_ParseCommandLine | get.c | Parse a single command line. |
| Dsp_Perror | errmsg.c | Prepend input message to standard error message for most recent error and print it out. |
| Dsp_Print | dsplib.c | If SMFLOG is defined, write messages to LogReport. SMFLOG is defined in SMF.h. |
| Dsp_ReadFlag | dsplib.c | Read event flag. |
| Dsp_ReturnStatus | dsplib.c | Set the return status. This allows a display process to call this routine, call Dsp_ReleaseTerminal and then exit cleanly without having to call `Dsp_GetCommand'. |
| Dsp_SetFlag | dsplib.c | Set event flag |
| Dsp_SetProgramName | dsplib.c | Set the name of the program for those multiple entry point jobs. |
| Dsp_SplitImageName | splitimg.c | Subroutine to split the sub image name from the file name. |
| Dsp_Time | dsplib.c | Return the current time. |
| Dsp_WaitForFlag | dsplib.c | Wait for event flag. |
| Dsp_Wrktlk | dsplib.c | Get environment variable. |
| dspini_ | init.c | Fortran name for Dsp_Init. |
| dsplim_ | splitimg.c | Fortran name for Dsp_SplitImageName. |
| dspmsg_ | dsplib.c | Fortran name for Dsp_Message. |
| dsprnt_ | dsplib.c | Fortran name for Dsp_Print. |
| dstprn_ | dsplib.c | Fortran name for Dsp_SetProgramName. |
| dretst_ | dsplib.c | Fortran name for Dsp_ReturnStatus. |
| DupeString | parser.c | Make a copy of a string. |
| dvector | hogemods-v2.0.c | Function to allocate a one dimensional vector. |
| dwrktk_ | dsplib.c | Fortran name for Dsp_Wrktlk. |
| E | ||
| emalloc | utils.c | Allocate memory. |
| etbp_v | fakeetbp.f90 | Compute radiance given temperature and wavenumber for small T vs C2*NU. |
| etbp_w | fakeetbp.f90 | Compute radiance given temperature and wavenumber for large T vs C2*NU |
| etintegemis | etbpsub.f90 | Convert emissivity table expressed as wavenumber to avhrr channel number. |
| etintegrate | etbpsub.f90 | Convert temperature to radiance. |
| etinvert | etbpsub.f90 | Convert radiance to temperature. |
| evlcal_ | evlcal.c | Fortran name for Dsp_EvlCal. |
| evrcal_ | evlcal.c | Fortran name for Dsp_EvrCal. |
| extract_data_pts | getanc.c | Extracts 4 surrounding coordinates and corresponding data for the given lat/lon. |
| ExtraDumpNode | get.c | Display a node. |
| F | ||
| fake_etbp | fakeetbp.f90 | Initialize radiance-temperature conversions. |
| few_day | dayboundsub.f90 | Called by dayboundsub. |
| ffmod | utils.f90 | Calls the fortran intrinsic function amod, and returns the 'remainder' of variable a divided by variable b. |
| ffsign | utils.f90 | Calls the fortran intrinsic function sign, and returns the magnitude of a with the sign of b. |
| fill_grid | MOD_PRmfill.f90 | For each empty bin, try to compute a value for it from adjacent bins. |
| FillInBandStructure | utils.c | Fill in missing elements from the band structure. |
| FillOneEntry | get.c | Try to fill out one entry in the table. Return 0 on ambiguous keywords, missing keywords, missing values. |
| fixlon | MOD_PR28.f90 | Utility to check that the longitudes of the box are in units of 0-360 degrees and that the box does not fall on the seamline. If the units are in a -/+ cordinate system they are converted to 0-360 degrees. If the box falls on the seam then 360 is added to the longitudes on one side of the box to enable the data for the box to be smoothed. |
| FoldUp | utils.c | Copy the upper case version of a string. |
| forwardproject | forward.f90 | Convert earth location into a projection pseudo coordinate. |
| free_dmatrix | hogemods-v2.0.c | Function to deallocate matrix. |
| free_dvector | hogemods-v2.0.c | Function to deallocate vector. |
| FreeLun | utils.c | Free a lun. |
| FreeMem | utils.c | Release allocated memory. |
| funct_a_b_c_d_fourier | wang3.f | This computes coefficients a, b c, d at the SeaWiFS bands 1 to 8 of (aerosol radiance + Rayleigh-aerosol interaction radiance) vs. (single scattering aerosol radiance) using the data of Fourier coefficients of a, b and c of a QUARTIC fit to the aerosol model. |
| funct_eps | wang3.f | Calculate true epsilon(765,865) and epsilon(443,865) for each candidate aerosol model. |
| funct_oxygen_aer | gordon_o2.f | Computes coefficient to convert aerosol at 765 with oxygen absorption to aerosol at 765 without oxygen absorption. |
| funct_oxygen_ray | gordon_o2.f | Converts rayleigh at 765 without oxygen absorption to rayleigh at 765 with oxygen absorption. |
| fwd1d | bin9kmf.f90 | Convert earth location to bin number. |
| fwd2d | bin9kmf.f90 | Convert earth location to integer row, column. |
| fwd2dn | bin9kmf.f90 | Convert integer row, column to bin number |
| fwd2fd | bin9kmf.f90 | Convert fractional row, column to integer row, column. |
| fwd2lf | bin9kmf.f90 | Convert earth location to fractional row, column. |
| G | ||
| get_ancillary | getanc.c | Will open ancillary data product or climatology files when required, retrieve the ancillary data, perform the interpolations, and close any open files. |
| get_clim_data | HDFroutines.c | Reads climatology file for the required month. |
| get_climatology | get_climatology.c | Retrieves various physical parameters across the satellite scan via
daily/etc climatology files (as specified in set_climatology call). This subroutine uses
the SeaWiFS get_ancillary routine which calls appropriate functions to perform the open, reading, and closing of the required files and to perform the interpolations for the given earth coordinates. |
| get_l2_closef | hdf-iom.c (msbin) | This routine closes an L2 file. |
| get_l2_openf | hdf-iom.c (msbin) | This routine opens an L2 file. |
| get_l2_recordf | hdf-iom.c (msbin) | This routine reads a record from an L2 file. |
| get_l3b_closef | l3in.c | This routine closes an L3 file. |
| get_l3b_openf | l3in.c | This routine opens an L3 file and reads metadata. |
| get_l3b_recordf | l3in.c | This routine reads one or more bins from an L3 file. |
| get_NRT_data | HDFroutines.c | Reads NRT data from the given file. |
| get_params | modis_chl.1.c | Reads in the the seawifs wavebands and Rrs model parameters to use in the algorithm. |
| get_pgs_filename | pgs-util.c | Get PGS filename. |
| get_pgs_numfiles | pgs-util.c | Get the number of PGS files present. |
| get_refs | HDFroutines.c | Traverses through the NRT file vgroup and outputs the SDS reference number to access the requested data. |
| get_time | getanc.c | Opens the given HDF file, reads global attributes syear, sday, smsec, eyear, eday, and emsec. Returns sdate, edate, stime and etime to the calling routines through output arguments. |
| GetDataFieldSize | utils.c | Loop through all bands and add up the number of bytes needed per line. |
| getemissivity | get_emissivity.f90 | Subroutine to read avhrr infrared emissivity correction table. |
| GetFreeLun | utils.c | Return the next free LUN. |
| GetImageStruct | utils.c | Allocate an IMGFILE structure and zero out fields. |
| GetImageVersion | utils.c | Return an integer for the image version. |
| GetKeywordLink | get.c | Return a pointer to a keyword argument. Return NULL if no such keyword or ambiguous keywords. |
| getlevel | czcssubn.f90 | Subroutine to return the level of remap and version. |
| GetLocalCmdLine | get.c | Get the next command line. |
| GetLocalInputLine | utils.c | Read a line from stdin. |
| GetNextChar | parser.c | Return the next token. |
| GetNextToken | parser.c | Return the next token. |
| gregor | getanc.c | Converts julian day into gregorian month/day. |
| gtcmnd_ | get.c | Fortran name for Dsp_GetCommandLine. |
| gtprgn_ | dsplib.c | Fortran name for Dsp_GetProgramName. |
| gtrawc_ | get.c | Fortran name for Dsp_GetRawCommandLine. |
| gttcmd_ | get.c | Fortran name for Dsp_GetTHECommandLine. |
| H | ||
| HexToBin | get.c | Convert a hex string to binary. |
| hoge_get_params | hogeio-v2.0.c | Initialization routine for Hoge package. Subroutine to read in initialization constants from data file. |
| hoge_init | hoge-v2.0.c | Subroutine to intialize inversion constants and various models. |
| hoge_run | hoge-v2.0.c | Main routine to calculate chlorophyll absorption, dom absorption and
total constituent backscatter at 415nm, PUB absorption at 490nm and PEB absorption at 555nm. This routine uses ludecomposition which sets up a 5x5 matrix to be inverted in routines pel_lubksb and pel_ludcmp. Spectral model functions are also called to initialize models, phyto_gen dom_gen, tcb_gen, pub_gen, and peb_gen. |
| Hopenck | hdf_io_tools.c | Hopen the hdf file filenm for mode = "r", "rw", or "w". Issue error message and exit if Hopen returns error. |
Documented by Jasmine S. Bartlett, COAS, Oregon State University.