To keep the code clean and constant, PLEASE indicate the changes you made clearly:name of file,which purpose
mengzhen kang

2006/01/19, MZ
The best way to start greenscilab is to put this folder under SCI/contrib, SCI being the scilab directory

loader.sce
 run 'builder.sce' if the lib is not built
 variable 'GL_SYS_DIR' is set as directory of GreenScilab
 variable 'SEPARATOR' is '\' for windows system, '/'for LINUX system

all access to script uses now absolute path, like:exec(GL_SYS_DIR+'bin'+SEPARATOR+'gl_draw_phy.sci')

BUG: 
//******when creat 3D for a file, sometimes it need to call 'gl_retrieve_structure' twice to have the 3D 
some organ shape can not be displayed properly, in linux, like 'sunflower'

2006 01 22, QR

  gl_retrieve_structure.sci 
      line 220    drawnow();  warning by Scilab when executing files in gallery directory
                              
                              Warning !!!
                              Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
                              with "drawnow" function.
                              Scilab may become unstable.



CHANGES:
2006/01/23, MZ
computing biomass with beer law
	gl_resistance: compute total leaf area of each cycle
	gl_photosynthesis: compute with beer law if Flag_field=1;
output lig file if Flag_lig=1

2006 01 25, QR 
  1, Gl_simulate.sci                          

        line 123   use "if Flag_TCL == 0" to control that dont show message dialogue when clicking Demo MENU        

  2, gl_resistance.sci                          
       
       r_B, r_P are changed to be scalar

  3, gl_photosynthesis.sci  
                 
       r_B, r_P are changed to be scalar 

  4, gl_disp_curve.sci
     check whether "Demand" is 0. 
     output curve of Q/D successfully
     use Flag_bioprod_fig to control whether showing Q/D figure
     
  5, gl_read.sci
    
     r_B, r_P, Flag_geo_leaf, Flag_geo_fruit, Flag_geo_lig are all scalars

  6, inttcl Directory
      
        all files have been changed 
  
2006/01/27, MZ
  new way of computing layer

2006/02/01,QR

   1, gl_read.sci 
      add one command to read variable "coff_L"

   2, gl_read_target.sci
      r_B, r_P,C_r_B,C_r_P are changed to be scalars
   3, sim_fit_HiddenPara_Vec.sci
      X_r_B,

   4, inttcl Directory
        all files have been changed   

   Attention ----> there is something wrong when using Fit in two modes.

2006/02/20,QR
1. gl_main.sci
   C interface for function gl_qorg, gl_topo_phy  and gl_sizeorg. The speed is very much improved. loader.sce is changed to load libSci_c.dll file, which is under root folder.
   it is a great improvement, so it is called version 0.2 .

2. gl_read_target.sci

   line 114 - 128   
  add variables "Flag_field", "Sp", "coff_L", "Flag_bioprod_fig"
   r_B, r_P are changed to be scalar

   line350 - 359
   C_r_B, C_r_P are changed to be scalar

   line 369
   [t_exp_i,t_exp_j]=find(C_t_exp); N_ParaFit=N_ParaFit+size(t_exp_i,1);
  should be 
    [t_exp_i,t_exp_j]=find(C_t_exp); N_ParaFit=N_ParaFit+size(t_exp_i,2);
   the same as [Bt_N_i,Bt_N_j]=find(C_Bt_N); [Bt_p_i,Bt_p_j]=find(C_Bt_p);

   line 389 - 407
    the assigned method of x_Para and N_ParaFit which are relevant to C_r_B and C_r_P are changed 

 3.    sim_fit_HiddenPara_Vec.sci
    sim_fit_HiddenPara.sci

    the assigned method of x_r_B and x_r_P are changed
    Nb_O=matrix(Nb_O1,OrganType,maxp,N,N,N,maxp) is changed to 
    Nb_O=matrix(Nb_O1,OrganType,maxp,N,N,N,maxp,1);

 4.   gl_write_FitPara.sci

  x_r_B and x_r_P are changed like ones in the sim_fit_HiddenPara_Vec.sci

  targetfiles
   add variables "Flag_field", "Sp", "coff_L", "Flag_bioprod_fig"
   r_B, r_P are changed to be scalar
   C_r_B, C_r_P are changed to be scalar

2006/02/20,MZ
   1. gl_resistance.sci
   A bug in computing leaf area: Nb_O(1,1,i,J,J,p) instead of Nb_O(1,1,i,J,p)
   2. gl_simulate.sci
   3. intermain.tcl 
      add 'Begin', 'end'  for menu 'Simulate' and 'Fit' 

   a new testfile maize3PA is added

2006/02/22, QR
   1, testfiles
      add 'rp' 'kp' for beer_law
   2, gl_read.sci

            if i==j then //need to be computed only once, for those appear in new cycle, whatever the number
              MAT_EX(7,p,i,i,r)=S_O(7,p)*Demand(i,r);//relative to the arial part
              Demand(i,r)=Demand(i,r)+MAT_EX(7,p,i,i,r);
            end
      rp  kp
   3, gl_photosynthsis.sci
      use 'rp' and 'kp' instead of 'r_B' and 'r_P' when using Beer_law
   4, inttcl directory

   5, FIT part
      gl_read_target.sci
      sim_fit_HiddenPara_vec.sci   the return variable of "gl_main"
      sim_fit_HiddenPara.sci       the return variable of "gl_main"

17:08 2006-5-8
   1,image display at beginning
   2. new way in display graphics, to be compatible with scilab 4
   3. both c(window and linux) and scilab code inside, but user need to change gl_main.sci and gl_simulate(for topo_phy only) to switch.
   4. revised file is in temporary file.
   to be done:
	1. bending_by_node, and make test files on geometry parameters.
        2. about 'About'
	3. about fit! 
	
11:15 2006-6-7
   1. display of metamer and Gu with good hiddencolor

21:24 2007-1-25
to add top tree analysis

16:51 2007-1-28
BUG: Gl_simulate: the simulated demand is different from the theoretical mean demand when using a deterministic plant wheat_wag_PA3
Changes: using gl_main_stoch instead of gl_main_stoch_theo to limit number of functions. compute theoretical mean number of living organs NbOrg_th from MTh taking into account organ function cycle. Originally it was wrong.
BUG remaning: the theretical total number of phtytomers and fruit is still wrong. But it does not influence on biomasss computation.

Change: gl_demand_stoch: sink of root is not linked to number of root, or, the number of root is always 1.
            if i==j then //need to be computed only once, for those appear in new cycle, whatever the number
              MAT_EX(7,p,i,i,r)=S_O(7,p)*Demand(i,r);//relative to the arial part
              Demand(i,r)=Demand(i,r)+MAT_EX(7,p,i,i,r);
            end
Change:in gl_fit_para, compute NbOrg_th from Mth. Set it as global variable. in Gap_to_Target_biom, call gl_main_stoch instead of gl_main_stoch_theo. Using ones(1,maxp) for Tr.
Change: in Gap_to_Target_biom, weight of organ at a certain position  is that of weighted sum of organs of each  age.
