/* regression to tracer data created June 1998 CGE*/

procedure; /*tracer_reg.rpl*/

/* set up arrays to hold SQL select criteria */

call newrow(cell_c,1,'Sparging/Venting');

call newrow(cell_c,2,'In Well Aeration');

call newrow(cell_c,3,'Co-Solvent Mob.');

call newrow(cell_c,4,'Macromolecular');

call newrow(cell_c,5,'Surfactant Mob.');

call newrow(cell_c,6,'Surfactant Solub.');

call newrow(cell_c,7,'Steam');

call newrow(cell_c,8,'Micro Emulsion');

call newrow(cell_c,'f','Co-solvent Solub.');

call newrow(chem, 'br','bromide',0,0.5);/* code, chemical, partition coefficient, detection limit */

call newrow(chem, 'meth','methanol',0,1);/* code, chemical, partition coefficient, detection limit*/

call newrow(chem, 'tba','tert butanol',.14,1);/* code, chemical, partition coefficient, detection limit*/

call newrow(chem, 'dmp_2_2','2,2-dimethyl-3-pentanol',7.44,1); /* code, chemical, partition coefficient, detection limit*/

call newrow(chem, 'methep','6-methyl-3-heptanol',48.8,.1);/* code, chemical, partition coefficient, detection limit*/

call newrow(chem, 'hex','hexanol',2.07,1);/*code, chemical, partition coefficient, detection limit*/

call newrow(chem, 'methex_3','3-methyl-hexanol',4.47,1);/* code, chemical, partition coefficient, detection limit*/

 

t_type[1]='pre_pt';

t_type[2]='post_pt';

 

call newrow(depth_c,1,'screen','SCREEN');

call newrow(depth_c,2,'blk','BLK');

call newrow(depth_c,3,'blu','BLU');

call newrow(depth_c,4,'red','RED');

call newrow(depth_c,5,'yel','YEL');

call newrow(depth_c,6,'grn','GRN');

call newrow(depth_c,7,'wht','WHT');

call newrow(depth_c,8,'orn','ORN');

call newrow(depth_c,9,'clr','CLR');

call newrow(object_t,4,'Inj Well');

call newrow(object_t,1,'MLS Row 1');

call newrow(object_t,2,'MLS Row 2');

call newrow(object_t,3,'MLS Row 3');

call newrow(object_t,5,'Ext Well');

 

/*connect to the data base*/

tst=exd$open(connect,"SERDP",empty,'');

/*

create table _list

*/

tbl_lst[1]='tblFluid_sample_chemistry';

f_lst=exd$list(connect,"cols",tbl_lst[1],c_list);

/* type f_lst;*/

exd$close(connect);

/*

generate common column list to be extracted from data base

*/

allocate table(col_lst) 7 rows by 3 columns;

col_lst[1,0]=cat(tbl_lst[1],'.cell_id');

col_lst[2,0]=cat(tbl_lst[1],'.object_type');

col_lst[3,0]=cat(tbl_lst[1],'.test_type');

col_lst[4,0]=cat(tbl_lst[1],'.start_date_time');

col_lst[5,0]=cat(tbl_lst[1],'.object_id');

col_lst[6,0]=cat(tbl_lst[1],'.color_depth_id');

 

/*

; subscript i is for the cell

; subscript j is for the chemical

; subscript k is for the object_type

; subscript l is for the object_id

; subscript m is fot the color_depth_code

; subscript o is for test_type

*/

DO i=1 to 9; /* loop for cell */

DO k=5 TO 5; /* loop for object type */

DO l=1 to 3; /* loop for object_id */

DO m=1 to 1; /* loop for depth code*/

 

DO o=1 TO 2; /* do pre_pt before post_pt*/

test_type=t_type[o,0];

type nocr 'test_type = ', test_type;

type nocr '

';

/* initialize case for chemical loopint */

case=0; /* case is set to 1 when first conservative tracer has been found*/

