//------------------------------------------------------------------------- // NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS //------------------------------------------------------------------------- //BOP // !ROUTINE: main --- Driver for the QuADS. // !INTERFACE: int main(argc, **argv) // !INPUT PARAMETERS: int argc; // number of arguments char **argv; // file names that contain the datasets // to be checked, // last day's datasets, and datasets from NCEP. // !DESCRIPTION: Main driver. // !REVISION HISTORY: // 31Jan98 Baoyu Yin Initial Code. //EOP //------------------------------------------------------------------------- // NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS //------------------------------------------------------------------------- //BOP // !ROUTINE: climatology_check--compares the data with climatological mean. // !INTERFACE: void climatology_check ( VarNew, VarCl, VarDe, *varname, Lx, Ly, Lz, It, *date, distr) // !INPUT PARAMETERS: float DATAP4 VarNew; // data to be checked float DATAP4 VarCl; // climatology float DATAP4 VarDe; // deviation int Lx; // max latitude int Ly; // max longitude int Lz; // max level int It; // indicates time step char distr // indicates distribution function char *varname; // indicates the current variable name in this // check function char *date; // indicates the date in the file name. // e.g. 19980701 // !DESCRIPTION: // In this check function, we compare the data sets produced // by the GEOS-DAS Core system with climatological means by using // statistical techniques. If an error is found within a variable // field, QuADS writes the name of the variable, the value of the // variable which is found to be in error, the DAS time and grid // location of the variable to a file (Error File). // A gif image will be created if this check finds some values // which go out of reasonable ranges. (The name of the gif image // would be climatology\_check\_varname\_lz\_date\_It) // !REVISION HISTORY: // 31Jan1998 Baoyu Yin Initial Code. //EOP //------------------------------------------------------------------------- // NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS //------------------------------------------------------------------------- //BOP // !ROUTINE: hydrostatic_check -- check hydrostatic equilibrium // !INTERFACE: void hydrostatic_check( Hght, Tmpu, Lx, Ly, Lz, It, *date) // !INPUT PARAMETERS: float DATAP4 Hght; // geopotential height float DATAP4 Tmpu; // temperature int Lx; // max latitude int Ly; // max longitude int Lz; // max level int It; // indicates time step char *date // indicates the date in the file name. // e.g. 19980701 // !DESCRIPTION: // The relationship between temperature (Tmpu) and geopotential // height (Hght) should be checked. // Two gif images will be created if this check finds some values // which go out of reasonable ranges. (The names of the gif images // would be Hght\_lz\_date\_It and Tmpu\_lz\_date\_It) // !REVISION HISTORY: // 31Jan1998 Baoyu Yin Initial Code. //EOP //------------------------------------------------------------------------- // NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! //------------------------------------------------------------------------- //BOP // !ROUTINE: positive_check -- make sure humidity, precipitation are positive // !INTERFACE: void positive_check( VarNew, *varname, Lx, Ly, Lz, It, *date) // !INPUT PARAMETERS: float DATAP4 VarNew; // data to be checked int Lx; // max latitude int Ly; // max longitude int Lz; // max level int It; // indicates time step char *date; // indicates the date in the file name. // e.g. 19980701 char *varname; // indicates the current variable name in this // check function // !DESCRIPTION: // QuADS verifies the GEOS-DAS data fields of specific humidity, relative // humidity, and precipitation are positive. // !REVISION HISTORY: // 31Jan1998 Baoyu Yin Initial Code. //EOP //------------------------------------------------------------------------- // NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! //------------------------------------------------------------------------- //BOP // !ROUTINE: time_rate_check --compares data at time t with data at time t-1. // !INTERFACE: void time_rate_check( VarNew, VarOld, VarRateDe, *varname, Lx, Ly, Lz, It, *date) // !INPUT PARAMETERS: float DATAP4 VarNew; // data to be checked float DATAP4 VarOld; // data at time t-1 float DATAP4 VarRateDe; // deviation int Lx; // max latitude int Ly; // max longitude int Lz; // max level int It; // indicates time step char *varname; // indicates the current variable name in this // check function char *date; // indicates the date in the file name. // e.g. 19980701 // !DESCRIPTION: // This time-rate\_check function compares the data sets produced by // the GEOS-DAS Core System with time-rate-of-change climatological // means using statistical techniques. // A gif image will be created if this check finds some values // which go out of reasonable ranges. (The name of the gif image // would be timeratecheck\_varname\_lz\_date\_It) // !REVISION HISTORY: // 31Jan1998 Baoyu Yin Initial Code. //EOP //------------------------------------------------------------------------- // NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! //------------------------------------------------------------------------- //BOP // !ROUTINE: correlation_check -- computes the correlation between GEOS-3 // !INTERFACE: void correlation_check( VarNew, VarNcep, *varname, Lx, Ly, Lz, It, *date) // !INPUT PARAMETERS: float DATAP4 VarNew; // data to be checked float DATAP4 VarNcep // NCEP data int Lx; // max latitude int Ly; // max longitude int Lz; // max level int It; // indicates time step char *varname; // indicates the current variable name in this // check function char *date; // indicates the date in the file name. // e.g. 19980701 // !DESCRIPTION: // The pattern correlation check function computes the correlation // coefficients between GEOS-DAS and NCEP data in three different regions. // If this check finds the correlation coefficients for a particular // variable are below a certain level, QuADS creates gif images of the // variable from both the GEOS-DAS and NCEP data. (The name of the gif // image would be correlationcheck\_DAS\_varname\_lz\_date\_It and // correlationcheck\_NCEP\_varname\_lz\_date\_It) // !REVISION HISTORY: //EOP //------------------------------------------------------------------------- // NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! //------------------------------------------------------------------------- //BOP // !ROUTINE: update // !INTERFACE: void update( VarNew, Lx, Ly, Lz, VarOld) // !INPUT PARAMETERS: float DATAP4 VarNew; // data to be checked int Lx; // max latitude int Ly; // max longitude int Lz; // max level // !INPUT/OUTPUT PARAMETERS: float DATAP4 VarOld; // Input: data at time t-1 // Output: data at time t // !DESCRIPTION: // Copy the value of VarNew at the time t to the space // of the time t-1 space VarOld. // !REVISION HISTORY: // 31Jan1998 Baoyu Yin Initial Code. //EOP //------------------------------------------------------------------------- // NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! //------------------------------------------------------------------------- //BOP // !ROUTINE: read_variable_new -- Read in the data to be checked // !INTERFACE: void read_variable_new( *filename, *varname, It, Lx, Ly, Lz, VarNew) // !INPUT PARAMETERS: int Lx; // max latitude int Ly; // max longitude int Lz; // max level int It; // indicates time step char *filename // filename that contains the data to be check char *varname; // indicates the current variable name in // this check function // OUTPUT PARAMETERS: float DATAP4 VarNew // data to be checked. // !DESCRIPTION: // Read in the data to be checked. // !REVISION HISTORY: // 31Jan1998 Baoyu Yin Initial Code. //EOP //------------------------------------------------------------------------- // NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS ! //------------------------------------------------------------------------- //BOP // !ROUTINE: variablename_h -- defines dimensions and other parameters. // !INTERFACE: #include "variablename_h" // !DESCRIPTION: // Defines dimensions and other parameters. // !REVISION HISTORY: // 31Jan1998 Baoyu Yin Initial Code. //EOP #ifndef variablename_h #define variablename_h FILE *filename; // filename which contains // the datasets to be checked FILE *oldfilename; // filename which contains // last day's datasets FILE *filenamencep; // filename which contains NCEP's data FILE *writeout; // filename which contains error // information about GEOS-3 data const int TOTALVAR = 8; // total variables in this data file const int Lx = 144; // max latitude const int Ly = 91; // max longitude const int Lz = 36; // max level const int Lt = 4; // max number of time steps typedef char charlong[62]; charlong tsyn3d_mis_p; //string for filename charlong oldtsyn3d_mis_p; //string for last day's filename charlong tsyn3d_mis_pncep; //string for NCEP's filename typedef float DATAP4[36][91][144]; static DATAP4 VarNew; // data to be checked static DATAP4 VarOld; // data at time t-1 static DATAP4 VarNcep; // NCEP's data static DATAP4 Hght; // geopotential height static DATAP4 Tmpu; // temperature const DATAP4 VarCl; // climatology const DATAP4 VarDe; // deviation const DATAP4 VarRateDe; // tendency deviation char *varname[]={"sphu","tke","tmpu","omega","rh",\ "hght", "uwnd","vwnd"}; char *phght="hght", *ptmpu="tmpu"; #endif