In this directory (/glade/u/home/joemci/SW/IDL/WACCM/Trends) determination and evaluation of trends in a WACCM-X run from 1955 to
2005 is done.  Variables to examine are CO2, temperature, density, and atomic hydrogen with more possibly added as we go.  

waccmx_50yr_monthly_levs.pro:

The first step was to read the 51 years of data and take a first cut at a monthly global mean.  This is done in the IDL routine 
waccmx_50yr_monthly_levs.pro where, first a mean at the equator was done then a global mean for CO2 and temperature.  The results
are plotted with simple line plots vs month for 4 pressure levels from the surface to the thermosphere.  The results are also
printed to the screen and passed to the MATLAB regression algorithm Jiuhou ran. 

The geometric height was also calculated from the WACCM-X geometric altitude and was used to check for top altitude of the model
for each of the 51 years to determine how high a trend can be determined using monthly means.

Also, in this routine, the mean for zonal wind at the equator for the same 4 pressure levels was done to look at the QBO effect in
the thermosphere.  The plots were given to Hanli but we decided to concentrate on the trend and save the QBO study for later.

code_forjoe_2dfitting.m:

This is Jiuhou code which does the regression and fitting analysis in MATLAB.  The results for the above method were copied from
the screen and put into text files and those are input to this method.  This calculates the regression coefficients and fit,
differences the fit and original input to get the residuals, and plots and fits the residuals to get a trend.  The montly results
are plotted by this routine and show a trend.  The independent variables used in this fit are f10.7, ap, and f10.7*f10.7.  Those
came from the method below.

waccmx_solar_f107_ap_monthly_yearly.pro:

This routine calculates the monthly and yearly mean f10.7 and ap from the WACCM-X files used as inputs for the 51 year run.  The
monthly means were used by the above regression analysis method.  The yearly means are used by the routine below.

waccmx_50yr_yearly_pres.pro:

This routine reads the 51 year files one month at a time and calculates an area weighted monthly global mean for CO2 and
temperature for each vertical pressure level.  The yearly global mean is then calculated from the montly global means for each
year.  Then a regression analysis is done for monthly and yearly global means and the fits are subtracted from the input global
means to get residuals for monthly and yearly data.  Then the residuals are fitted through the 51 years.  Simple line plot
commands of residuals overlayed by fit shows trend.