DO j=1 TO 7; /*loop for chemical*/

type nocr 'cell = ',i,' obj type = ',k,' obj id = ',l,' test type = ',o,' chem = ',j,' case = ',case;

type '

';

/* once conservative tracer is found skip chemicals to reactive tracers beginning at j = 4 */

if ( case >0 and j < 4 ) then goto cont;

 

 

/*

determine the correct travel path length

*/

if ((k=2 or k=3 or k=4) and l=1) then length = 5/6;

if ((k=2 or k=3 or k=4) and l=2) then length = 10/6;

if ((k=2 or k=3 or k=4) and l=3) then length = 15/6;

if ((k=2 or k=3 or k=4) and l=4) then length = 20/6;

if k=5 then length=25/6;

/* type length;*/

/*

complete col lst

*/

set col_lst[7,0]=cat(tbl_lst[1],'.',chem[j,0]);

set col_lst[8,0]=cat(tbl_lst[1],'.',chem[j,0],'_flag');

 

/*

add the rest of the columns required in the table (col_lst) to describe data read function

*/

DO n=1 TO lastrow (col_lst);

leng=chars(col_lst[n,0]);

locp=loc(".",col_lst[n,0]);

set col_lst[n,1] to ext(locp+1,leng,col_lst[n,0]);

test_val= col_lst[n,1];

array1 = table(c_list) where col 1 = test_val;

value = $tpfetch(array1,false,1,2);

r_num=tbl$rowindex(c_list,0,col_lst[n,0]);

set col_lst[n,2] to c_list[r_num,2];

end;

 

display table(col_lst);

/*

create where clause

*/

where_cl= cat("where ",col_lst[1]," like '",cell_c[i,0],"' and ",

col_lst[2]," like '", k ,"' and ",col_lst[3]," like '",

t_type[o,0],"' and ",col_lst[5]," like '", l ,"' and (",

col_lst[7], " > 0 or ", col_lst[8]," like 'bdl') and ",

col_lst[4]," > 0 and ",col_lst[6], " like '", depth_c[m,1] ,"'" ) ;

type where_cl;

/*

remove existing data tables

*/

if tableexists('data') then delete 'data';

/*

connect to the data base

*/

tst=exd$open(connect,"SERDP",empty,'');

/*

read the data if data exists sort by time and rename into a shareable table named data increment the case flag

to indicate first conservative tracer set has been found

*/

r_flag=exd$read(connect,'data',tbl_lst,col_lst,where_cl);

exd$close(connect);

type r_flag;

type nocr 'number of rows of data ',lastrow('data');

type '

';

if r_flag eq 'False' then doexit;

if (lastrow('data') < 10 and j > 3) then goto skip; /* require at least 10 points */

if (lastrow('data') < 10 and j < 4) then goto cont;

if(case<2) then case = case+1;

sort table('data') inplace by col 3;

 

/*

determine initial time, concentration, and pulse duration from 'data' base use this time if available otherwise assume

first observation is starting time

*/

s_t = start_t(cell_c[i,0],chem[j,0],t_type[o,0]);

/* initialize default values to be used when data is not available */

display table(s_t);

t0=0.15;

t0_max=.15;

t0_min=0.15;

c0=100;

st_t=DT$CVT2NUM('data'[1,3]);

st_t_flag=0;

test_val=lastrow(s_t);

/* replace defalut values with data where data is available. it is assumed that times will be available as a minimum*/

if test_val > 0 then

begin;

st_t=DT$CVT2NUM(s_t[1,4]);

end_t= DT$CVT2NUM(s_t[1,5]);

t0=(end_t-st_t)/86400; /*time for chemical pulse */

t0_max=t0;

t0_min=t0;

if (notempty(s_t[1,3])) then c0=s_t[1,3];

st_t_flag=1;

end;

/*

replace bdl with with 0.5*detection limit

*/

