********************************************************************
*
* Standard test suite for GTAPinGAMS
*
* Since:  July 2015
* Author: Wolfgang Britz
*
********************************************************************

 output dir = ..\batchOutput
 work   dir = ..\gams
 res    dir = ..\results
 dat    dir = ..\data
 scrdir = d:\scrdir

*---------------------------------
*
* Generate data sets
*
*---------------------------------
*
ontext

  task = Import from GTAPAGG
*
* --- generate 57x16 data set without filtering,
*
  batchName = 57x16, no filtering
  Input file from GTAPAGG (*.zip) = 57X16
  Load land use data = ON
  Land use data file (*.zip) = 2007LUv81
  Filter method = Rebalancing
  Absolute tolerance, 1.E = -10
  Relative tolerance = 1.0
  Relative tolerance .E = -10
  Postfix for data set name = noFilter

  Minimum number of transactions = 50000
  Number of stepwise increases of thresholds = 20
  Penalty for deviation from = Private consumption, Government consumption, Investments,Intermediate consumption,Factor income plus bop, GDP
  Print gams code to listing = offListing
  execute=Gamsrun

*
* --- generate 57x16 data set with filtering, 80000 transaction
*
  batchName = 57x16, 0.1% 140000
  Minimum number of transactions = 140000
  Relative tolerance .E = -3
  Postfix for data set name = 140000
  execute=Gamsrun
*
* --- generate 57x16 data set with filtering, 80000 transaction
*
  batchName = 57x16, 0.1% 120000
  Relative tolerance .E = -1
  Minimum number of transactions = 120000
  Postfix for data set name = 120000
  execute=Gamsrun
*
* --- generate 57x16 data set with filtering, 80000 transaction
*
  batchName = 57x16, 0.1% 100000
  Minimum number of transactions = 100000
  Postfix for data set name = 100000
  execute=Gamsrun
*
* --- generate 57x16 data set with filtering, 80000 transaction
*
  batchName = 57x16, 0.1% 80000
  Minimum number of transactions = 80000
  Relative tolerance .E = -1
  Postfix for data set name = 80000
  execute=Gamsrun
*
* --- generate 57x16 data set with filtering, 60000 transaction
*
  batchName = 57x16, 0.1% 60000
  Minimum number of transactions = 60000
  Postfix for data set name = 60000
  execute=Gamsrun

 offtext

*---------------------------------
*
* Simulation runs
*
*---------------------------------
*
  task = Simulation

  Standard GTAP model = OFF
  Dynamics = Comparative static
  Non default parameters = OFF
  Parameter file = base_scenarios\noShock
  Foreign Savings = Global equal returns to capital
  Government = Tax income
  Final consumption = Spending
  hide_Mobile factors = UnSkLab,SkLab,Capital,Land
  hide_Modules = CO2_Emissions
  Output = GDX
  Output for flow schemer = ON
  Output for price schemer = ON
  Post model regional and sector aggregation = OFF
  Solution algorithm = CNS
  Algorithm for NLP = CONOPT
  Algorithm for CNS = CONOPT4
  Option file Conopt = 2
  Option file Path = 1
  Substitute out prices = ON
  Scale transactions = ON
  Global scaling factor, 1.E- = 3
  Threshold for transactions, 1.E- = 8
  Print gams code to listing = offListing
  Symbol list = offSymList
  Symbol list with cross references = offSymxRef
  Solprint = off
  Limrow = 0
  Limcol = 0

  Maximal seconds for one model solve = 1000
  Number of repeated solves = 5.0
  Presolve steps with fixed import prices = 3
  Use grid solve for presteps  = ON
  Supress output from presolve = ON
  Solve mode = Fixed foreign savings

  Numeraire regions  = all
  Numeraire products = all
  Residual region    = NAME



  Scenario file = Policy_Shocks\Tariffs

  for solver = CONOPT3 \ CONOPT4

     if %solver% = CONOPT3
        Algorithm for CNS = CONOPT
     else
        Algorithm for CNS = CONOPT4
     endif

     for mode = PRESOLVE \ NOPRESOLVE

        if %mode% = PRESOLVE
           Presolve steps with fixed import prices = 3
        else
           Presolve steps with fixed import prices = 0
        endif
        for DB = 57x16_60000  \ 57x16_80000 \ 57x16_100000 \ 57x16_120000 \ 57x16_140000 \ 57x16_noFilter

           batchName = %DB%_%solver%_%mode%
           Input file (*.gdx) = %DB%
           Scenario description = %solver%_%mode%
           execute=Gamsrun

        endfor
     endfor

  endfor





