Index of /~ines/My_Softwares/GCM_Bias_Corr2_Ver0.4a
Name Last modified Size Description
Parent Directory -
example/ 01-Oct-2008 16:05 -
readme/ 30-Jul-2010 11:06 -
src/ 01-Oct-2008 13:08 -
<!!!NEW!!!> codes now available in SRC folder, pls acknowledge:
Ines, A.V.M. and J.W. Hansen. 2006. Bias correction of daily GCM rainfall for crop simulation studies. Agricultural and Forest
Meteorology. 138: 44-53.
Ines, A.V.M., Hansen, J.W. and A.W. Robertson. 2010. Enhancing the utility of daily GCM rainfall for crop yield prediction.
International Journal of Climatology (in press, DOI: 10.1002/joc.2223).
NOTE: The updated code (GCM_Bias_Corr2_Ver0.4b) i used for IJOC paper can be requested from me (firstname.lastname@example.org)
First DRAFT: 04/06/2004 - AVM Ines
Disclaimer: The programs/doc are not guaranteed to be error-free. Please report bugs/errors to me.
A. GCM Bias Correction Tool Version 0.4a
The GCM bias correction tool corrects the bias of the daily GCM rainfall in two steps: first, it corrects the bias of the
rainfall frequency by truncating the empirical distribution of the GCM daily rainfall based on the non-exceedence probability
F(x_historical=0.0), and then corrects the rainfall intensity by mapping the cumulative distribution functions (CDFs) of the
truncated non-zero rainfall days (i.e. CDF_gcm -> CDF_historical). The mapping can be done using an empirical-gamma or gamma-
gamma transformations. The tool is also capable of doing a simple multiplicative scaling using the factor x_historical/x_gcm to
correct the bias of the mean monthly rainfall. The program can accept raw daily GCM data based on the IRI-data library free
format (one-grid), and based on cleaned data format dd-mm-yr-data. The historical data should be in WTD format (DSSAT
weather data format)
A.2 Command line:
USAGE: <Command> <file1> <file2> <param1> <param2> <param3> <param4> <param7> <param5> <param6>
<file1>: Weather file in WTD format (4-digit year)
<file2>: GCM data, IRI data library free format, cleaned format: dd-mm-yr-data(m/s), NOTE: 2 header lines
<param1>: year1 - starting year of analysis, 4-digit code, e.g. 1970
<param2>: year2 - ending year (+ 1), e.g. 1999 if you want 1998 for analysis
<param3>: DOY1 - start of Month1, non-leap year
<param4>: DOY2 - end of Month2, non-leap year
<param7>: thresh - rainfall threshold (mm) !!!NEW!!! 3/26/2008
<param5>: emp_gamma(=0,gamma-gamma),(=1,emperical-gammma),(=2,mult. adjustment)
<param6>: formt(=0,raw daily GCM IRI free format),(=1,cleaned dd-mm-yr-data)
Example: GCM_Bias_Corr2 katu_gcm.wtd mem1.txt 1970 1996 1 365 0 0
NOTE: even if no switch for [data format] is given e.g. above, it can automatically determine which GCM data format it is.
Say your gcm data is contained in gcm.txt (downloaded from IRI Data Library, free format, one-grid)
gcm.pcp - time series of uncorrected gcm data (year+doy, data)
gcm_c.pcp - corrected gcm data with auxilliary outputs (year,doy,corr_pcp,F(x),posit_untrancated,posit_truncated,alpha_his,
gcm_cd.pcp - numerical values of corrected gcm pcp alone...for export to WTD format.
NOTE: no_ppt(month) - the amount of rainfall from gcm data equivalent to zero rainfall in historical data
B. BiasCorrect2WTD: Export tool for WTD format
Exports gcm_cd.pcp to WTD format for use to DSSAT programs. The tool uses a datafile that contains the conditional (wet/dry)
means of TMIN, TMAX, SRAD e.g. Katu_means.txt below.
1970 1 365 1 1 !start year, doy1, doy2, no. of stations, target station
26.21 27.78 27.78 25.85 25.00 23.34 22.26 22.75 25.54 26.75 25.09 24.90 !TmaxDry
24.45 26.07 26.47 25.33 24.08 22.38 21.09 22.43 23.48 25.31 23.65 23.68 !TmaxWet
13.06 13.07 14.21 14.34 13.69 11.95 10.75 11.11 11.43 13.15 14.25 13.68 !TminDry
14.48 14.42 14.97 15.19 14.51 12.78 11.34 10.8 11.01 14.08 14.75 14.82 !TminWet
22.90 23.40 23.70 21.00 17.60 15.00 15.30 16.30 19.00 21.70 20.00 22.60 !SradDry
18.90 20.80 20.40 17.90 15.10 12.50 13.50 16.10 18.40 17.20 17.30 17.30 !SradWet
where the parameters at the top row of the data consist of the starting year of bias correction, starting day-of-year and the
ending day-of-year, number of stations (this was adopted from HMM_WTD <***!can be requested from me!***> which can accomodate
multiple columns/realizations of RAIN data) and the specific station you want to archive. doy1 and doy2 can be any values
between 1-365, e.g. 60-212. Columns contain conditional monthly data.
B.2 Command line:
USAGE: <Command> <file1> <file2> <param1> <param2> <param3>
<file1>: Bias correction output
<file2>: Monthly conditional means of TMAX, TMIN and SRAD and parameters
<param1>: Length of each sequence (non_leap_year)
<param2>: No. of sequence/years
<param3>: No. of realizations (1-for Bias correction)
<param4>: switch to invoke learyear lead or not - 0 (yes, default) or 1 (no)
Example: BiasCorrect2WTD mem1._cd.pcp KATU_means.txt 365 26 1
NOTE: if the switch for invoking leap/non-leap year is " ", it's automatic that leap year is activated e.g. the above example
NOTE NOTE NOTE !!!!
If you change doy1 and doy2 in GCM_Bias_Corr2, change also doy1 and doy2 in XXXX_means.txt , and <param1> (i.e. L=doy2-doy1+1)
in BiasCorrect2WTD command-line parameters, otherwise the program exits. An indication is the undeleted key.tmp in the working
directory. Likewise, when you change the starting year in GCM_Bias_Corr2 change it also in XXXX_means.txt.
B.3 Output file(s):
XXXX00001.WTD - if <param3> = 1; XXXX – the first four letters of <file2>
Currently BiasCorrect2WTD cannot handle exporting if doy1 is greater than doy2 (e.g. 340-31). However, GCM_Bias_Corr2 can handle
this situation so to proceed with bias correction, disable BiasCorrect2WTD in the batch file. You may use WeatherMan instead to
export all gcmXXX_cd.pcp files.
A fix for this limitation is now available, pls contact me: email@example.com
C. TRY ME?
bias_gamma_gamma_ex.bat - illustrates the bias correction tool+exporting the file to WTD for one GCM-ensemble member
bias_gamma_gamma.bat – runs 24-ensemble members (download data from IRI-data library or can be requested from me, 469KB each!)
Direct to: firstname.lastname@example.org