do ii=lastrow ('data') to 1 by -1;

value='data'[ii,7];

if (value = 'bdl') then 'data'[ii,6]=0.5*chem[j,3];

end;

set col 7 of table('data') to col 3 - st_t;

/*

set col 7 to time in days and offset first value by 1 second

*/

set col 7 of table('data') to ((dt$cvt2num(col 7 of table('data'))+1)/86400);

set row 0 col 7 of table('data') to 'e_t(hrs)';

 

/*

remove empties from 'data' set

*/

do ii=lastrow ('data') to 1 by -1;

value='data'[ii,6];

if (value = empty) then delete row ii of table('data');

end;

/*

a series of samples below detectible limits biasis the results of the inversions multiple bdl's

at the beginning and at the end of the test are removed

*/

detection=chem[j,3]*0.5;

do ii=lastrow ('data') to 2 by -1 while ('data'[ii-1,6] = detection);

delete row ii of table('data');

end;

do ii=1 to (lastrow ('data')-1) while('data'[ii,6] = detection);

end;

do jj=ii-1 to 1 by -1;

delete row jj of table ('data');

end;

/*

this concludes generating the 'data' set

*/

/*

plot the experimental data

*/

cur=1;

chem_name=chem[j,0];

call initial_data_plot(case,cur,chem_name);

/*

calculate the moments of exp data

*/

if case = 1 then table_name='moment1_d';

if case > 1 then table_name='moment2_d';

if tableexists(table_name) then delete table(table_name);

call moment('data',table_name,6,7,0);

 

/*

There is a significant probability that the lower concentrations are truncated and a significant amount of mass

arrives after it cn be detedted. To address this problem, we will attempt to extrapolate the data based on the last

quarter of the sample greater than detection limit points excluding the last point which may be a bdl. We will assume the

data fits an exponential curve. We will extrapolate only if there are a minimum of 12 samples. It is felt that less than

16 samples is inadequate for a reliable estimation. Col 6 is the concentration and col 7 is the elapsed time

*/

/*

if less than 16 points do not attempt to invert data

*/

if lastrow('data') < 12 then

begin;

case = case -1; /* reset case because there wasn't enough data to count */

goto cont;

end;

lrow = lastrow('data');

/*

create a scratch table for data to fit to exponential curve

*/

nrows=rndoff(lrow/4,0);

if tableexists('scratch_exp') then delete 'scratch_exp';

srow=lrow-nrows;

type nocr 'lrow = ',lrow.' srow = ',srow,' nrows = ',nrows;

type '

';

iii=1;

do kk = srow to lrow;

tp1= rows kk of table('data');

call $tp2t(tp1,'scratch_exp',iii,false,true);

iii= iii+1;

end;

set col 8 of table('scratch_exp') to log(col 6 of table ('scratch_exp'));

display table scratch_exp;

/*

fit scratch_exp data to to a line

*/

call public $tabfitline('scratch_exp',7,8,,anov_scratch_exp,coef_scratch_exp,

res_scratch_exp,false);

inters = coef_scratch_exp[1,2];

slope = coef_scratch_exp[2,2];

type nocr slope,' ',inters;

type '

';

/*

extrapolate data set to a concentration of 0.001 mg/l and place 10 equally spaced values between

last measurement and extrapolated time

*/

lstrow = lastrow('data');

type nocr 'number of rows of extrapolated data = ',lstrow, ' ', 'data'[lstrow,6];

type '

';

ftime= (log(0.001)-inters)/slope;

init_ext_time= 'data'[lstrow,7];

/* type nocr init_ext_time,' ftime = ',ftime;

type'

'; */

do iii = 1 to 10;

ctime='data'[lstrow,7] + iii*(ftime-init_ext_time)/10;

call setcell('data', lstrow+iii,7,ctime);

cvalue=exp(slope*ctime+inters);

call setcell('data', lstrow+iii,6,cvalue);

end;

/*

calculate the moments

*/

