Skip to content. | Skip to navigation

Personal tools

airs_ret_rdr.c

#include <stdio.h>
#include <stdlib.h>
#include "hdf.h" /* defines int32, intn, etc. */
#include "HdfEosDef.h" /* declares SWopen(), etc. */
#include "airs_ret_typ.h"
#include "airs_ret_struct.h"


/*
* This function is autogenerated by the mkezio program to read
* an AIRS swath of type "L2_Standard_atmospheric&surface_product" from file given by the
* file_name argument into a buffer pointed to by the airs_ret_gran
* argument. The caller owns the buffer. The entire granule
* is read -- every attribute and field, the whole lat/lon/time
* extent.
*
* Errors opening the file, etc. are fatal and cause exit(EXIT_FAILURE).
* Problems reading individual attributes or fields are reported to
* the console but do not interrupt program flow.
*/
void airs_ret_rdr(
char * file_name, /* name of file to read */
airs_ret_gran_t * airs_ret_gran ) /* structured buffer to hold entire granule */
{
intn statn; /* HDF-EOS status. 0 for success */
int32 fid; /* HDF-EOS file ID */
int32 swid; /* HDF-EOS swath ID */
int32 nchar; /* Number of characters */
char swathname[256]; /* Name of swath */
int nswath; /* Number of swaths */
char * cp = 0; /* pointer to start of version # in file name */
int major = 0, minor = 0, patch = 0, subpatch = 0;
/* parts of version number */

/* Figure out version from file name */

/* skip past directories if full path is present */
cp = strrchr(file_name, '/');
if (!cp) cp = file_name;

/*
* File will look more or less like:
* AIRS.2002.09.06.125.L1B.AIRS_Rad.v4.0.6.0.PGE_Verify.T04352025159.hdf
*/
cp = strstr(cp, ".v");

if (cp) {
int nscanned = sscanf(cp, ".v%d.%d.%d.%d",
&major, &minor, &patch, &subpatch);
if (nscanned != 4)
printf("Failed to get version from file name %s starting at %s\n",
file_name, cp);
} else {
printf("Failed to get version from file name %s\n", file_name);
printf("so version number cannot be checked.\n\n");
}

/* if we did get a version number, check it */
if (major + minor + patch + subpatch) {
if (major != 5 || minor != 0 || patch != 14 || subpatch != 0) {
printf("Warning: airs_ret file read is version %d.%d.%d.%d ",
major, minor, patch, subpatch);
printf("but reader is designed for 5.0.14.0\n");
}
}

/* Clear granule structure */
memset(airs_ret_gran, 0, sizeof(airs_ret_gran));

fid = SWopen(file_name, DFACC_READ);
if (fid <= 0) {
printf("Error %ld opening file %s\n", (long)fid, file_name);
exit(EXIT_FAILURE);
}

/* Get name of swath(s) */
nswath = SWinqswath(file_name, swathname, &nchar);
if (nswath != 1) {
printf("SWinqswath found %d swaths for file \"%s\". Need exactly 1\n", nswath, file_name);
exit(EXIT_FAILURE);
}

/* There's exactly one swath. Make sure it is the right one. */
if (strcmp(swathname, "L2_Standard_atmospheric&surface_product")) {
printf("Error: bad swath name \"%s\" in file \"%s\"\n", swathname, file_name);
printf("Expected \"L2_Standard_atmospheric&surface_product\"\n");
exit(EXIT_FAILURE);
}

/* Attach to (open) the one swath. */
swid = SWattach(fid, swathname);
if (swid <= 0) {
printf("Failed to attach to swath \"%s\" in file %s\n", swathname, file_name);
exit(EXIT_FAILURE);
}

/* Attributes */
statn = SWreadattr(swid, "NumSO2FOVs",
(void *)&airs_ret_gran->NumSO2FOVs);
if (statn != 0)
printf("Error %d reading attribute NumSO2FOVs\n", statn);

statn = SWreadattr(swid, "processing_level",
(void *)airs_ret_gran->processing_level);
if (statn != 0)
printf("Error %d reading attribute processing_level\n", statn);

statn = SWreadattr(swid, "instrument",
(void *)airs_ret_gran->instrument);
if (statn != 0)
printf("Error %d reading attribute instrument\n", statn);

statn = SWreadattr(swid, "DayNightFlag",
(void *)airs_ret_gran->DayNightFlag);
if (statn != 0)
printf("Error %d reading attribute DayNightFlag\n", statn);

statn = SWreadattr(swid, "AutomaticQAFlag",
(void *)airs_ret_gran->AutomaticQAFlag);
if (statn != 0)
printf("Error %d reading attribute AutomaticQAFlag\n", statn);

statn = SWreadattr(swid, "NumTotalData",
(void *)&airs_ret_gran->NumTotalData);
if (statn != 0)
printf("Error %d reading attribute NumTotalData\n", statn);

statn = SWreadattr(swid, "NumProcessData",
(void *)&airs_ret_gran->NumProcessData);
if (statn != 0)
printf("Error %d reading attribute NumProcessData\n", statn);

statn = SWreadattr(swid, "NumSpecialData",
(void *)&airs_ret_gran->NumSpecialData);
if (statn != 0)
printf("Error %d reading attribute NumSpecialData\n", statn);

statn = SWreadattr(swid, "NumBadData",
(void *)&airs_ret_gran->NumBadData);
if (statn != 0)
printf("Error %d reading attribute NumBadData\n", statn);

statn = SWreadattr(swid, "NumMissingData",
(void *)&airs_ret_gran->NumMissingData);
if (statn != 0)
printf("Error %d reading attribute NumMissingData\n", statn);

statn = SWreadattr(swid, "NumLandSurface",
(void *)&airs_ret_gran->NumLandSurface);
if (statn != 0)
printf("Error %d reading attribute NumLandSurface\n", statn);

statn = SWreadattr(swid, "NumOceanSurface",
(void *)&airs_ret_gran->NumOceanSurface);
if (statn != 0)
printf("Error %d reading attribute NumOceanSurface\n", statn);

statn = SWreadattr(swid, "node_type",
(void *)airs_ret_gran->node_type);
if (statn != 0)
printf("Error %d reading attribute node_type\n", statn);

statn = SWreadattr(swid, "start_year",
(void *)&airs_ret_gran->start_year);
if (statn != 0)
printf("Error %d reading attribute start_year\n", statn);

statn = SWreadattr(swid, "start_month",
(void *)&airs_ret_gran->start_month);
if (statn != 0)
printf("Error %d reading attribute start_month\n", statn);

statn = SWreadattr(swid, "start_day",
(void *)&airs_ret_gran->start_day);
if (statn != 0)
printf("Error %d reading attribute start_day\n", statn);

statn = SWreadattr(swid, "start_hour",
(void *)&airs_ret_gran->start_hour);
if (statn != 0)
printf("Error %d reading attribute start_hour\n", statn);

statn = SWreadattr(swid, "start_minute",
(void *)&airs_ret_gran->start_minute);
if (statn != 0)
printf("Error %d reading attribute start_minute\n", statn);

statn = SWreadattr(swid, "start_sec",
(void *)&airs_ret_gran->start_sec);
if (statn != 0)
printf("Error %d reading attribute start_sec\n", statn);

statn = SWreadattr(swid, "start_orbit",
(void *)&airs_ret_gran->start_orbit);
if (statn != 0)
printf("Error %d reading attribute start_orbit\n", statn);

statn = SWreadattr(swid, "end_orbit",
(void *)&airs_ret_gran->end_orbit);
if (statn != 0)
printf("Error %d reading attribute end_orbit\n", statn);

statn = SWreadattr(swid, "orbit_path",
(void *)&airs_ret_gran->orbit_path);
if (statn != 0)
printf("Error %d reading attribute orbit_path\n", statn);

statn = SWreadattr(swid, "start_orbit_row",
(void *)&airs_ret_gran->start_orbit_row);
if (statn != 0)
printf("Error %d reading attribute start_orbit_row\n", statn);

statn = SWreadattr(swid, "end_orbit_row",
(void *)&airs_ret_gran->end_orbit_row);
if (statn != 0)
printf("Error %d reading attribute end_orbit_row\n", statn);

statn = SWreadattr(swid, "granule_number",
(void *)&airs_ret_gran->granule_number);
if (statn != 0)
printf("Error %d reading attribute granule_number\n", statn);

statn = SWreadattr(swid, "num_scansets",
(void *)&airs_ret_gran->num_scansets);
if (statn != 0)
printf("Error %d reading attribute num_scansets\n", statn);

statn = SWreadattr(swid, "num_scanlines",
(void *)&airs_ret_gran->num_scanlines);
if (statn != 0)
printf("Error %d reading attribute num_scanlines\n", statn);

statn = SWreadattr(swid, "start_Latitude",
(void *)&airs_ret_gran->start_Latitude);
if (statn != 0)
printf("Error %d reading attribute start_Latitude\n", statn);

statn = SWreadattr(swid, "start_Longitude",
(void *)&airs_ret_gran->start_Longitude);
if (statn != 0)
printf("Error %d reading attribute start_Longitude\n", statn);

statn = SWreadattr(swid, "start_Time",
(void *)&airs_ret_gran->start_Time);
if (statn != 0)
printf("Error %d reading attribute start_Time\n", statn);

statn = SWreadattr(swid, "end_Latitude",
(void *)&airs_ret_gran->end_Latitude);
if (statn != 0)
printf("Error %d reading attribute end_Latitude\n", statn);

statn = SWreadattr(swid, "end_Longitude",
(void *)&airs_ret_gran->end_Longitude);
if (statn != 0)
printf("Error %d reading attribute end_Longitude\n", statn);

statn = SWreadattr(swid, "end_Time",
(void *)&airs_ret_gran->end_Time);
if (statn != 0)
printf("Error %d reading attribute end_Time\n", statn);

statn = SWreadattr(swid, "eq_x_longitude",
(void *)&airs_ret_gran->eq_x_longitude);
if (statn != 0)
printf("Error %d reading attribute eq_x_longitude\n", statn);

statn = SWreadattr(swid, "eq_x_tai",
(void *)&airs_ret_gran->eq_x_tai);
if (statn != 0)
printf("Error %d reading attribute eq_x_tai\n", statn);

statn = SWreadattr(swid, "orbitgeoqa",
(void *)&airs_ret_gran->orbitgeoqa);
if (statn != 0)
printf("Error %d reading attribute orbitgeoqa\n", statn);

statn = SWreadattr(swid, "num_satgeoqa",
(void *)&airs_ret_gran->num_satgeoqa);
if (statn != 0)
printf("Error %d reading attribute num_satgeoqa\n", statn);

statn = SWreadattr(swid, "num_glintgeoqa",
(void *)&airs_ret_gran->num_glintgeoqa);
if (statn != 0)
printf("Error %d reading attribute num_glintgeoqa\n", statn);

statn = SWreadattr(swid, "num_moongeoqa",
(void *)&airs_ret_gran->num_moongeoqa);
if (statn != 0)
printf("Error %d reading attribute num_moongeoqa\n", statn);

statn = SWreadattr(swid, "num_ftptgeoqa",
(void *)&airs_ret_gran->num_ftptgeoqa);
if (statn != 0)
printf("Error %d reading attribute num_ftptgeoqa\n", statn);

statn = SWreadattr(swid, "num_zengeoqa",
(void *)&airs_ret_gran->num_zengeoqa);
if (statn != 0)
printf("Error %d reading attribute num_zengeoqa\n", statn);

statn = SWreadattr(swid, "num_demgeoqa",
(void *)&airs_ret_gran->num_demgeoqa);
if (statn != 0)
printf("Error %d reading attribute num_demgeoqa\n", statn);

statn = SWreadattr(swid, "num_fpe",
(void *)&airs_ret_gran->num_fpe);
if (statn != 0)
printf("Error %d reading attribute num_fpe\n", statn);

statn = SWreadattr(swid, "LonGranuleCen",
(void *)&airs_ret_gran->LonGranuleCen);
if (statn != 0)
printf("Error %d reading attribute LonGranuleCen\n", statn);

statn = SWreadattr(swid, "LatGranuleCen",
(void *)&airs_ret_gran->LatGranuleCen);
if (statn != 0)
printf("Error %d reading attribute LatGranuleCen\n", statn);

statn = SWreadattr(swid, "LocTimeGranuleCen",
(void *)&airs_ret_gran->LocTimeGranuleCen);
if (statn != 0)
printf("Error %d reading attribute LocTimeGranuleCen\n", statn);

statn = SWreadattr(swid, "CO_first_guess",
(void *)airs_ret_gran->CO_first_guess);
if (statn != 0)
printf("Error %d reading attribute CO_first_guess\n", statn);

statn = SWreadattr(swid, "CH4_first_guess",
(void *)airs_ret_gran->CH4_first_guess);
if (statn != 0)
printf("Error %d reading attribute CH4_first_guess\n", statn);


/* Geolocation fields */
statn = SWreadfield(swid, "Latitude", NULL, NULL, NULL,
(void *)&airs_ret_gran->Latitude[0][0]);
if (statn != 0)
printf("Error %d reading field Latitude\n", statn);

statn = SWreadfield(swid, "Longitude", NULL, NULL, NULL,
(void *)&airs_ret_gran->Longitude[0][0]);
if (statn != 0)
printf("Error %d reading field Longitude\n", statn);

statn = SWreadfield(swid, "Time", NULL, NULL, NULL,
(void *)&airs_ret_gran->Time[0][0]);
if (statn != 0)
printf("Error %d reading field Time\n", statn);


/* Data Fields */
statn = SWreadfield(swid, "RetQAFlag", NULL, NULL, NULL,
(void *)&airs_ret_gran->RetQAFlag[0][0]);
if (statn != 0)
printf("Error %d reading field RetQAFlag\n", statn);

statn = SWreadfield(swid, "satheight", NULL, NULL, NULL,
(void *)&airs_ret_gran->satheight[0]);
if (statn != 0)
printf("Error %d reading field satheight\n", statn);

statn = SWreadfield(swid, "satroll", NULL, NULL, NULL,
(void *)&airs_ret_gran->satroll[0]);
if (statn != 0)
printf("Error %d reading field satroll\n", statn);

statn = SWreadfield(swid, "satpitch", NULL, NULL, NULL,
(void *)&airs_ret_gran->satpitch[0]);
if (statn != 0)
printf("Error %d reading field satpitch\n", statn);

statn = SWreadfield(swid, "satyaw", NULL, NULL, NULL,
(void *)&airs_ret_gran->satyaw[0]);
if (statn != 0)
printf("Error %d reading field satyaw\n", statn);

statn = SWreadfield(swid, "satgeoqa", NULL, NULL, NULL,
(void *)&airs_ret_gran->satgeoqa[0]);
if (statn != 0)
printf("Error %d reading field satgeoqa\n", statn);

statn = SWreadfield(swid, "glintgeoqa", NULL, NULL, NULL,
(void *)&airs_ret_gran->glintgeoqa[0]);
if (statn != 0)
printf("Error %d reading field glintgeoqa\n", statn);

statn = SWreadfield(swid, "moongeoqa", NULL, NULL, NULL,
(void *)&airs_ret_gran->moongeoqa[0]);
if (statn != 0)
printf("Error %d reading field moongeoqa\n", statn);

statn = SWreadfield(swid, "ftptgeoqa", NULL, NULL, NULL,
(void *)&airs_ret_gran->ftptgeoqa[0][0]);
if (statn != 0)
printf("Error %d reading field ftptgeoqa\n", statn);

statn = SWreadfield(swid, "zengeoqa", NULL, NULL, NULL,
(void *)&airs_ret_gran->zengeoqa[0][0]);
if (statn != 0)
printf("Error %d reading field zengeoqa\n", statn);

statn = SWreadfield(swid, "demgeoqa", NULL, NULL, NULL,
(void *)&airs_ret_gran->demgeoqa[0][0]);
if (statn != 0)
printf("Error %d reading field demgeoqa\n", statn);

statn = SWreadfield(swid, "nadirTAI", NULL, NULL, NULL,
(void *)&airs_ret_gran->nadirTAI[0]);
if (statn != 0)
printf("Error %d reading field nadirTAI\n", statn);

statn = SWreadfield(swid, "sat_lat", NULL, NULL, NULL,
(void *)&airs_ret_gran->sat_lat[0]);
if (statn != 0)
printf("Error %d reading field sat_lat\n", statn);

statn = SWreadfield(swid, "sat_lon", NULL, NULL, NULL,
(void *)&airs_ret_gran->sat_lon[0]);
if (statn != 0)
printf("Error %d reading field sat_lon\n", statn);

statn = SWreadfield(swid, "scan_node_type", NULL, NULL, NULL,
(void *)&airs_ret_gran->scan_node_type[0]);
if (statn != 0)
printf("Error %d reading field scan_node_type\n", statn);

statn = SWreadfield(swid, "satzen", NULL, NULL, NULL,
(void *)&airs_ret_gran->satzen[0][0]);
if (statn != 0)
printf("Error %d reading field satzen\n", statn);

statn = SWreadfield(swid, "satazi", NULL, NULL, NULL,
(void *)&airs_ret_gran->satazi[0][0]);
if (statn != 0)
printf("Error %d reading field satazi\n", statn);

statn = SWreadfield(swid, "solzen", NULL, NULL, NULL,
(void *)&airs_ret_gran->solzen[0][0]);
if (statn != 0)
printf("Error %d reading field solzen\n", statn);

statn = SWreadfield(swid, "solazi", NULL, NULL, NULL,
(void *)&airs_ret_gran->solazi[0][0]);
if (statn != 0)
printf("Error %d reading field solazi\n", statn);

statn = SWreadfield(swid, "glintlat", NULL, NULL, NULL,
(void *)&airs_ret_gran->glintlat[0]);
if (statn != 0)
printf("Error %d reading field glintlat\n", statn);

statn = SWreadfield(swid, "glintlon", NULL, NULL, NULL,
(void *)&airs_ret_gran->glintlon[0]);
if (statn != 0)
printf("Error %d reading field glintlon\n", statn);

statn = SWreadfield(swid, "sun_glint_distance", NULL, NULL, NULL,
(void *)&airs_ret_gran->sun_glint_distance[0][0]);
if (statn != 0)
printf("Error %d reading field sun_glint_distance\n", statn);

statn = SWreadfield(swid, "topog", NULL, NULL, NULL,
(void *)&airs_ret_gran->topog[0][0]);
if (statn != 0)
printf("Error %d reading field topog\n", statn);

statn = SWreadfield(swid, "topog_err", NULL, NULL, NULL,
(void *)&airs_ret_gran->topog_err[0][0]);
if (statn != 0)
printf("Error %d reading field topog_err\n", statn);

statn = SWreadfield(swid, "landFrac", NULL, NULL, NULL,
(void *)&airs_ret_gran->landFrac[0][0]);
if (statn != 0)
printf("Error %d reading field landFrac\n", statn);

statn = SWreadfield(swid, "landFrac_err", NULL, NULL, NULL,
(void *)&airs_ret_gran->landFrac_err[0][0]);
if (statn != 0)
printf("Error %d reading field landFrac_err\n", statn);

statn = SWreadfield(swid, "pressStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->pressStd[0]);
if (statn != 0)
printf("Error %d reading field pressStd\n", statn);

statn = SWreadfield(swid, "pressH2O", NULL, NULL, NULL,
(void *)&airs_ret_gran->pressH2O[0]);
if (statn != 0)
printf("Error %d reading field pressH2O\n", statn);

statn = SWreadfield(swid, "MWHingeSurfFreqGHz", NULL, NULL, NULL,
(void *)&airs_ret_gran->MWHingeSurfFreqGHz[0]);
if (statn != 0)
printf("Error %d reading field MWHingeSurfFreqGHz\n", statn);

statn = SWreadfield(swid, "latAIRS", NULL, NULL, NULL,
(void *)&airs_ret_gran->latAIRS[0][0][0][0]);
if (statn != 0)
printf("Error %d reading field latAIRS\n", statn);

statn = SWreadfield(swid, "lonAIRS", NULL, NULL, NULL,
(void *)&airs_ret_gran->lonAIRS[0][0][0][0]);
if (statn != 0)
printf("Error %d reading field lonAIRS\n", statn);

statn = SWreadfield(swid, "Qual_Guess_PSurf", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_Guess_PSurf[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_Guess_PSurf\n", statn);

statn = SWreadfield(swid, "PSurfStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->PSurfStd[0][0]);
if (statn != 0)
printf("Error %d reading field PSurfStd\n", statn);

statn = SWreadfield(swid, "nSurfStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->nSurfStd[0][0]);
if (statn != 0)
printf("Error %d reading field nSurfStd\n", statn);

statn = SWreadfield(swid, "Press_mid_top_bndry", NULL, NULL, NULL,
(void *)&airs_ret_gran->Press_mid_top_bndry[0][0]);
if (statn != 0)
printf("Error %d reading field Press_mid_top_bndry\n", statn);

statn = SWreadfield(swid, "nStd_mid_top_bndry", NULL, NULL, NULL,
(void *)&airs_ret_gran->nStd_mid_top_bndry[0][0]);
if (statn != 0)
printf("Error %d reading field nStd_mid_top_bndry\n", statn);

statn = SWreadfield(swid, "Press_bot_mid_bndry", NULL, NULL, NULL,
(void *)&airs_ret_gran->Press_bot_mid_bndry[0][0]);
if (statn != 0)
printf("Error %d reading field Press_bot_mid_bndry\n", statn);

statn = SWreadfield(swid, "nStd_bot_mid_bndry", NULL, NULL, NULL,
(void *)&airs_ret_gran->nStd_bot_mid_bndry[0][0]);
if (statn != 0)
printf("Error %d reading field nStd_bot_mid_bndry\n", statn);

statn = SWreadfield(swid, "PBest", NULL, NULL, NULL,
(void *)&airs_ret_gran->PBest[0][0]);
if (statn != 0)
printf("Error %d reading field PBest\n", statn);

statn = SWreadfield(swid, "PGood", NULL, NULL, NULL,
(void *)&airs_ret_gran->PGood[0][0]);
if (statn != 0)
printf("Error %d reading field PGood\n", statn);

statn = SWreadfield(swid, "nBestStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->nBestStd[0][0]);
if (statn != 0)
printf("Error %d reading field nBestStd\n", statn);

statn = SWreadfield(swid, "nGoodStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->nGoodStd[0][0]);
if (statn != 0)
printf("Error %d reading field nGoodStd\n", statn);

statn = SWreadfield(swid, "Qual_Temp_Profile_Top", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_Temp_Profile_Top[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_Temp_Profile_Top\n", statn);

statn = SWreadfield(swid, "Qual_Temp_Profile_Mid", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_Temp_Profile_Mid[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_Temp_Profile_Mid\n", statn);

statn = SWreadfield(swid, "Qual_Temp_Profile_Bot", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_Temp_Profile_Bot[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_Temp_Profile_Bot\n", statn);

statn = SWreadfield(swid, "TAirStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->TAirStd[0][0][0]);
if (statn != 0)
printf("Error %d reading field TAirStd\n", statn);

statn = SWreadfield(swid, "TAirStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->TAirStdErr[0][0][0]);
if (statn != 0)
printf("Error %d reading field TAirStdErr\n", statn);

statn = SWreadfield(swid, "TSurfAir", NULL, NULL, NULL,
(void *)&airs_ret_gran->TSurfAir[0][0]);
if (statn != 0)
printf("Error %d reading field TSurfAir\n", statn);

statn = SWreadfield(swid, "TSurfAirErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->TSurfAirErr[0][0]);
if (statn != 0)
printf("Error %d reading field TSurfAirErr\n", statn);

statn = SWreadfield(swid, "Qual_Surf", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_Surf[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_Surf\n", statn);

statn = SWreadfield(swid, "TSurfStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->TSurfStd[0][0]);
if (statn != 0)
printf("Error %d reading field TSurfStd\n", statn);

statn = SWreadfield(swid, "TSurfStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->TSurfStdErr[0][0]);
if (statn != 0)
printf("Error %d reading field TSurfStdErr\n", statn);

statn = SWreadfield(swid, "numHingeSurf", NULL, NULL, NULL,
(void *)&airs_ret_gran->numHingeSurf[0][0]);
if (statn != 0)
printf("Error %d reading field numHingeSurf\n", statn);

statn = SWreadfield(swid, "freqEmis", NULL, NULL, NULL,
(void *)&airs_ret_gran->freqEmis[0][0][0]);
if (statn != 0)
printf("Error %d reading field freqEmis\n", statn);

statn = SWreadfield(swid, "emisIRStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->emisIRStd[0][0][0]);
if (statn != 0)
printf("Error %d reading field emisIRStd\n", statn);

statn = SWreadfield(swid, "emisIRStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->emisIRStdErr[0][0][0]);
if (statn != 0)
printf("Error %d reading field emisIRStdErr\n", statn);

statn = SWreadfield(swid, "Qual_MW_Only_Temp_Strat", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_MW_Only_Temp_Strat[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_MW_Only_Temp_Strat\n", statn);

statn = SWreadfield(swid, "Qual_MW_Only_Temp_Tropo", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_MW_Only_Temp_Tropo[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_MW_Only_Temp_Tropo\n", statn);

statn = SWreadfield(swid, "TAirMWOnlyStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->TAirMWOnlyStd[0][0][0]);
if (statn != 0)
printf("Error %d reading field TAirMWOnlyStd\n", statn);

statn = SWreadfield(swid, "MWSurfClass", NULL, NULL, NULL,
(void *)&airs_ret_gran->MWSurfClass[0][0]);
if (statn != 0)
printf("Error %d reading field MWSurfClass\n", statn);

statn = SWreadfield(swid, "sfcTbMWStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->sfcTbMWStd[0][0][0]);
if (statn != 0)
printf("Error %d reading field sfcTbMWStd\n", statn);

statn = SWreadfield(swid, "EmisMWStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->EmisMWStd[0][0][0]);
if (statn != 0)
printf("Error %d reading field EmisMWStd\n", statn);

statn = SWreadfield(swid, "EmisMWStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->EmisMWStdErr[0][0][0]);
if (statn != 0)
printf("Error %d reading field EmisMWStdErr\n", statn);

statn = SWreadfield(swid, "Qual_MW_Only_H2O", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_MW_Only_H2O[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_MW_Only_H2O\n", statn);

statn = SWreadfield(swid, "totH2OMWOnlyStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->totH2OMWOnlyStd[0][0]);
if (statn != 0)
printf("Error %d reading field totH2OMWOnlyStd\n", statn);

statn = SWreadfield(swid, "Qual_H2O", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_H2O[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_H2O\n", statn);

statn = SWreadfield(swid, "H2OMMRStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->H2OMMRStd[0][0][0]);
if (statn != 0)
printf("Error %d reading field H2OMMRStd\n", statn);

statn = SWreadfield(swid, "H2OMMRStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->H2OMMRStdErr[0][0][0]);
if (statn != 0)
printf("Error %d reading field H2OMMRStdErr\n", statn);

statn = SWreadfield(swid, "totH2OStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->totH2OStd[0][0]);
if (statn != 0)
printf("Error %d reading field totH2OStd\n", statn);

statn = SWreadfield(swid, "totH2OStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->totH2OStdErr[0][0]);
if (statn != 0)
printf("Error %d reading field totH2OStdErr\n", statn);

statn = SWreadfield(swid, "H2OMMRSat", NULL, NULL, NULL,
(void *)&airs_ret_gran->H2OMMRSat[0][0][0]);
if (statn != 0)
printf("Error %d reading field H2OMMRSat\n", statn);

statn = SWreadfield(swid, "H2OMMRSat_liquid", NULL, NULL, NULL,
(void *)&airs_ret_gran->H2OMMRSat_liquid[0][0][0]);
if (statn != 0)
printf("Error %d reading field H2OMMRSat_liquid\n", statn);

statn = SWreadfield(swid, "num_H2O_Func", NULL, NULL, NULL,
(void *)&airs_ret_gran->num_H2O_Func[0][0]);
if (statn != 0)
printf("Error %d reading field num_H2O_Func\n", statn);

statn = SWreadfield(swid, "H2O_verticality", NULL, NULL, NULL,
(void *)&airs_ret_gran->H2O_verticality[0][0][0]);
if (statn != 0)
printf("Error %d reading field H2O_verticality\n", statn);

statn = SWreadfield(swid, "Qual_O3", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_O3[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_O3\n", statn);

statn = SWreadfield(swid, "totO3Std", NULL, NULL, NULL,
(void *)&airs_ret_gran->totO3Std[0][0]);
if (statn != 0)
printf("Error %d reading field totO3Std\n", statn);

statn = SWreadfield(swid, "totO3StdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->totO3StdErr[0][0]);
if (statn != 0)
printf("Error %d reading field totO3StdErr\n", statn);

statn = SWreadfield(swid, "O3VMRStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->O3VMRStd[0][0][0]);
if (statn != 0)
printf("Error %d reading field O3VMRStd\n", statn);

statn = SWreadfield(swid, "O3VMRStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->O3VMRStdErr[0][0][0]);
if (statn != 0)
printf("Error %d reading field O3VMRStdErr\n", statn);

statn = SWreadfield(swid, "num_O3_Func", NULL, NULL, NULL,
(void *)&airs_ret_gran->num_O3_Func[0][0]);
if (statn != 0)
printf("Error %d reading field num_O3_Func\n", statn);

statn = SWreadfield(swid, "O3_verticality", NULL, NULL, NULL,
(void *)&airs_ret_gran->O3_verticality[0][0][0]);
if (statn != 0)
printf("Error %d reading field O3_verticality\n", statn);

statn = SWreadfield(swid, "Qual_CO", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_CO[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_CO\n", statn);

statn = SWreadfield(swid, "CO_total_column", NULL, NULL, NULL,
(void *)&airs_ret_gran->CO_total_column[0][0]);
if (statn != 0)
printf("Error %d reading field CO_total_column\n", statn);

statn = SWreadfield(swid, "num_CO_Func", NULL, NULL, NULL,
(void *)&airs_ret_gran->num_CO_Func[0][0]);
if (statn != 0)
printf("Error %d reading field num_CO_Func\n", statn);

statn = SWreadfield(swid, "CO_trapezoid_layers", NULL, NULL, NULL,
(void *)&airs_ret_gran->CO_trapezoid_layers[0]);
if (statn != 0)
printf("Error %d reading field CO_trapezoid_layers\n", statn);

statn = SWreadfield(swid, "CO_eff_press", NULL, NULL, NULL,
(void *)&airs_ret_gran->CO_eff_press[0][0][0]);
if (statn != 0)
printf("Error %d reading field CO_eff_press\n", statn);

statn = SWreadfield(swid, "CO_VMR_eff", NULL, NULL, NULL,
(void *)&airs_ret_gran->CO_VMR_eff[0][0][0]);
if (statn != 0)
printf("Error %d reading field CO_VMR_eff\n", statn);

statn = SWreadfield(swid, "CO_VMR_eff_err", NULL, NULL, NULL,
(void *)&airs_ret_gran->CO_VMR_eff_err[0][0][0]);
if (statn != 0)
printf("Error %d reading field CO_VMR_eff_err\n", statn);

statn = SWreadfield(swid, "CO_verticality", NULL, NULL, NULL,
(void *)&airs_ret_gran->CO_verticality[0][0][0]);
if (statn != 0)
printf("Error %d reading field CO_verticality\n", statn);

statn = SWreadfield(swid, "CO_dof", NULL, NULL, NULL,
(void *)&airs_ret_gran->CO_dof[0][0]);
if (statn != 0)
printf("Error %d reading field CO_dof\n", statn);

statn = SWreadfield(swid, "Qual_CH4", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_CH4[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_CH4\n", statn);

statn = SWreadfield(swid, "CH4_total_column", NULL, NULL, NULL,
(void *)&airs_ret_gran->CH4_total_column[0][0]);
if (statn != 0)
printf("Error %d reading field CH4_total_column\n", statn);

statn = SWreadfield(swid, "num_CH4_Func", NULL, NULL, NULL,
(void *)&airs_ret_gran->num_CH4_Func[0][0]);
if (statn != 0)
printf("Error %d reading field num_CH4_Func\n", statn);

statn = SWreadfield(swid, "CH4_trapezoid_layers", NULL, NULL, NULL,
(void *)&airs_ret_gran->CH4_trapezoid_layers[0]);
if (statn != 0)
printf("Error %d reading field CH4_trapezoid_layers\n", statn);

statn = SWreadfield(swid, "CH4_eff_press", NULL, NULL, NULL,
(void *)&airs_ret_gran->CH4_eff_press[0][0][0]);
if (statn != 0)
printf("Error %d reading field CH4_eff_press\n", statn);

statn = SWreadfield(swid, "CH4_VMR_eff", NULL, NULL, NULL,
(void *)&airs_ret_gran->CH4_VMR_eff[0][0][0]);
if (statn != 0)
printf("Error %d reading field CH4_VMR_eff\n", statn);

statn = SWreadfield(swid, "CH4_VMR_eff_err", NULL, NULL, NULL,
(void *)&airs_ret_gran->CH4_VMR_eff_err[0][0][0]);
if (statn != 0)
printf("Error %d reading field CH4_VMR_eff_err\n", statn);

statn = SWreadfield(swid, "CH4_verticality", NULL, NULL, NULL,
(void *)&airs_ret_gran->CH4_verticality[0][0][0]);
if (statn != 0)
printf("Error %d reading field CH4_verticality\n", statn);

statn = SWreadfield(swid, "CH4_dof", NULL, NULL, NULL,
(void *)&airs_ret_gran->CH4_dof[0][0]);
if (statn != 0)
printf("Error %d reading field CH4_dof\n", statn);

statn = SWreadfield(swid, "PTropopause", NULL, NULL, NULL,
(void *)&airs_ret_gran->PTropopause[0][0]);
if (statn != 0)
printf("Error %d reading field PTropopause\n", statn);

statn = SWreadfield(swid, "T_Tropopause", NULL, NULL, NULL,
(void *)&airs_ret_gran->T_Tropopause[0][0]);
if (statn != 0)
printf("Error %d reading field T_Tropopause\n", statn);

statn = SWreadfield(swid, "GP_Tropopause", NULL, NULL, NULL,
(void *)&airs_ret_gran->GP_Tropopause[0][0]);
if (statn != 0)
printf("Error %d reading field GP_Tropopause\n", statn);

statn = SWreadfield(swid, "GP_Height", NULL, NULL, NULL,
(void *)&airs_ret_gran->GP_Height[0][0][0]);
if (statn != 0)
printf("Error %d reading field GP_Height\n", statn);

statn = SWreadfield(swid, "GP_Height_MWOnly", NULL, NULL, NULL,
(void *)&airs_ret_gran->GP_Height_MWOnly[0][0][0]);
if (statn != 0)
printf("Error %d reading field GP_Height_MWOnly\n", statn);

statn = SWreadfield(swid, "GP_Surface", NULL, NULL, NULL,
(void *)&airs_ret_gran->GP_Surface[0][0]);
if (statn != 0)
printf("Error %d reading field GP_Surface\n", statn);

statn = SWreadfield(swid, "Qual_Cloud_OLR", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_Cloud_OLR[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_Cloud_OLR\n", statn);

statn = SWreadfield(swid, "numCloud", NULL, NULL, NULL,
(void *)&airs_ret_gran->numCloud[0][0]);
if (statn != 0)
printf("Error %d reading field numCloud\n", statn);

statn = SWreadfield(swid, "TCldTopStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->TCldTopStd[0][0][0]);
if (statn != 0)
printf("Error %d reading field TCldTopStd\n", statn);

statn = SWreadfield(swid, "TCldTopStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->TCldTopStdErr[0][0][0]);
if (statn != 0)
printf("Error %d reading field TCldTopStdErr\n", statn);

statn = SWreadfield(swid, "PCldTopStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->PCldTopStd[0][0][0]);
if (statn != 0)
printf("Error %d reading field PCldTopStd\n", statn);

statn = SWreadfield(swid, "PCldTopStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->PCldTopStdErr[0][0][0]);
if (statn != 0)
printf("Error %d reading field PCldTopStdErr\n", statn);

statn = SWreadfield(swid, "CldFrcStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->CldFrcStd[0][0][0][0][0]);
if (statn != 0)
printf("Error %d reading field CldFrcStd\n", statn);

statn = SWreadfield(swid, "CldFrcStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->CldFrcStdErr[0][0][0][0][0]);
if (statn != 0)
printf("Error %d reading field CldFrcStdErr\n", statn);

statn = SWreadfield(swid, "olr", NULL, NULL, NULL,
(void *)&airs_ret_gran->olr[0][0]);
if (statn != 0)
printf("Error %d reading field olr\n", statn);

statn = SWreadfield(swid, "olr_err", NULL, NULL, NULL,
(void *)&airs_ret_gran->olr_err[0][0]);
if (statn != 0)
printf("Error %d reading field olr_err\n", statn);

statn = SWreadfield(swid, "Qual_clrolr", NULL, NULL, NULL,
(void *)&airs_ret_gran->Qual_clrolr[0][0]);
if (statn != 0)
printf("Error %d reading field Qual_clrolr\n", statn);

statn = SWreadfield(swid, "clrolr", NULL, NULL, NULL,
(void *)&airs_ret_gran->clrolr[0][0]);
if (statn != 0)
printf("Error %d reading field clrolr\n", statn);

statn = SWreadfield(swid, "clrolr_err", NULL, NULL, NULL,
(void *)&airs_ret_gran->clrolr_err[0][0]);
if (statn != 0)
printf("Error %d reading field clrolr_err\n", statn);

statn = SWreadfield(swid, "dust_flag", NULL, NULL, NULL,
(void *)&airs_ret_gran->dust_flag[0][0][0][0]);
if (statn != 0)
printf("Error %d reading field dust_flag\n", statn);

statn = SWreadfield(swid, "spectral_clear_indicator", NULL, NULL, NULL,
(void *)&airs_ret_gran->spectral_clear_indicator[0][0][0][0]);
if (statn != 0)
printf("Error %d reading field spectral_clear_indicator\n", statn);

statn = SWreadfield(swid, "num_clear_spectral_indicator", NULL, NULL, NULL,
(void *)&airs_ret_gran->num_clear_spectral_indicator[0][0]);
if (statn != 0)
printf("Error %d reading field num_clear_spectral_indicator\n", statn);

statn = SWreadfield(swid, "CC_noise_eff_amp_factor", NULL, NULL, NULL,
(void *)&airs_ret_gran->CC_noise_eff_amp_factor[0][0]);
if (statn != 0)
printf("Error %d reading field CC_noise_eff_amp_factor\n", statn);

statn = SWreadfield(swid, "CC1_noise_eff_amp_factor", NULL, NULL, NULL,
(void *)&airs_ret_gran->CC1_noise_eff_amp_factor[0][0]);
if (statn != 0)
printf("Error %d reading field CC1_noise_eff_amp_factor\n", statn);

statn = SWreadfield(swid, "totCldH2OStd", NULL, NULL, NULL,
(void *)&airs_ret_gran->totCldH2OStd[0][0]);
if (statn != 0)
printf("Error %d reading field totCldH2OStd\n", statn);

statn = SWreadfield(swid, "totCldH2OStdErr", NULL, NULL, NULL,
(void *)&airs_ret_gran->totCldH2OStdErr[0][0]);
if (statn != 0)
printf("Error %d reading field totCldH2OStdErr\n", statn);

statn = SWreadfield(swid, "CC1_Resid", NULL, NULL, NULL,
(void *)&airs_ret_gran->CC1_Resid[0][0]);
if (statn != 0)
printf("Error %d reading field CC1_Resid\n", statn);

statn = SWreadfield(swid, "CCfinal_Resid", NULL, NULL, NULL,
(void *)&airs_ret_gran->CCfinal_Resid[0][0]);
if (statn != 0)
printf("Error %d reading field CCfinal_Resid\n", statn);

statn = SWreadfield(swid, "CCfinal_Noise_Amp", NULL, NULL, NULL,
(void *)&airs_ret_gran->CCfinal_Noise_Amp[0][0]);
if (statn != 0)
printf("Error %d reading field CCfinal_Noise_Amp\n", statn);

statn = SWreadfield(swid, "Tdiff_IR_MW_ret", NULL, NULL, NULL,
(void *)&airs_ret_gran->Tdiff_IR_MW_ret[0][0]);
if (statn != 0)
printf("Error %d reading field Tdiff_IR_MW_ret\n", statn);

statn = SWreadfield(swid, "Tdiff_IR_4CC1", NULL, NULL, NULL,
(void *)&airs_ret_gran->Tdiff_IR_4CC1[0][0]);
if (statn != 0)
printf("Error %d reading field Tdiff_IR_4CC1\n", statn);

statn = SWreadfield(swid, "TSurfdiff_IR_4CC1", NULL, NULL, NULL,
(void *)&airs_ret_gran->TSurfdiff_IR_4CC1[0][0]);
if (statn != 0)
printf("Error %d reading field TSurfdiff_IR_4CC1\n", statn);

statn = SWreadfield(swid, "TSurfdiff_IR_4CC2", NULL, NULL, NULL,
(void *)&airs_ret_gran->TSurfdiff_IR_4CC2[0][0]);
if (statn != 0)
printf("Error %d reading field TSurfdiff_IR_4CC2\n", statn);

statn = SWreadfield(swid, "AMSU_Chans_Resid", NULL, NULL, NULL,
(void *)&airs_ret_gran->AMSU_Chans_Resid[0][0]);
if (statn != 0)
printf("Error %d reading field AMSU_Chans_Resid\n", statn);

statn = SWreadfield(swid, "TotCld_4_CCfinal", NULL, NULL, NULL,
(void *)&airs_ret_gran->TotCld_4_CCfinal[0][0]);
if (statn != 0)
printf("Error %d reading field TotCld_4_CCfinal\n", statn);

statn = SWreadfield(swid, "Surf_Resid_Ratio", NULL, NULL, NULL,
(void *)&airs_ret_gran->Surf_Resid_Ratio[0][0]);
if (statn != 0)
printf("Error %d reading field Surf_Resid_Ratio\n", statn);

statn = SWreadfield(swid, "Temp_Resid_Ratio", NULL, NULL, NULL,
(void *)&airs_ret_gran->Temp_Resid_Ratio[0][0]);
if (statn != 0)
printf("Error %d reading field Temp_Resid_Ratio\n", statn);

statn = SWreadfield(swid, "Water_Resid_Ratio", NULL, NULL, NULL,
(void *)&airs_ret_gran->Water_Resid_Ratio[0][0]);
if (statn != 0)
printf("Error %d reading field Water_Resid_Ratio\n", statn);

statn = SWreadfield(swid, "Cloud_Resid_Ratio", NULL, NULL, NULL,
(void *)&airs_ret_gran->Cloud_Resid_Ratio[0][0]);
if (statn != 0)
printf("Error %d reading field Cloud_Resid_Ratio\n", statn);

statn = SWreadfield(swid, "O3_Resid_Ratio", NULL, NULL, NULL,
(void *)&airs_ret_gran->O3_Resid_Ratio[0][0]);
if (statn != 0)
printf("Error %d reading field O3_Resid_Ratio\n", statn);

statn = SWreadfield(swid, "CO_Resid_Ratio", NULL, NULL, NULL,
(void *)&airs_ret_gran->CO_Resid_Ratio[0][0]);
if (statn != 0)
printf("Error %d reading field CO_Resid_Ratio\n", statn);

statn = SWreadfield(swid, "CH4_Resid_Ratio", NULL, NULL, NULL,
(void *)&airs_ret_gran->CH4_Resid_Ratio[0][0]);
if (statn != 0)
printf("Error %d reading field CH4_Resid_Ratio\n", statn);

statn = SWreadfield(swid, "MWCheck_Resid_Ratio", NULL, NULL, NULL,
(void *)&airs_ret_gran->MWCheck_Resid_Ratio[0][0]);
if (statn != 0)
printf("Error %d reading field MWCheck_Resid_Ratio\n", statn);

statn = SWreadfield(swid, "O3_dof", NULL, NULL, NULL,
(void *)&airs_ret_gran->O3_dof[0][0]);
if (statn != 0)
printf("Error %d reading field O3_dof\n", statn);

statn = SWreadfield(swid, "all_spots_avg", NULL, NULL, NULL,
(void *)&airs_ret_gran->all_spots_avg[0][0]);
if (statn != 0)
printf("Error %d reading field all_spots_avg\n", statn);

statn = SWreadfield(swid, "MW_ret_used", NULL, NULL, NULL,
(void *)&airs_ret_gran->MW_ret_used[0][0]);
if (statn != 0)
printf("Error %d reading field MW_ret_used\n", statn);

statn = SWreadfield(swid, "Initial_CC_score", NULL, NULL, NULL,
(void *)&airs_ret_gran->Initial_CC_score[0][0]);
if (statn != 0)
printf("Error %d reading field Initial_CC_score\n", statn);

statn = SWreadfield(swid, "retrieval_type", NULL, NULL, NULL,
(void *)&airs_ret_gran->retrieval_type[0][0]);
if (statn != 0)
printf("Error %d reading field retrieval_type\n", statn);

statn = SWreadfield(swid, "Startup", NULL, NULL, NULL,
(void *)&airs_ret_gran->Startup[0][0]);
if (statn != 0)
printf("Error %d reading field Startup\n", statn);


/* Final clean-up */
statn = SWdetach(swid);
if (statn != 0) printf("Error detaching from input file %s\n", file_name);

statn = SWclose(fid);
if (statn != 0) printf("Error closing input file %s\n", file_name);
}

Document Actions
NASA Logo - nasa.gov
NASA Privacy Policy and Important Notices
Last updated: Sep 09, 2009 02:25 PM ET
Top