* -------------- ANAR1 Export of Percentage Change Results to GDX ---------

* This file calculates the proportionate changes in model variables
* and sends the results to a GDX file 'womod_respercent.gdx'
* The same parameter names for the results are used as for the levels results

* -------- Results in Proportionate changes

*IF(simr(sim),

* #### Exchange Rate Block

 resER(r,clos,simr)$ER0(r)             = (resER(r,clos,simr)/ER0(r) - 1) *100 ;

* ######## TRADE BLOCK

* #### Exports Block

 resPER(c,w,r,clos,simr)$PER0(c,w,r)   = (resPER(c,w,r,clos,simr)/PER0(c,w,r) - 1) *100 ;
 resPE(c,r,clos,simr)$PE0(c,r)         = (resPE(c,r,clos,simr)/PE0(c,r) - 1) *100 ;
 resPWE(c,w,r,clos,simr)$PWE0(c,w,r)   = (resPWE(c,w,r,clos,simr)/PWE0(c,w,r) - 1) *100 ;

 resPD(c,r,clos,simr)$PD0(c,r)         = (resPD(c,r,clos,simr)/PD0(c,r) - 1) *100 ;

 resQER(c,w,r,clos,simr)$QER0(c,w,r)   = (resQER(c,w,r,clos,simr)/QER0(c,w,r) - 1) *100 ;
 resQE(c,r,clos,simr)$QE0(c,r)         = (resQE(c,r,clos,simr)/QE0(c,r) - 1) *100 ;
 resQD(c,r,clos,simr)$QD0(c,r)         = (resQD(c,r,clos,simr)/QD0(c,r) - 1) *100 ;

* #### Imports Block

 resPMR(w,c,r,clos,simr)$PMR0(w,c,r)   = (resPMR(w,c,r,clos,simr)/PMR0(w,c,r) - 1) *100 ;
 resPM(c,r,clos,simr)$PM0(c,r)         = (resPM(c,r,clos,simr)/PM0(c,r) - 1) *100 ;
 resPML(c,r,clos,simr)$PML0(c,r)       = (resPML(c,r,clos,simr)/PML0(c,r) - 1) *100 ;
 resPMS(c,r,clos,simr)$PMS0(c,r)       = (resPMS(c,r,clos,simr)/PMS0(c,r) - 1) *100 ;

 resPWM(w,c,r,clos,simr)$PWM0(w,c,r)   = (resPWM(w,c,r,clos,simr)/PWM0(w,c,r) - 1) *100 ;
 resPWMFOB(w,c,r,clos,simr)$PWMFOB0(w,c,r)  = (resPWMFOB(w,c,r,clos,simr)/PWMFOB0(w,c,r) - 1) *100 ;

 resPT(c,r,clos,simr)$PT0(c,r)         = (resPT(c,r,clos,simr)/PT0(c,r) - 1) *100 ;

 resQQ(c,r,clos,simr)$QQ0(c,r)         = (resQQ(c,r,clos,simr)/QQ0(c,r) - 1) *100 ;
 resQM(c,r,clos,simr)$QM0(c,r)         = (resQM(c,r,clos,simr)/QM0(c,r) - 1) *100 ;
 resQML(c,r,clos,simr)$QML0(c,r)       = (resQML(c,r,clos,simr)/QML0(c,r) - 1) *100 ;
 resQMS(c,r,clos,simr)$QMS0(c,r)       = (resQMS(c,r,clos,simr)/QMS0(c,r) - 1) *100 ;
 resQMR(w,c,r,clos,simr)$QMR0(w,c,r)   = (resQMR(w,c,r,clos,simr)/QMR0(w,c,r) - 1) *100 ;

* trade margin quantity
 resQT(w,c,r,clos,simr)$QT0(w,c,r)     = (resQT(w,c,r,clos,simr)/QT0(w,c,r) - 1) *100 ;

* ######## COMMODITY PRICE BLOCK

 resPQS(c,r,clos,simr)$PQS0(c,r)       = (resPQS(c,r,clos,simr)/PQS0(c,r) - 1) *100 ;
 resPQD(c,r,clos,simr)$PQD0(c,r)       = (resPQD(c,r,clos,simr)/PQD0(c,r) - 1) *100 ;
 resPXC(c,r,clos,simr)$PXC0(c,r)       = (resPXC(c,r,clos,simr)/PXC0(c,r) - 1) *100 ;

* ######## NUMERAIRE PRICE BLOCK

 resCPI(r,clos,simr)$CPI0(r)           = (resCPI(r,clos,simr)/CPI0(r) - 1) *100 ;
 resPPI(r,clos,simr)$PPI0(r)           = (resPPI(r,clos,simr)/PPI0(r) - 1) *100 ;
 resERPI(clos,simr)$ERPI0              = (resERPI(clos,simr)/ERPI0 - 1) *100 ;

* ######## PRODUCTION BLOCK

 resPX(a,r,clos,simr)$PX0(a,r)         = (resPX(a,r,clos,simr)/PX0(a,r) - 1) *100 ;

* CES aggregation functions for Level 1 of production nest

 resPVA(a,r,clos,simr)$PVA0(a,r)       = (resPVA(a,r,clos,simr)/PVA0(a,r) - 1) *100 ;
 resPINT(a,r,clos,simr)$PINT0(a,r)     = (resPINT(a,r,clos,simr)/PINT0(a,r) - 1) *100 ;

 resADX(a,r,clos,simr)$ADX0(a,r)       = (resADX(a,r,clos,simr)/ADX0(a,r) - 1) *100 ;

 resADXADJ(r,clos,simr)$ADXADJ0(r)     = (resADXADJ(r,clos,simr)/ADXADJ0(r) - 1) *100 ;
 resDADX(r,clos,simr)$DADX0(r)         = (resDADX(r,clos,simr)/DADX0(r) - 1) *100 ;

 resQX(a,r,clos,simr)$QX0(a,r)         = (resQX(a,r,clos,simr)/QX0(a,r) - 1) *100 ;
 resQVA(a,r,clos,simr)$QVA0(a,r)       = (resQVA(a,r,clos,simr)/QVA0(a,r) - 1) *100 ;

* Leontief aggregation functions for Level 1 of production nest

 resQINT(a,r,clos,simr)$QINT0(a,r)     = (resQINT(a,r,clos,simr)/QINT0(a,r) - 1) *100 ;

* CES aggregation functions for Level 2 of production nest

 resADVA(a,r,clos,simr)$ADVA0(a,r)     = (resADVA(a,r,clos,simr)/ADVA0(a,r) - 1) *100 ;

 resADVAADJ(r,clos,simr)$ADVAADJ0(r)   = (resADVAADJ(r,clos,simr)/ADVAADJ0(r) - 1) *100 ;
 resDADVA(r,clos,simr)$DADVA0(r)       = (resDADVA(r,clos,simr)/DADVA0(r) - 1) *100 ;

 resADFD(f,a,r,clos,simr)$ADFD0(f,a,r) = (resADFD(f,a,r,clos,simr)/ADFD0(f,a,r) - 1) *100 ;

 resADFDfADJ(f,clos,simr)$ADFDfADJ0(f) = (resADFDfADJ(f,clos,simr)/ADFDfADJ0(f) - 1) *100 ;
 resADFDaADJ(a,clos,simr)$ADFDaADJ0(a) = (resADFDaADJ(a,clos,simr)/ADFDaADJ0(a) - 1) *100 ;
 resADFDrADJ(r,clos,simr)$ADFDrADJ0(r) = (resADFDrADJ(r,clos,simr)/ADFDrADJ0(r) - 1) *100 ;

 resWF(ff,r,clos,simr)$WF0(ff,r)        = (resWF(ff,r,clos,simr)/WF0(ff,r) - 1) *100 ;
 resWFDIST(ff,a,r,clos,simr)$WFDIST0(ff,a,r)     = (resWFDIST(ff,a,r,clos,simr)/WFDIST0(ff,a,r) - 1) *100 ;
 resFD(ff,a,r,clos,simr)$FD0(ff,a,r)   = (resFD(ff,a,r,clos,simr)/FD0(ff,a,r) - 1) *100 ;
 resFS(ff,r,clos,simr)$FS0(ff,r)       = (resFS(ff,r,clos,simr)/FS0(ff,r) - 1) *100 ;

* Unemployment

 resUNEMP(f,r,clos,simr)$UNEMP0(f,r)   = (resUNEMP(f,r,clos,simr)/UNEMP0(f,r) - 1) *100 ;

* Intermediate Input Demand

 resQINTD(c,r,clos,simr)$QINTD0(c,r)   = (resQINTD(c,r,clos,simr)/QINTD0(c,r) - 1) *100 ;

* Commodity Output

 resQXC(c,r,clos,simr)$QXC0(c,r)       = (resQXC(c,r,clos,simr)/QXC0(c,r) - 1) *100 ;

* ######## FACTOR BLOCK

 resYF(f,r,clos,simr)$YF0(f,r)         = (resYF(f,r,clos,simr)/YF0(f,r) - 1) *100 ;
 resYFDIST(f,r,clos,simr)$YFDIST0(f,r) = (resYFDIST(f,r,clos,simr)/YFDIST0(f,r) - 1) *100 ;

* ######## HOUSEHOLD BLOCK
* ## Household Income

 resYH(h,r,clos,simr)$YH0(h,r)         = (resYH(h,r,clos,simr)/YH0(h,r) - 1) *100 ;

* Household Expenditure

 resHEXP(h,r,clos,simr)$HEXP0(h,r)     = (resHEXP(h,r,clos,simr)/HEXP0(h,r) - 1) *100 ;
 resQCD(c,h,r,clos,simr)$QCD0(c,h,r)   = (resQCD(c,h,r,clos,simr)/QCD0(c,h,r) - 1) *100 ;

* ######## GOVERNMENT BLOCK

* #### Government Income Block

* ## Government Taxes

 resMTAX(r,clos,simr)$MTAX0(r)         = (resMTAX(r,clos,simr)/MTAX0(r) - 1) *100 ;
 resMSTAX(r,clos,simr)$MSTAX0(r)       = (resMSTAX(r,clos,simr)/MSTAX.L(r) - 1) *100 ;
 resETAX(r,clos,simr)$ETAX0(r)         = (resETAX(r,clos,simr)/ETAX0(r) - 1) *100 ;
 resSTAX(r,clos,simr)$STAX0(r)         = (resSTAX(r,clos,simr)/STAX0(r) - 1) *100 ;
 resVTAX(r,clos,simr)$VTAX0(r)         = (resVTAX(r,clos,simr)/VTAX0(r) - 1) *100 ;
 resITAX(r,clos,simr)$ITAX0(r)         = (resITAX(r,clos,simr)/ITAX0(r) - 1) *100 ;
 resFYTAX(r,clos,simr)$FYTAX0(r)       = (resFYTAX(r,clos,simr)/FYTAX0(r) - 1) *100 ;
 resHTAX(r,clos,simr)$HTAX0(r)         = (resHTAX(r,clos,simr)/HTAX0(r) - 1) *100 ;
 resFTAX(r,clos,simr)$FTAX0(r)         = (resFTAX(r,clos,simr)/FTAX0(r) - 1) *100 ;

 resTEADJ(r,clos,simr)$TEADJ0(r)       = (resTEADJ(r,clos,simr)/TEADJ0(r) - 1) *100 ;
 resTMADJ(r,clos,simr)$TMADJ0(r)       = (resTMADJ(r,clos,simr)/TMADJ0(r) - 1) *100 ;
 resTMSADJ(r,clos,simr)$TMSADJ0(r)     = (resTMSADJ(r,clos,simr)/TMSADJ0(r) - 1) *100 ;
 resTSADJ(r,clos,simr)$TSADJ0(r)       = (resTSADJ(r,clos,simr)/TSADJ0(r) - 1) *100 ;
 resTVADJ(r,clos,simr)$TVADJ0(r)       = (resTVADJ(r,clos,simr)/TVADJ0(r) - 1) *100 ;
 resTXADJ(r,clos,simr)$TXADJ0(r)       = (resTXADJ(r,clos,simr)/TXADJ0(r) - 1) *100 ;
 resTYFADJ(r,clos,simr)$TYFADJ0(r)     = (resTYFADJ(r,clos,simr)/TYFADJ0(r) - 1) *100 ;
 resTYHADJ(r,clos,simr)$TYHADJ0(r)     = (resTYHADJ(r,clos,simr)/TYHADJ0(r) - 1) *100 ;
 resTFADJ(r,clos,simr)$TFADJ0(r)       = (resTFADJ(r,clos,simr)/TFADJ0(r) - 1) *100 ;

 resDTE(r,clos,simr)$DTE0(r)           = (resDTE(r,clos,simr)/DTE0(r) - 1) *100 ;
 resDTM(r,clos,simr)$DTM0(r)           = (resDTM(r,clos,simr)/DTM0(r) - 1) *100 ;
 resDTMS(r,clos,simr)$DTMS0(r)         = (resDTMS(r,clos,simr)/DTMS0(r) - 1) *100 ;
 resDTS(r,clos,simr)$DTS0(r)           = (resDTS(r,clos,simr)/DTS0(r) - 1) *100 ;
 resDTV(r,clos,simr)$DTV0(r)           = (resDTV(r,clos,simr)/DTV0(r) - 1) *100 ;
 resDTX(r,clos,simr)$DTX0(r)           = (resDTX(r,clos,simr)/DTX0(r) - 1) *100 ;
 resDTYF(r,clos,simr)$DTYF0(r)         = (resDTYF(r,clos,simr)/DTYF0(r) - 1) *100 ;
 resDTYH(r,clos,simr)$DTYH0(r)         = (resDTYH(r,clos,simr)/DTYH0(r) - 1) *100 ;
 resDTF(r,clos,simr)$DTF0(r)           = (resDTF(r,clos,simr)/DTF0(r) - 1) *100 ;

 resTE(c,w,r,clos,simr)$TE0(c,w,r)     = (resTE(c,w,r,clos,simr)/TE0(c,w,r) - 1) *100 ;
 resTM(w,c,r,clos,simr)$TM0(w,c,r)     = (resTM(w,c,r,clos,simr)/TM0(w,c,r) - 1) *100 ;
 resTMS(w,c,r,clos,simr)$TMS0(w,c,r)   = (resTMS(w,c,r,clos,simr)/TMS0(w,c,r) - 1) *100 ;
 resTS(c,r,clos,simr)$TS0(c,r)         = (resTS(c,r,clos,simr)/TS0(c,r) - 1) *100 ;
 resTV(c,r,clos,simr)$TV0(c,r)         = (resTV(c,r,clos,simr)/TV0(c,r) - 1) *100 ;
 resTX(a,r,clos,simr)$TX0(a,r)         = (resTX(a,r,clos,simr)/TX0(a,r) - 1) *100 ;
 resTYF(f,r,clos,simr)$TYF0(f,r)       = (resTYF(f,r,clos,simr)/TYF0(f,r) - 1) *100 ;
 resTYH(h,r,clos,simr)$TYH0(h,r)       = (resTYH(h,r,clos,simr)/TYH0(h,r) - 1) *100 ;
 resTF(f,a,r,clos,simr)$TF0(f,a,r)     = (resTF(f,a,r,clos,simr)/TF0(f,a,r) - 1) *100 ;

* ## Government Income

 resYG(r,clos,simr)$YG0(r)             = (resYG(r,clos,simr)/YG0(r) - 1) *100 ;

* #### Government Expenditure Block

 resQGD(c,r,clos,simr)$QGD0(c,r)       = (resQGD(c,r,clos,simr)/QGD0(c,r) - 1) *100 ;
 resQGDADJ(r,clos,simr)$QGDADJ0(r)     = (resQGDADJ(r,clos,simr)/QGDADJ0(r) - 1) *100 ;
 resEG(r,clos,simr)$EG0(r)             = (resEG(r,clos,simr)/EG0(r) - 1) *100 ;

* ######## KAPITAL BLOCK

* ## Savings Block

 resSHH(h,r,clos,simr)$SHH0(h,r)       = (resSHH(h,r,clos,simr)/SHH0(h,r) - 1) *100 ;
 resSADJ(r,clos,simr)$SADJ0(r)         = (resSADJ(r,clos,simr)/SADJ0(r) - 1) *100 ;
 resDSHH(r,clos,simr)$DSHH0(r)         = (resDSHH(r,clos,simr)/DSHH0(r) - 1) *100 ;
 resTOTSAV(r,clos,simr)$TOTSAV0(r)     = (resTOTSAV(r,clos,simr)/TOTSAV0(r) - 1) *100 ;

* ## Investment Block

 resQINVD(c,r,clos,simr)$QINVD0(c,r)   = (resQINVD(c,r,clos,simr)/QINVD0(c,r) - 1) *100 ;
 resINVEST(r,clos,simr)$INVEST0(r)     = (resINVEST(r,clos,simr)/INVEST0(r) - 1) *100 ;
 resIADJ(r,clos,simr)$IADJ0(r)         = (resIADJ(r,clos,simr)/IADJ0(r) - 1) *100 ;

* ######## MARKET CLEARING BLOCK

* ##### Account Closure

 resKAPGOV(r,clos,simr)$KAPGOV0(r)     = (resKAPGOV(r,clos,simr)/KAPGOV0(r) - 1) *100 ;
 resKAPWOR(r,clos,simr)$KAPWOR0(r)     = (resKAPWOR(r,clos,simr)/KAPWOR0(r) - 1) *100 ;
 resKAPREG(w,r,clos,simr)$KAPREG0(w,r) = (resKAPREG(w,r,clos,simr)/KAPREG0(w,r) - 1) *100 ;

* #### Absorption Closure

 resVFDOMD(r,clos,simr)$VFDOMD0(r)     = (resVFDOMD(r,clos,simr)/VFDOMD0(r) - 1) *100 ;
 resINVESTSH(r,clos,simr)$INVESTSH0(r) = (resINVESTSH(r,clos,simr)/INVESTSH0(r) - 1) *100 ;
 resVGDSH(r,clos,simr)$VGDSH0(r)       = (resVGDSH(r,clos,simr)/VGDSH0(r) - 1) *100 ;

* ##### Slack

 resWALRAS(r,clos,simr)$WALRAS0(r)     = (resWALRAS(r,clos,simr)/WALRAS0(r) - 1) *100 ;
 resKAPWORSYS(clos,simr)$KAPWORSYS0    = (resKAPWORSYS(clos,simr)/KAPWORSYS0 - 1) *100 ;
 resGLOBESLACK(clos,simr)$GLOBESLACK0  = (resGLOBESLACK(clos,simr)/GLOBESLACK0 - 1) *100 ;

* End of IF
*  ) ;