if case = 1 then table_name='moment1';

if case > 1 then table_name='moment2';

if tableexists(table_name) then delete table(table_name);

call moment('data',table_name,6,7,0);

/*

remove extrapolated values from the data table

*/

lrow=lastrow('data')-10;

if tableexists(temp) then delete table(temp);

make table (temp) from rows 1 to lrow of table('data');

delete table('data');

make table 'data' from table(temp);

/*

invert the data to the convective dispersive equation

*/

if (case > 1)then goto napl;

 

/*

initialize estimates for parameters

*/

kde=0;

kdmin=0;

kdmax=0;

fe=0;

fmin=0;

fmax=0;

call Conv_Dis_lsf(t0,t0_min,t0_max,c0,kde,kdmin,kdmax,fe,fmin,fmax,length);

 

/*

plot fitted function on tmp_gr

*/

call add_funct(case,cur);

 

/*

create display parameter table

*/

call display_tbl(case,cur,chem[j,0],chem[j,2]);

/*

start second pass of inversion leaving dispersion constant and fitting sigma

*/

cur=2;

 

call stat_lsf;

call add_funct(case,cur);

/*

create display parameter table

*/

call display_tbl(case,cur,chem[j,0],chem[j,2]);

 

 

goto cont;

/*

determine amount of napl

*/

napl:

if j < 4 then goto cont; /* first three chemicals are conservative not retarded */

cur = 1;

/*

initialize estimates for parameters

*/

kde=0;

kdmin=0;

kdmax=0;

fe=0;

fmin=0;

fmax=0;

call Conv_Dis_lsf(t0,t0_min,t0_max,c0,kde,kdmin,kdmax,fe,fmin,fmax,length);

 

/*

plot fitted function on tmp_gr

*/

call add_funct(case,cur);

 

/*

create display parameter table

*/

call display_tbl(case,cur,chem[j,0],chem[j,2]);

cur = 2;

call stat_lsf;

call add_funct(case,cur);

/*

create display parameter table

*/

call display_tbl(case,cur,chem[j,0],chem[j,2]);

/*

calculate sn using method of moments

*/

tp=row 2 col 2 of table('moment2')-t0/2;

tn=row 2 col 2 of table('moment1')-t0/2;

sn_num=(tp-tn);

sn_denom=tn*(chem[j,2]);

sn=sn_num/sn_denom;

sn_text=cat('e_Moment calculated Sn = ',sn);

tp=row 2 col 2 of table('moment2_d')-t0/2;

tn=row 2 col 2 of table('moment1_d')-t0/2;

sn_num=(tp-tn);

sn_denom=tn*(chem[j,2]);

sn=sn_num/sn_denom;

sn_text_d=cat('d_Moment calculated Sn = ',sn);

tp=row 2 col 2 of table('funct_1_moment2')-t0/2;

tn=row 2 col 2 of table('funct_1_moment1')-t0/2;

sn_num=(tp-tn);

sn_denom=tn*(chem[j,2]);

sn=sn_num/sn_denom;

sn_text_Model_1=cat('Model 1 moment calculated Sn = ',sn);

tp=row 2 col 2 of table('funct_2_moment2')-t0/2;

tn=row 2 col 2 of table('funct_2_moment1')-t0/2;

sn_num=(tp-tn);

sn_denom=tn*(chem[j,2]);

sn=sn_num/sn_denom;

sn_text_Model_2=cat('Model 2 moment calculated Sn = ',sn);

/*

moment text

*/

set format of col 2 of table('moment1_d') to "G(8.4)";

set format of col 2 of table('moment2_d') to "G(8.4)";

set format of col 3 of table('moment1_d') to "G(8.4)";

set format of col 3 of table('moment2_d') to "G(8.4)";

m1_0_text_d=row 2 col 1 of table('moment1_d');

m1_1_text_d=row 2 col 2 of table('moment1_d');

