********************************************************************
*
* 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:\scrdir45

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

  task = Import from GTAPAGG

*
* --- generate 57x45 data set without filtering,
*
  batchName = 57x45, no filtering
  Input file from GTAPAGG (*.zip) = 57X45
  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 57x45 data set with filtering, 400000 transaction
*
  batchName = 57x45, 0.2% 400000 %variant%
  Minimum number of transactions = 400000
  Postfix for data set name = 400000
  Relative tolerance = 0.2
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 380000 transaction
*
  batchName = 57x45, 0.2% 380000 %variant%
  Minimum number of transactions = 380000
  Postfix for data set name = 380000
  Relative tolerance = 0.2
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 360000 transaction
*
  batchName = 57x45, 0.2% 360000 %variant%
  Minimum number of transactions = 360000
  Postfix for data set name = 360000
  Relative tolerance = 0.2
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 340000 transaction
*
  batchName = 57x45, 0.2% 340000 %variant%
  Minimum number of transactions = 340000
  Postfix for data set name = 340000
  Relative tolerance = 0.2
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 320000 transaction
*
  batchName = 57x45, 0.2% 320000 %variant%
  Minimum number of transactions = 320000
  Postfix for data set name = 320000
  Relative tolerance = 0.2
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 300000 transaction
*
  batchName = 57x45, 0.2% 300000
  Minimum number of transactions = 300000
  Postfix for data set name = 300000
  Relative tolerance = 0.2
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 280000 transaction
*
  batchName = 57x45, 0.2% 280000
  Minimum number of transactions = 280000
  Postfix for data set name = 280000
  Relative tolerance = 0.2
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 260000 transaction
*
  batchName = 57x45, 0.2% 260000
  Minimum number of transactions = 260000
  Postfix for data set name = 260000
  Relative tolerance = 0.2
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 240000 transaction
*
  batchName = 57x45, 0.2% 240000
  Minimum number of transactions = 240000
  Postfix for data set name = 240000
  Relative tolerance = 0.2
  Relative tolerance .E = 0
  execute=Gamsrun

  batchName = 57x45, 0.2% 220000
  Minimum number of transactions = 220000
  Postfix for data set name = 220000
  Relative tolerance = 0.2
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 200000 transaction
*
  batchName = 57x45, 0.5% 200000
  Minimum number of transactions = 200000
  Postfix for data set name = 200000
  Relative tolerance = 0.5
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 180000 transaction
*
  batchName = 57x45, 0.5% 180000
  Minimum number of transactions = 180000
  Postfix for data set name = 180000
  Relative tolerance = 0.5
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 160000 transaction
*
  batchName = 57x45, 0.5% 160000
  Minimum number of transactions = 160000
  Postfix for data set name = 160000
  Relative tolerance = 0.5
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 140000 transaction
*
  batchName = 57x45, 1% 140000
  Minimum number of transactions = 140000
  Postfix for data set name = 140000
  Relative tolerance = 1.0
  Relative tolerance .E = 0
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 120000 transaction
*
  batchName = 57x45, 1% 120000
  Minimum number of transactions = 120000
  Postfix for data set name = 120000
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 100000 transaction
*
  batchName = 57x45, 1% 100000
  Minimum number of transactions = 100000
  Postfix for data set name = 100000
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 80000 transaction
*
  batchName = 57x45, 1% 140000
  Minimum number of transactions = 80000
  Postfix for data set name = 80000
  execute=Gamsrun
*
* --- generate 57x45 data set with filtering, 60000 transaction
*
  batchName = 57x45, 1% 60000
  Minimum number of transactions = 60000
  Postfix for data set name = 60000
  execute=Gamsrun

  offtext

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

  Input file (*.gdx) = 57X45_noFilter
  Scenario description =
  Standard GTAP model = OFF
  hide_Modules = CO2_Emissions
  Non default parameters = OFF
  Parameter file = base_scenarios\noShock
  Foreign savings = Global equal returns to capital
  Government = Tax income
  Final consumption = Spending
  Exchange rate = Monetary Union
  hide_Mobile factors = UnSkLab,SkLab,Capital,Land

  Output = GDX
  Output for flow schemer = ON
  Output for price schemer = ON
  Post model regional and sector aggregation = OFF
  Aggregation file = 10x10

  Solution algorithm = CNS
  Option file Conopt = 1
  Algorithm for NLP = CONOPT
  Algorithm for CNS = CONOPT4
  Use CNS first = ON

  Option file Path = 1
  Maximal seconds for one model solve = 500
  Number of repeated solves = 5.0
*  Zero iterations, will only test check case = OFF
  Substitute out prices = ON
  Scale transactions = ON
  Global scaling factor, 1.E- = 3
  Threshold for transactions, 1.E- = 8
  Presolve steps with fixed import prices = 5
  Solve mode = Fixed foreign savings
  Use grid solve for presteps = ON
  Supress output from presolve = ON
  Print gams code to listing = offListing
  Symbol list = offSymList
  Symbol list with cross references = offSymxRef
  Solprint = Silent
  Limrow = 1000
  Limcol = 1000
  Dynamics = Comparative static

  Numeraire regions  = all
  Numeraire products = all


  Residual region = usa
  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 = 60000  \ 80000 \ 100000 \ 120000 \ 140000 \ 160000 \ 180000 \  200000 \ 220000 \ 240000 \ 260000 \ 280000 \ 300000 \ 320000 \ 340000 \ 360000 \ 380000 \ 400000 \ noFilter

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

        endfor
     endfor

  endfor