* ------- 9. Exporting Results to GDX ------------------------------------

* This writes the results data to GDX

Execute_Unload  'results/anar1_respercent.gdx',

* Writing variable results to GDX

* #### Exchange Rate Block

 resER
 resTOT

* ######## TRADE BLOCK

* #### Exports Block

 resPER
 resPE
 resPWE

 resPD

 resQER
 resQE
 resQD

* #### Imports Block

 resPMR
 resPM
 resPML
 resPMS
 resPWM
 resPWMFOB

 resPT

 resQQ
 resQM
 resQML
 resQMS
 resQMR

* trade margin quantity
 resQT

* ######## COMMODITY PRICE BLOCK

 resPQS
 resPQD
 resPXC

* ######## NUMERAIRE PRICE BLOCK

 resCPI
 resPPI
 resERPI

* ######## PRODUCTION BLOCK

 resPX

* CES aggregation functions for Level 1 of production nest

 resPVA
 resPINT

 resADX
 resADXADJ
 resDADX

 resQX
 resQVA

* Leontief aggregation functions for Level 1 of production nest

 resQINT

* CES aggregation functions for Level 2 of production nest

 resADVA
 resADVAADJ
 resDADVA

 resADFD

 resADFDfADJ
 resADFDaADJ
 resADFDrADJ

 resWF
 resWFDIST
 resFD
 resFS