m1_text_d=cat('d_zero moment =',m1_0_text_d,' m1/m0 (days) = ',m1_1_text_d);

m2_0_text_d=row 2 col 1 of table('moment2_d');

m2_1_text_d=row 2 col 2 of table('moment2_d');

m2_text_d=cat('d_zero moment =',m2_0_text_d,' m1/m0 (days) = ',m2_1_text_d);

set format of col 2 of table('moment1') to "G(8.4)";

set format of col 2 of table('moment2') to "G(8.4)";

set format of col 3 of table('moment1') to "G(8.4)";

set format of col 3 of table('moment2') to "G(8.4)";

m1_0_text=row 2 col 1 of table('moment1');

m1_1_text=row 2 col 2 of table('moment1');

m1_text=cat('e_zero moment =',m1_0_text,' m1/m0 (days) = ',m1_1_text);

m2_0_text=row 2 col 1 of table('moment2');

m2_1_text=row 2 col 2 of table('moment2');

m2_text=cat('e_zero moment =',m2_0_text,' m1/m0 (days) = ',m2_1_text);

set format of col 2 of table('funct_1_moment1') to "G(8.4)";

set format of col 2 of table('funct_1_moment2') to "G(8.4)";

set format of col 3 of table('funct_1_moment1') to "G(8.4)";

set format of col 3 of table('funct_1_moment2') to "G(8.4)";

m3_0_text=row 2 col 1 of table('funct_1_moment1');/*conservative tracer model 1*/

m3_1_text=row 2 col 2 of table('funct_1_moment1');

m3_text=cat('model_1_m0 =',m3_0_text,' m1/m0 (days) = ',m3_1_text);

m4_0_text=row 2 col 1 of table('funct_1_moment2');/*retarded tracer model 1*/

m4_1_text=row 2 col 2 of table('funct_1_moment2');

m4_text=cat('model_1_m0 =',m4_0_text,' m1/m0 (days) = ',m4_1_text);

set format of col 2 of table('funct_2_moment1') to "G(8.4)";

set format of col 2 of table('funct_2_moment2') to "G(8.4)";

set format of col 3 of table('funct_2_moment1') to "G(8.4)";

set format of col 3 of table('funct_2_moment2') to "G(8.4)";

m5_0_text=row 2 col 1 of table('funct_2_moment1');/*conservative tracer model 2*/

m5_1_text=row 2 col 2 of table('funct_2_moment1');

m5_text=cat('model_2_m0 =',m5_0_text,' m1/m0 (days) = ',m5_1_text);

m6_0_text=row 2 col 1 of table('funct_2_moment2');/*retarded tracer model 2*/

m6_1_text=row 2 col 2 of table('funct_2_moment2');

m6_text=cat('model_2_m0 =',m6_0_text,' m1/m0 (days) = ',m6_1_text);

/*

create multigraph

*/

if tableexists ('multi_g@objects') then delete 'multi_g';

/*

remove all of the headers, row numbers, and column numbers from the objects

*/

call public $save_dismods('graph','conserv_gr1','noheader',true);

call public $save_dismods('graph','retd_gr1','noheader',true);

call public $save_dismods('table','conserv1','noheader',true);

call public $save_dismods('table','conserv1','norownumbers',false);

call public $save_dismods('table','conserv1','nocolnumbers',false);

call public $save_dismods('table','conserv1','noheadingline',false);

call public $save_dismods('table','conserv1','headingheight 1',false);

call public $save_dismods('table','conserv2','noheader',true);

call public $save_dismods('table','conserv2','norownumbers',false);

call public $save_dismods('table','conserv2','noheadingline',false);

call public $save_dismods('table','conserv2','headingheight 1',false);

call public $save_dismods('table','conserv2','nocolnumbers',false);

 

call public $save_dismods('table','retard1','noheader',true);

call public $save_dismods('table','retard1','norownumbers',false);

