/***************************************
*                                      *
*   給付水準調整用ファイルの書き込み   *
*                                      *
*                                      *
***************************************/

#include <iostream>
#include "file_open.h"
#include "snaps.h"
#include "econ.h"
#include "kisosu.h"
#include "cntl.h"

void file_write_cut()
{
	// 変数宣言
	int nendo;
	int nenrei;
	
	// 給付水準調整用
	for( nenrei = UNDER_63 ; nenrei <= MAX_JUKYU ; nenrei++ )
	{
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			Cut_ritu[nendo - SHONENDO][nenrei - UNDER_63] = cut_ruiseki[S_C_NENDO - ECON_SHONENDO][nendo - ECON_SHONENDO][nenrei - NENREI_SUM];
		}
	}
	// ファイルに書き込み
	for( nendo = 2005 ; nendo <= SAISHUNENDO ; nendo++ )
	{
		fprintf( fp_cuta , "%4d," , nendo - 2000 );
		for( nenrei = UNDER_63 ; nenrei <= MAX_JUKYU - 1 ; nenrei++ )
		{
			fprintf( fp_cuta , "%20.14le," , cut_ruiseki[S_C_NENDO - ECON_SHONENDO][nendo - ECON_SHONENDO][nenrei - NENREI_SUM]);
		}
		fprintf( fp_cuta , "%20.14le\n" , cut_ruiseki[S_C_NENDO - ECON_SHONENDO][nendo - ECON_SHONENDO][MAX_JUKYU - NENREI_SUM] );
	}
	fclose(fp_cuta);
}