* Unemployment

 resUNEMP

* Intermediate Input Demand

 resQINTD

* Commodity Output

 resQXC

* ######## FACTOR BLOCK

 resYF
 resYFDIST

* ######## HOUSEHOLD BLOCK
* ## Household Income

 resYH

* Household Expenditure

 resHEXP
 resQCD

* ######## GOVERNMENT BLOCK

* #### Government Income Block

* ## Government Taxes

 resMTAX
 resMSTAX
 resETAX
 resSTAX
 resVTAX
 resITAX
 resFYTAX
 resHTAX
 resFTAX

 resTEADJ
 resTMADJ
 resTMSADJ
 resTSADJ
 resTVADJ
 resTXADJ
 resTYFADJ
 resTYHADJ
 resTFADJ

 resDTE
 resDTM
 resDTMS
 resDTS
 resDTV
 resDTX
 resDTYF
 resDTYH
 resDTF

 resTE
 resTM
 resTMS
 resTS
 resTV
 resTX
 resTYF
 resTYH
 resTF

* ## Government Income

 resYG

* #### Government Expenditure Block

 resQGD
 resQGDADJ
 resEG

* ######## KAPITAL BLOCK

* ## Savings Block

 resSHH
 resSADJ
 resDSHH
 resTOTSAV

* ## Investment Block

 resQINVD
 resINVEST
 resIADJ

* ######## MARKET CLEARING BLOCK

* ##### Account Closure

 resKAPGOV
 resKAPWOR
 resKAPREG

* #### Absorption Closure

 resVFDOMD
 resINVESTSH
 resVGDSH

* ##### Slack

 resWALRAS
 resKAPWORSYS
 resGLOBESLACK

   ;


* -------------- anar1 Export of Percentage Change Results to GDX ---------