call public $save_dismods('table','retard1','nocolnumbers',false);

call public $save_dismods('table','retard1','noheadingline',false);

call public $save_dismods('table','retard1','headingheight 1',false);

call public $save_dismods('table','retard2','noheader',true);

call public $save_dismods('table','retard2','norownumbers',false);

call public $save_dismods('table','retard2','nocolnumbers',false);

call public $save_dismods('table','retard2','noheadingline',false);

call public $save_dismods('table','retard2','headingheight 1',false);

/*

format the tables for a reasonable number of significant digits

*/

set format of col 1 of table('conserv1') to "G(7.3)";

set format of col 1 of table('conserv2') to "G(7.3)";

set format of col 1 of table('retard1') to "G(7.3)";

set format of col 1 of table('retard2') to "G(7.3)";

set format of col 2 of table('conserv1') to "G(7.3)";

set format of col 2 of table('conserv2') to "G(7.3)";

set format of col 2 of table('retard1') to "G(7.3)";

set format of col 2 of table('retard2') to "G(7.3)";

/*

place data into a master table of results named "tracer_res"

*/

conserv_cur_n=row 1 col 1 of table('conserv_gr1@curves');

row_name = cat(t_type[o],cell_c[i,0],'_',k,l,depth_c[m,1],

conserv_cur_n,'_',chem[j,0]);

tp_exists=tbl$rowmatch(row_name, 'tracer_res',0,false);

type nocr 'tp_exists = ',pt_exists;

type '

';

if (tp_exists = 0) then call newrow('tracer_res',row_name);

set row row_name col 1 of table('tracer_res') to row 1 col 1 of table('conserv1');

set row row_name col 2 of table('tracer_res') to row 1 col 2 of table('conserv1');

set row row_name col 3 of table('tracer_res') to row 2 col 1 of table('conserv1');

set row row_name col 4 of table('tracer_res') to row 2 col 2 of table('conserv1');

set row row_name col 5 of table('tracer_res') to row 3 col 1 of table('conserv1');

set row row_name col 6 of table('tracer_res') to row 3 col 2 of table('conserv1');

set row row_name col 7 of table('tracer_res') to row 1 col 1 of table('conserv2');

set row row_name col 8 of table('tracer_res') to row 1 col 2 of table('conserv2');

set row row_name col 9 of table('tracer_res') to row 2 col 1 of table('conserv2');

set row row_name col 10 of table('tracer_res') to row 2 col 2 of table('conserv2');

set row row_name col 11 of table('tracer_res') to row 3 col 1 of table('conserv2');

set row row_name col 12 of table('tracer_res') to row 3 col 2 of table('conserv2');

set row row_name col 13 of table('tracer_res') to row 1 col 1 of table('retard1');

set row row_name col 14 of table('tracer_res') to row 1 col 2 of table('retard1');

set row row_name col 15 of table('tracer_res') to row 2 col 1 of table('retard1');

set row row_name col 16 of table('tracer_res') to row 2 col 2 of table('retard1');

set row row_name col 17 of table('tracer_res') to row 3 col 1 of table('retard1');

set row row_name col 18 of table('tracer_res') to row 3 col 2 of table('retard1');

set row row_name col 19 of table('tracer_res') to row 4 col 1 of table('retard1');

set row row_name col 20 of table('tracer_res') to row 4 col 2 of table('retard1');

set row row_name col 21 of table('tracer_res') to row 5 col 1 of table('retard1');

set row row_name col 22 of table('tracer_res') to row 1 col 1 of table('retard2');

set row row_name col 23 of table('tracer_res') to row 1 col 2 of table('retard2');

set row row_name col 24 of table('tracer_res') to row 2 col 1 of table('retard2');

set row row_name col 25 of table('tracer_res') to row 2 col 2 of table('retard2');

set row row_name col 26 of table('tracer_res') to row 3 col 1 of table('retard2');

set row row_name col 27 of table('tracer_res') to row 3 col 2 of table('retard2');

set row row_name col 28 of table('tracer_res') to row 4 col 1 of table('retard2');

set row row_name col 29 of table('tracer_res') to row 4 col 2 of table('retard2');

set row row_name col 30 of table('tracer_res') to row 5 col 1 of table('retard2');

set row row_name col 31 of table('tracer_res') to sn;

/*

create a title and system file name for the graph

*/

title_str=cat(t_type[o],' ',cell_c[i,1],' location ',object_t[k,1],' ',l,' depth '

,depth_c[m,1]);

conserv_cur_n=row 1 col 1 of table('conserv_gr1@curves');

file_name=cat('d:\projects\html_report\tracer_figs\',t_type[o],cell_c[i,0],'_',k,l,depth_c[m,1],

conserv_cur_n,'_',chem[j,0],'.gif');

/*

make the graph

*/

call public $_make_multigraph('multi_g','conserv_gr1','conserv1','conserv2'

,'retd_gr1','retard1','retard2');

call public $mg_add_text('multi_g','gr_txt1',title_str);

call public $mg_add_text('multi_g','gr_txt2',sn_text);

call public $mg_add_text('multi_g','gr_txt3',m1_text);

call public $mg_add_text('multi_g','gr_txt4',m2_text);

call public $mg_add_text('multi_g','gr_txt5',m1_text_d);

call public $mg_add_text('multi_g','gr_txt6',m2_text_d);

call public $mg_add_text('multi_g','gr_txt7',sn_text_d);

call public $mg_add_text('multi_g','gr_txt8',m3_text);/*moments Model 1 conservative*/

call public $mg_add_text('multi_g','gr_txt9',m4_text);/*moments Model 1 retarded*/

call public $mg_add_text('multi_g','gr_txt10',m5_text);/*moments Model 2 conservative*/

call public $mg_add_text('multi_g','gr_txt11',m6_text);/*moments Model 2 retarded*/

call public $mg_add_text('multi_g','gr_txt12',sn_text_Model_1);

call public $mg_add_text('multi_g','gr_txt13',sn_text_Model_2);

 

call public $mg_set_region_page('multi_g','conserv_gr1',1);

call public $mg_set_region_page('multi_g','conserv1',1);

call public $mg_set_region_page('multi_g','conserv2',1);

call public $mg_set_region_page('multi_g','retd_gr1',1);

call public $mg_set_region_page('multi_g','retard1',1);

call public $mg_set_region_page('multi_g','retard2',1);

call public $mg_set_region_page('multi_g','gr_txt1',1);

call public $mg_set_region_page('multi_g','gr_txt2',1);

call public $mg_set_region_page('multi_g','gr_txt3',1);

call public $mg_set_region_page('multi_g','gr_txt4',1);

call public $mg_set_region_page('multi_g','gr_txt5',1);

call public $mg_set_region_page('multi_g','gr_txt6',1);

call public $mg_set_region_page('multi_g','gr_txt7',1);

call public $mg_set_region_page('multi_g','gr_txt8',1);

call public $mg_set_region_page('multi_g','gr_txt9',1);

call public $mg_set_region_page('multi_g','gr_txt10',1);

call public $mg_set_region_page('multi_g','gr_txt11',1);

call public $mg_set_region_page('multi_g','gr_txt12',1);

call public $mg_set_region_page('multi_g','gr_txt13',1);

 

call public $mg_set_region_position('multi_g','gr_txt1', 0, 0, 1.0, 0.05);

call public $mg_set_region_position('multi_g','conserv_gr1',0.01, 0.05, 0.56, 0.39);

call public $mg_set_region_position('multi_g','gr_txt5', 0.05, 0.44, 0.56, 0.03);

call public $mg_set_region_position('multi_g','gr_txt3', 0.05, 0.47, 0.56, 0.03);

call public $mg_set_region_position('multi_g','retd_gr1', 0.01, 0.525, 0.56, 0.39);

call public $mg_set_region_position('multi_g','gr_txt6', 0.05, 0.94, 0.56, 0.03);

call public $mg_set_region_position('multi_g','gr_txt4', 0.05, 0.97, 0.56, 0.03);

call public $mg_set_region_position('multi_g','conserv1', 0.6, 0.05, 0.4, 0.14);

call public $mg_set_region_position('multi_g','gr_txt8', 0.6, 0.19, 0.4, 0.025);

call public $mg_set_region_position('multi_g','conserv2', 0.6, 0.23, 0.4, 0.14);

call public $mg_set_region_position('multi_g','gr_txt10', 0.6, 0.37, 0.4, 0.025);

call public $mg_set_region_position('multi_g','retard1', 0.6, 0.46, 0.4, 0.17);

call public $mg_set_region_position('multi_g','gr_txt9', 0.6, 0.63, 0.4, 0.025);

call public $mg_set_region_position('multi_g','retard2', 0.6, 0.665, 0.4, 0.17);

call public $mg_set_region_position('multi_g','gr_txt11', 0.6, 0.835, 0.4, 0.025);

call public $mg_set_region_position('multi_g','gr_txt12', 0.6, 0.90, 0.4, 0.025);

call public $mg_set_region_position('multi_g','gr_txt13', 0.6, 0.925, 0.4, 0.025);

call public $mg_set_region_position('multi_g','gr_txt7', 0.6, 0.95, 0.4, 0.025);

call public $mg_set_region_position('multi_g','gr_txt2', 0.6, 0.975, 0.4, 0.025);

call public $mg_set_text_attribute('multi_g','gr_txt1','justification','center');

call public $mg_set_text_attribute('multi_g','gr_txt1','size','large');

call public $mg_set_text_attribute('multi_g','gr_txt2','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt3','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt4','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt5','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt6','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt7','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt8','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt9','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt10','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt11','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt12','size','small');

call public $mg_set_text_attribute('multi_g','gr_txt13','size','small');

 

 

call public $save_dismods('multigraph','multi_g','noheader',true);

/* display 'multi_g';

*/

/*

print out file

*/

set printer = 'gifcge';

 

printout 'multi_g' on file file_name;

 

/*remove excess tables so that they arn't mis-reported*/

if tableexists('data') then delete 'data';

if tableexists('funct_1_moment2') then delete 'funct_1_moment2';

if tableexists('funct_2_moment2') then delete 'funct_2_moment2';

if tableexists('moment2') then delete 'moment2';

if tableexists('moment2_d') then delete 'moment2_d';

if tableexists('retard1') then delete 'retard1';

if tableexists('retard2') then delete 'retard2';

cont: type j,' end chemical loop';/*insuficient data*/

end;/* chemical loop */

type "finish chemical loop";

skip:; /*no conservative tracer*/

/*remove conservative tracer tables so that they arn't mis-reported*/

if tableexists('data') then delete 'data';

if tableexists('funct_1_moment2') then delete 'funct_1_moment2';

if tableexists('funct_2_moment2') then delete 'funct_2_moment2';

if tableexists('moment2') then delete 'moment2';

if tableexists('moment2_d') then delete 'moment2_d';

if tableexists('retard1') then delete 'retard1';

if tableexists('retard2') then delete 'retard2';

if tableexists('funct_1_moment1') then delete 'funct_1_moment1';

if tableexists('funct_2_moment1') then delete 'funct_2_moment1';

if tableexists('moment1') then delete 'moment1';

if tableexists('moment1_d') then delete 'moment1_d';

if tableexists('conserv1') then delete 'conserv1';

if tableexists('conserv2') then delete 'conserv2';

 

 

end;/* pre-post loop*/

type "finish pre_post loop";

end; /* depth loop */

end; /* object id loop */

end; /* object type loop */

 

 

end; /* cell loop */

end;