/***************************************
*                                      *
*          基礎率のインプット          *
*                                      *
*                                      *
***************************************/

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

void kiso( int shubetu )
{
	int nenrei;
	int nendo;
	int sotai_nendo;
	int counter;
	double buffer[BUFFER_MAX];
	int data_number;
	int dankai;
	int kokko;
	int tokyu;
	int seinendo;
	int jukyu_nenrei;
	double shikkenritu[MAX_ROREI_JUKYU - 0 + 1][7];
	
	using namespace std;
	
	// 初期化
	for( counter = 0 ; counter <= 5 ; counter++ )
	{
		for( nenrei = 0 ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
		{
			shikkenritu[nenrei - 0][counter] = 0.;
		}
	}
	
	// 基礎率の読み込み
	
	// １．総脱退力
	for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
	{
		if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 1 && buffer[2] == nenrei )
		{
			Dattairyoku_Gokei[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
		}
		else
		{
			readkiso_error(1);
		}
	}
	
	for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			Dattairyoku_Gokei[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Dattairyoku_Gokei[0][nenrei - MIN_HIHO_NENREI];
			
			if( Option3 == 1 )
			{
				if( ( ( sotai_nendo + SHONENDO - nenrei == 1958 || sotai_nendo + SHONENDO - nenrei == 1959 ) && ( nenrei >= 60 && nenrei <= 60 ) ) ||
						( ( sotai_nendo + SHONENDO - nenrei == 1960 || sotai_nendo + SHONENDO - nenrei == 1961 ) && ( nenrei >= 60 && nenrei <= 61 ) ) ||
						( ( sotai_nendo + SHONENDO - nenrei == 1962 || sotai_nendo + SHONENDO - nenrei == 1963 ) && ( nenrei >= 60 && nenrei <= 62 ) ) ||
						( ( sotai_nendo + SHONENDO - nenrei == 1964 || sotai_nendo + SHONENDO - nenrei == 1965 ) && ( nenrei >= 60 && nenrei <= 63 ) ) ||
						( sotai_nendo + SHONENDO - nenrei >= 1966 && ( nenrei >= 60 && nenrei <= 64 ) ) )
				{
					Dattairyoku_Gokei[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Dattairyoku_Gokei[0][59 - MIN_HIHO_NENREI];
				}
				if( ( ( sotai_nendo + SHONENDO - nenrei == 1958 || sotai_nendo + SHONENDO - nenrei == 1959 ) && nenrei == 61 ) ||
						( ( sotai_nendo + SHONENDO - nenrei == 1960 || sotai_nendo + SHONENDO - nenrei == 1961 ) && nenrei == 62 ) ||
						( ( sotai_nendo + SHONENDO - nenrei == 1962 || sotai_nendo + SHONENDO - nenrei == 1963 ) && nenrei == 63 ) ||
						( ( sotai_nendo + SHONENDO - nenrei == 1964 || sotai_nendo + SHONENDO - nenrei == 1965 ) && nenrei == 64 ) ||
						( sotai_nendo + SHONENDO - nenrei >= 1966 && nenrei == 65 ) )
				{
					Dattairyoku_Gokei[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Dattairyoku_Gokei[0][60 - MIN_HIHO_NENREI];
				}
			}
		}
	}
	
	// ２．死亡脱退力
	for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
	{
		if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 2 && buffer[2] == nenrei )
		{
			Dattairyoku_Shibou[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
		}
		else
		{
			readkiso_error(2);
		}
	}
	
	for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			Dattairyoku_Shibou[sotai_nendo][nenrei - MIN_HIHO_NENREI]	= Dattairyoku_Shibou[0][nenrei - MIN_HIHO_NENREI];
			
			if( Option3 == 1 && ( shubetu == 3 || shubetu == 6 ) )
			{
				if( ( ( sotai_nendo + SHONENDO - nenrei == 1958 || sotai_nendo + SHONENDO - nenrei == 1959 ) && ( nenrei >= 61 && nenrei <= 61 ) ) ||
						( ( sotai_nendo + SHONENDO - nenrei == 1960 || sotai_nendo + SHONENDO - nenrei == 1961 ) && ( nenrei >= 61 && nenrei <= 62 ) ) ||
						( ( sotai_nendo + SHONENDO - nenrei == 1962 || sotai_nendo + SHONENDO - nenrei == 1963 ) && ( nenrei >= 61 && nenrei <= 63 ) ) ||
						( ( sotai_nendo + SHONENDO - nenrei == 1964 || sotai_nendo + SHONENDO - nenrei == 1965 ) && ( nenrei >= 61 && nenrei <= 64 ) ) ||
						( sotai_nendo + SHONENDO - nenrei >= 1966 && ( nenrei >= 61 && nenrei <= 65 ) ) )
				{
						Dattairyoku_Shibou[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Dattairyoku_Shibou[0][60 - MIN_HIHO_NENREI];
				}
			}
		}
	}
	
	// ３．再加入率
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 3 && buffer[2] == nenrei )
			{
				Saikanyuritu[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(3);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Saikanyuritu[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Saikanyuritu[0][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	else
	{
		for( sotai_nendo = 0 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Saikanyuritu[sotai_nendo][nenrei - MIN_HIHO_NENREI] = 0.;
			}
		}
	}
	
	// ４．付加年金納付率
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 4 && buffer[2] == nenrei )
			{
				Noufuritu_Fuka[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(4);
			}
		}
		for( nendo = SHONENDO + 1 ; nendo <= SAISHUNENDO ; nendo ++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Noufuritu_Fuka[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = Noufuritu_Fuka[0][nenrei - MIN_HIHO_NENREI];
				
				if( Option3 == 1 )
				{
					if( ( ( nendo - nenrei == 1958 || nendo - nenrei == 1959 ) && ( nenrei >= 60 && nenrei <= 60 ) ) ||
							( ( nendo - nenrei == 1960 || nendo - nenrei == 1961 ) && ( nenrei >= 60 && nenrei <= 61 ) ) ||
							( ( nendo - nenrei == 1962 || nendo - nenrei == 1963 ) && ( nenrei >= 60 && nenrei <= 62 ) ) ||
							( ( nendo - nenrei == 1964 || nendo - nenrei == 1965 ) && ( nenrei >= 60 && nenrei <= 63 ) ) ||
							( nendo - nenrei >= 1966 && ( nenrei >= 60 && nenrei <= 64 ) ) )
					{
						Noufuritu_Fuka[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = Noufuritu_Fuka[0][59 - MIN_HIHO_NENREI];
					}
				}
			}
		}
	}
	else if( shubetu == 3 || shubetu == 6 )
	{
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Noufuritu_Fuka[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
			}
		}
	}
	else
	{
		cout << "付加年金納付率作成中にshubetu " << shubetu << "を検出しました。" << endl;
		exit(1);
	}
	
	// ５．障害年金発生力(一般)
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 5 && buffer[2] == nenrei )
			{
				Hasseiryoku_Shogai[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(5);
			}
		}
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hasseiryoku_Shogai[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Hasseiryoku_Shogai[0][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	
	// ６．障害年金発生割合（２０歳前）
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 6 && buffer[2] == nenrei )
			{
				Hassei_Wariai_20mae[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(6);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_20mae[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Hassei_Wariai_20mae[0][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	
	// ７．遺族（妻）発生割合
	if( shubetu == 2 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 7 && buffer[2] == nenrei )
			{
				Hassei_Wariai_Tuma[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(7);
			}
		}
		// 経年変化
		for( nendo = SAISHUNENDO ; nendo >= SHONENDO + 1 ; nendo-- )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_Tuma[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 = Hassei_Wariai_Tuma[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 * Izoku_Keinen[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 / Izoku_Keinen[I_KEINEN_SHONENDO - SHONENDO][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	else
	{
		for( sotai_nendo = 0 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_Tuma[sotai_nendo][nenrei - MIN_HIHO_NENREI] = 0.;
			}
		}
	}
	
	// ８．遺族（夫）発生割合
	if( shubetu == 5 || shubetu == 6 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 7 && buffer[2] == nenrei )
			{
				Hassei_Wariai_Otto[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI] = buffer[3];
				if(shubetu == 6)
				{
					Hassei_Wariai_Otto[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI] *= 2.;
				}
			}
			else
			{
				readkiso_error(7);
			}
		}
		
		// 経年変化
		for( nendo = SAISHUNENDO ; nendo >= SHONENDO + 1 ; nendo-- )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_Otto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 = Hassei_Wariai_Otto[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 * Izoku_Keinen[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 / Izoku_Keinen[I_KEINEN_SHONENDO - SHONENDO][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	else
	{
		for( sotai_nendo = 0 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_Otto[sotai_nendo][nenrei - MIN_HIHO_NENREI] = 0.;
			}
		}
	}
	
	// ９．遺族（子）発生割合
	if( shubetu == 2 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 8 && buffer[2] == nenrei )
			{
				Hassei_Wariai_Ko[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(8);
			}
		}
		// 経年変化
		for( nendo = SAISHUNENDO ; nendo >= SHONENDO + 1 ; nendo-- )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_Ko[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 = Hassei_Wariai_Ko[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 * Izoku_Keinen[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 / Izoku_Keinen[I_KEINEN_SHONENDO - SHONENDO][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	else
	{
		for( sotai_nendo = 0 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_Ko[sotai_nendo][nenrei - MIN_HIHO_NENREI] = 0.;
			}
		}
	}
	
	// 10．寡婦年金発生割合
	if( shubetu == 2 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 9 && buffer[2] == nenrei )
			{
				Hassei_Wariai_Kafu[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(9);
			}
		}
		// 経年変化
		for( nendo = SAISHUNENDO ; nendo >= SHONENDO + 1 ; nendo-- )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_Kafu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 = Hassei_Wariai_Kafu[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 * Izoku_Keinen[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 / Izoku_Keinen[I_KEINEN_SHONENDO - SHONENDO][nenrei - MIN_HIHO_NENREI];
			}
			if( (nendo <= 2014) && (nenrei <= 44) )
			{
				Hassei_Wariai_Kafu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
			}
		}
	}
	else
	{
		for( sotai_nendo = 0 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_Kafu[sotai_nendo][nenrei - MIN_HIHO_NENREI] = 0.;
			}
		}
	}
	
	// 11．死亡一時金発生割合
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{	
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 10 && buffer[2] == nenrei )
			{
				Hassei_Wariai_Shibou[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(10);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_Shibou[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Hassei_Wariai_Shibou[0][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	else
	{
		for( sotai_nendo = 0 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Hassei_Wariai_Shibou[sotai_nendo][nenrei - MIN_HIHO_NENREI] = 0.;
			}
		}
	}
	
	// 12．老齢年金発生割合
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_ROREI_JUKYU ; nenrei <= 70 ; nenrei++ )
		{	
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 11 && buffer[2] == nenrei )
			{
				Hassei_Wariai_Rorei[0][nenrei - MIN_ROREI_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(11);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_ROREI_JUKYU ; nenrei <= 70 ; nenrei++ )
			{
				Hassei_Wariai_Rorei[sotai_nendo][nenrei - MIN_ROREI_JUKYU] = Hassei_Wariai_Rorei[0][nenrei - MIN_ROREI_JUKYU];
			}
		}
		// 経年変化
		for( nendo = SHONENDO + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_ROREI_JUKYU ; nenrei <= 64 ; nenrei++ )
			{
				Hassei_Wariai_Rorei[nendo - SHONENDO][nenrei - MIN_ROREI_JUKYU]
				 *= Rorei_Keinen[nendo - R_KEINEN_SHONENDO][shubetu == 2 ? 0 : 1]
				  / Rorei_Keinen[R_KEINEN_SHONENDO - R_KEINEN_SHONENDO][shubetu == 2 ? 0 : 1];
			}
		}
	}
	
	// 13．老齢年金失権率
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 12 && buffer[2] == nenrei )
			{
				shikkenritu[nenrei - 0][0] = buffer[3];
			}
			else
			{
				readkiso_error(12);
			}
		}
		
		// 死亡率改善
		for( nendo = SHONENDO + 1 ; nendo <= SHIKKENRITU_MAX ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= 104 ; nenrei++ )
			{
				if( shubetu <= 3 )
				{
					Shikkenritu_Rorei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
					 = q[nendo - SHIKKENRITU_MIN][nenrei - 0][0] / ( SHIKKENRITU_MAX - LIFETABLE_NENDO )
					 * ( shikkenritu[nenrei - 0][0] / q[LIFETABLE_NENDO - SHIKKENRITU_MIN][nenrei - 0][0] * ( SHIKKENRITU_MAX - nendo )
					   + (nendo < LIFETABLE_NENDO ? 0 : 1) * ( nendo - LIFETABLE_NENDO ) );
				}
				else
				{
					Shikkenritu_Rorei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
					 = q[nendo - SHIKKENRITU_MIN][nenrei - 0][1] / ( SHIKKENRITU_MAX - LIFETABLE_NENDO )
					 * ( shikkenritu[nenrei - 0][0] / q[LIFETABLE_NENDO - SHIKKENRITU_MIN][nenrei - 0][1] * ( SHIKKENRITU_MAX - nendo )
					   + (nendo < LIFETABLE_NENDO ? 0 : 1) * ( nendo - LIFETABLE_NENDO ) );
				}
			}
			for( nenrei = 105 ; nenrei <= MAX_ROREI_JUKYU - 1 ; nenrei++ )
			{
				Shikkenritu_Rorei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 = shikkenritu[nenrei - 0][0] * Shikkenritu_Rorei[nendo - SHONENDO][104 - MIN_HIHO_NENREI] / shikkenritu[104 - 0][0];
			}
			Shikkenritu_Rorei[nendo - SHONENDO][MAX_ROREI_JUKYU - MIN_HIHO_NENREI] = 1.;
		}
		
		for( nendo = SHIKKENRITU_MAX + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
			{
				Shikkenritu_Rorei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = Shikkenritu_Rorei[SHIKKENRITU_MAX - SHONENDO][nenrei - MIN_HIHO_NENREI];
			}
		}
		
		// 失権率が１を超えた場合、補正
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
			{
				if( Shikkenritu_Rorei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] > 1. )
				{
					Shikkenritu_Rorei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 1.;
				}
			}
		}
	}
	
	// 14．障害等級割合（一般）
	if( shubetu == 2 || shubetu == 5 )
	{
		if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 13 )
		{
			Tokyu_Wariai_Ippan[0][1] = buffer[3];
			Tokyu_Wariai_Ippan[0][2] = 1. - buffer[3];
		}
		else
		{
			readkiso_error(13);
		}
		
		Tokyu_Wariai_Ippan[0][0] = 0.;
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			Tokyu_Wariai_Ippan[sotai_nendo][0] = Tokyu_Wariai_Ippan[0][0];
			Tokyu_Wariai_Ippan[sotai_nendo][1] = Tokyu_Wariai_Ippan[0][1];
			Tokyu_Wariai_Ippan[sotai_nendo][2] = Tokyu_Wariai_Ippan[0][2];
		}
	}
	
	// 15．障害等級割合（２０歳前）
	if( shubetu == 2 || shubetu == 5 )
	{
		if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 14 )
		{
			Tokyu_Wariai_20mae[0][1] = buffer[3];
			Tokyu_Wariai_20mae[0][2] = 1. - buffer[3];
		}
		else
		{
			readkiso_error(14);
		}
		
		Tokyu_Wariai_20mae[0][0] = 0.;
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			Tokyu_Wariai_20mae[sotai_nendo][0] = Tokyu_Wariai_20mae[0][0];
			Tokyu_Wariai_20mae[sotai_nendo][1] = Tokyu_Wariai_20mae[0][1];
			Tokyu_Wariai_20mae[sotai_nendo][2] = Tokyu_Wariai_20mae[0][2];
		}
	}
	
	// 16．障害加給割合１・２子（一般）
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 15 && buffer[2] == nenrei )
			{
				Kakyu_Wariai_Ippan_12shi[0][nenrei - MIN_SHOGAI_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(15);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				Kakyu_Wariai_Ippan_12shi[sotai_nendo][nenrei - MIN_SHOGAI_JUKYU] = Kakyu_Wariai_Ippan_12shi[0][nenrei - MIN_SHOGAI_JUKYU];
			}
		}
	}
	
	
	// 17．障害加給割合３子以降（一般）
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 16 && buffer[2] == nenrei )
			{
				Kakyu_Wariai_Ippan_3shiiko[0][nenrei - MIN_SHOGAI_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(16);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				Kakyu_Wariai_Ippan_3shiiko[sotai_nendo][nenrei - MIN_SHOGAI_JUKYU] = Kakyu_Wariai_Ippan_3shiiko[0][nenrei - MIN_SHOGAI_JUKYU];
			}
		}
	}
	
	// 18．障害加給割合１・２子（２０歳前）
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 17 && buffer[2] == nenrei )
			{
				Kakyu_Wariai_20mae_12shi[0][nenrei - MIN_SHOGAI_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(17);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				Kakyu_Wariai_20mae_12shi[sotai_nendo][nenrei - MIN_SHOGAI_JUKYU] = Kakyu_Wariai_20mae_12shi[0][nenrei - MIN_SHOGAI_JUKYU];
			}
		}
	}
	
	// 19．障害加給割合３子以降（２０歳前）
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 18 && buffer[2] == nenrei )
			{
				Kakyu_Wariai_20mae_3shiiko[0][nenrei - MIN_SHOGAI_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(18);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				Kakyu_Wariai_20mae_3shiiko[sotai_nendo][nenrei - MIN_SHOGAI_JUKYU] = Kakyu_Wariai_20mae_3shiiko[0][nenrei - MIN_SHOGAI_JUKYU];
			}
		}
	}
	
	// 20．障害年金失権率（一般）
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 19 && buffer[2] == nenrei )
			{
				shikkenritu[nenrei - 0][1] = buffer[3];
			}
			else
			{
				readkiso_error(19);
			}
		}
		
		// 死亡率改善
		for( nendo = SHONENDO + 1 ; nendo <= SHIKKENRITU_MAX ; nendo++ )
		{
			for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= 64 ; nenrei++ )
			{
				if( shubetu <= 3 )
				{
					Shikkenritu_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU]
					 = shikkenritu[nenrei - 0][1]
					 * q[nendo - SHIKKENRITU_MIN][nenrei - 0][0] / q[LIFETABLE_NENDO - SHIKKENRITU_MIN][nenrei - 0][0];
				}
				else
				{
					Shikkenritu_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU]
					 = shikkenritu[nenrei - 0][1]
					 * q[nendo - SHIKKENRITU_MIN][nenrei - 0][1] / q[LIFETABLE_NENDO - SHIKKENRITU_MIN][nenrei - 0][1];
				}
			}
			for( nenrei = 65 ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				Shikkenritu_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU]
				 = shikkenritu[nenrei - 0][1]
				 * Shikkenritu_Rorei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] / shikkenritu[nenrei - 0][0];
			}
		}
		for( nendo = SHIKKENRITU_MAX + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				Shikkenritu_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU] = Shikkenritu_Ippan[SHIKKENRITU_MAX - SHONENDO][nenrei - MIN_SHOGAI_JUKYU];
			}
		}
		// 失権率が１を超えた場合、補正
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				if( Shikkenritu_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU] > 1. )
				{
					Shikkenritu_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU] = 1.;
				}
			}
		}
	}
	
	// 21．障害年金失権率（２０歳前）
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 20 && buffer[2] == nenrei )
			{
				shikkenritu[nenrei - 0][2] = buffer[3];
			}
			else
			{
				readkiso_error(20);
			}
		}
		
		// 死亡率改善
		for( nendo = SHONENDO + 1 ; nendo <= SHIKKENRITU_MAX ; nendo++ )
		{
			for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= 64 ; nenrei++ )
			{
				if( shubetu <= 3 )
				{
					Shikkenritu_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU]
					 = shikkenritu[nenrei - 0][2]
					 * q[nendo - SHIKKENRITU_MIN][nenrei - 0][0] / q[LIFETABLE_NENDO - SHIKKENRITU_MIN][nenrei - 0][0];
				}
				else
				{
					Shikkenritu_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU]
					 = shikkenritu[nenrei - 0][2]
					 * q[nendo - SHIKKENRITU_MIN][nenrei - 0][1] / q[LIFETABLE_NENDO - SHIKKENRITU_MIN][nenrei - 0][1];
				}
			}
			for( nenrei = 65 ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				Shikkenritu_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU]
				 = shikkenritu[nenrei - 0][2]
				 * Shikkenritu_Rorei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] / shikkenritu[nenrei - 0][0];
			}
		}
		
		for( nendo = SHIKKENRITU_MAX + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				Shikkenritu_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU] = Shikkenritu_20mae[SHIKKENRITU_MAX - SHONENDO][nenrei - MIN_SHOGAI_JUKYU];
			}
		}
		// 失権率が１を超えた場合、補正
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				if( Shikkenritu_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU] > 1. )
				{
					Shikkenritu_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU] = 1.;
				}
			}
		}
	}
	
	// 22．遺族（妻）年齢相関
	if( shubetu == 2 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{	
			if( read_data( buffer, fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 21 && buffer[2] == nenrei )
			{
				Sokan_Tuma[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(21);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Sokan_Tuma[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Sokan_Tuma[0][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	
	// 23．遺族（夫）年齢相関
	if( shubetu == 5 || shubetu == 6 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{	
			if( read_data( buffer, fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 21 && buffer[2] == nenrei )
			{
				Sokan_Otto[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(21);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Sokan_Otto[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Sokan_Otto[0][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	
	// 24．遺族（子）年齢相関
	if( shubetu == 2 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 22 && buffer[2] == nenrei )
			{
				Sokan_Ko[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(22);
			}
		}
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Sokan_Ko[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Sokan_Ko[0][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	
	// 25．遺族（妻）加給割合１・２子
	if( shubetu == 2 )
	{
		for( nenrei = MIN_IZOKU_TUMA_JUKYU ; nenrei <= MAX_IZOKU_TUMA_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 23 && buffer[2] == nenrei )
			{
				Kakyu_Wariai_Tuma_12shi[0][nenrei - MIN_IZOKU_TUMA_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(23);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_IZOKU_TUMA_JUKYU ; nenrei <= MAX_IZOKU_TUMA_JUKYU ; nenrei++ )
			{
				Kakyu_Wariai_Tuma_12shi[sotai_nendo][nenrei - MIN_IZOKU_TUMA_JUKYU] = Kakyu_Wariai_Tuma_12shi[0][nenrei - MIN_IZOKU_TUMA_JUKYU];
			}
		}
	}
	
	// 26．遺族（夫）加給割合１・２子
	if( shubetu == 5 || shubetu == 6 )
	{
		for( nenrei = MIN_IZOKU_OTTO_JUKYU ; nenrei <= MAX_IZOKU_OTTO_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 23 && buffer[2] == nenrei )
			{
				Kakyu_Wariai_Otto_12shi[0][nenrei - MIN_IZOKU_OTTO_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(23);
			}
		}
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_IZOKU_OTTO_JUKYU ; nenrei <= MAX_IZOKU_OTTO_JUKYU ; nenrei++ )
			{
				Kakyu_Wariai_Otto_12shi[sotai_nendo][nenrei - MIN_IZOKU_OTTO_JUKYU] = Kakyu_Wariai_Otto_12shi[0][nenrei - MIN_IZOKU_OTTO_JUKYU];
			}
		}
	}
	
	// 27．遺族（妻）加給割合３子以降
	if( shubetu == 2 )
	{
		for( nenrei = MIN_IZOKU_TUMA_JUKYU ; nenrei <= MAX_IZOKU_TUMA_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 24 && buffer[2] == nenrei )
			{
				Kakyu_Wariai_Tuma_3shiiko[0][nenrei - MIN_IZOKU_TUMA_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(24);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_IZOKU_TUMA_JUKYU ; nenrei <= MAX_IZOKU_TUMA_JUKYU ; nenrei++ )
			{
				Kakyu_Wariai_Tuma_3shiiko[sotai_nendo][nenrei - MIN_IZOKU_TUMA_JUKYU] = Kakyu_Wariai_Tuma_3shiiko[0][nenrei - MIN_IZOKU_TUMA_JUKYU];
			}
		}
	}
	
	// 28．遺族（夫）加給割合３子以降
	if( shubetu == 5 || shubetu == 6 )
	{
		for( nenrei = MIN_IZOKU_OTTO_JUKYU ; nenrei <= MAX_IZOKU_OTTO_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 24 && buffer[2] == nenrei )
			{
				Kakyu_Wariai_Otto_3shiiko[0][nenrei - MIN_IZOKU_OTTO_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(24);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_IZOKU_OTTO_JUKYU ; nenrei <= MAX_IZOKU_OTTO_JUKYU ; nenrei++ )
			{
				Kakyu_Wariai_Otto_3shiiko[sotai_nendo][nenrei - MIN_IZOKU_OTTO_JUKYU] = Kakyu_Wariai_Otto_3shiiko[0][nenrei - MIN_IZOKU_OTTO_JUKYU];
			}
		}
	}
	
	// 29．遺族（子）加給割合１・２子
	if( shubetu == 2 )
	{
		for( nenrei = MIN_IZOKU_KO_JUKYU ; nenrei <= MAX_IZOKU_KO_JUKYU ; nenrei++ )
		{	
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 25 && buffer[2] == nenrei )
			{
				Kakyu_Wariai_Ko_12shi[0][nenrei - MIN_IZOKU_KO_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(25);
			}
		}
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_IZOKU_KO_JUKYU ; nenrei <= MAX_IZOKU_KO_JUKYU ; nenrei++ )
			{
				Kakyu_Wariai_Ko_12shi[sotai_nendo][nenrei - MIN_IZOKU_KO_JUKYU] = Kakyu_Wariai_Ko_12shi[0][nenrei - MIN_IZOKU_KO_JUKYU];
			}
		}
	}
	
	// 30．遺族（子）加給割合３子以降
	if( shubetu == 2 )
	{
		for( nenrei = MIN_IZOKU_KO_JUKYU ; nenrei <= MAX_IZOKU_KO_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 26 && buffer[2] == nenrei )
			{
				Kakyu_Wariai_Ko_3shiiko[0][nenrei - MIN_IZOKU_KO_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(26);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_IZOKU_KO_JUKYU ; nenrei <= MAX_IZOKU_KO_JUKYU ; nenrei++ )
			{
				Kakyu_Wariai_Ko_3shiiko[sotai_nendo][nenrei - MIN_IZOKU_KO_JUKYU] = Kakyu_Wariai_Ko_3shiiko[0][nenrei - MIN_IZOKU_KO_JUKYU];
			}
		}
	}
	
	// 31．遺族年金（妻）失権率
	if( shubetu == 2 )
	{
		for( nenrei = MIN_IZOKU_TUMA_JUKYU ; nenrei <= MAX_IZOKU_TUMA_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 27 && buffer[2] == nenrei )
			{
				shikkenritu[nenrei - 0][3] = buffer[3];
			}
			else
			{
				readkiso_error(27);
			}
		}
		
		// 死亡率
		for( nendo = SHONENDO + 1 ; nendo <= SHIKKENRITU_MAX ; nendo++ )
		{
			for( nenrei = MIN_IZOKU_TUMA_JUKYU ; nenrei <= 60 - 1 ; nenrei++ )
			{
				Shikkenritu_Tuma[nendo - SHONENDO][nenrei - MIN_IZOKU_TUMA_JUKYU] = shikkenritu[nenrei - 0][3];
				
				// 失権率が１を超えた場合、補正
				if( Shikkenritu_Tuma[nendo - SHONENDO][nenrei - MIN_IZOKU_TUMA_JUKYU] > 1. )
				{
					Shikkenritu_Tuma[nendo - SHONENDO][nenrei - MIN_IZOKU_TUMA_JUKYU] = 1.;
				}
			}
			for( nenrei = 60 ; nenrei <= MAX_IZOKU_TUMA_JUKYU ; nenrei++ )
			{
				Shikkenritu_Tuma[nendo - SHONENDO][nenrei - MIN_IZOKU_TUMA_JUKYU] = 1.;
			}
		}
		
		for( nendo = SHIKKENRITU_MAX + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_IZOKU_TUMA_JUKYU ; nenrei <= MAX_IZOKU_TUMA_JUKYU ; nenrei++ )
			{
				Shikkenritu_Tuma[nendo - SHONENDO][nenrei - MIN_IZOKU_TUMA_JUKYU] = Shikkenritu_Tuma[SHIKKENRITU_MAX - SHONENDO][nenrei - MIN_IZOKU_TUMA_JUKYU];
			}
		}
	}
	
	// 32．遺族年金（夫）失権率
	if( shubetu == 5 || shubetu == 6 )
	{
		for( nenrei = MIN_IZOKU_OTTO_JUKYU ; nenrei <= MAX_IZOKU_OTTO_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 27 && buffer[2] == nenrei )
			{
				shikkenritu[nenrei - 0][6] = buffer[3];
			}
			else
			{
				readkiso_error(27);
			}
		}
		
		// 死亡率
		for( nendo = SHONENDO + 1 ; nendo <= SHIKKENRITU_MAX ; nendo++ )
		{
			for( nenrei = MIN_IZOKU_OTTO_JUKYU ; nenrei <= 60 - 1 ; nenrei++ )
			{
				Shikkenritu_Otto[nendo - SHONENDO][nenrei - MIN_IZOKU_OTTO_JUKYU] = shikkenritu[nenrei - 0][6];
				
				// 失権率が１を超えた場合、補正
				if( Shikkenritu_Otto[nendo - SHONENDO][nenrei - MIN_IZOKU_OTTO_JUKYU] > 1. )
				{
					Shikkenritu_Otto[nendo - SHONENDO][nenrei - MIN_IZOKU_OTTO_JUKYU] = 1.;
				}
			}
			for( nenrei = 60 ; nenrei <= MAX_IZOKU_OTTO_JUKYU ; nenrei++ )
			{
				Shikkenritu_Otto[nendo - SHONENDO][nenrei - MIN_IZOKU_OTTO_JUKYU] = 1.;
			}
		}
		
		for( nendo = SHIKKENRITU_MAX + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_IZOKU_OTTO_JUKYU ; nenrei <= MAX_IZOKU_OTTO_JUKYU ; nenrei++ )
			{
				Shikkenritu_Otto[nendo - SHONENDO][nenrei - MIN_IZOKU_OTTO_JUKYU] = Shikkenritu_Otto[SHIKKENRITU_MAX - SHONENDO][nenrei - MIN_IZOKU_OTTO_JUKYU];
			}
		}
	}
	
	// 33．遺族年金（子）失権率
	if( shubetu == 2 )
	{
		for( nenrei = MIN_IZOKU_KO_JUKYU ; nenrei <= MAX_IZOKU_KO_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 28 && buffer[2] == nenrei )
			{
				shikkenritu[nenrei - 0][4] = buffer[3];
			}
			else
			{
				readkiso_error(28);
			}
		}
		
		// 死亡率
		for( nendo = SHONENDO + 1 ; nendo <= SHIKKENRITU_MAX ; nendo++ )
		{
			for( nenrei = MIN_IZOKU_KO_JUKYU ; nenrei <= MAX_IZOKU_KO_JUKYU ; nenrei++ )
			{
				if( nenrei != 18 )
				{
					Shikkenritu_Ko[nendo - SHONENDO][nenrei - MIN_IZOKU_KO_JUKYU] = shikkenritu[nenrei - 0][4];
					
					// 失権率が１を超えた場合、補正
					if( Shikkenritu_Ko[nendo - SHONENDO][nenrei - MIN_IZOKU_KO_JUKYU] > 1. )
					{
						Shikkenritu_Ko[nendo - SHONENDO][nenrei - MIN_IZOKU_KO_JUKYU] = 1.;
					}
				}
				else
				{
					Shikkenritu_Ko[nendo - SHONENDO][nenrei - MIN_IZOKU_KO_JUKYU] = shikkenritu[nenrei - 0][4];
				}
			}
		}
		
		for( nendo = SHIKKENRITU_MAX + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_IZOKU_KO_JUKYU ; nenrei <= MAX_IZOKU_KO_JUKYU ; nenrei++ )
			{
				Shikkenritu_Ko[nendo - SHONENDO][nenrei - MIN_IZOKU_KO_JUKYU] = Shikkenritu_Ko[SHIKKENRITU_MAX - SHONENDO][nenrei - MIN_IZOKU_KO_JUKYU];
			}
		}
	}
	
	// 34．寡婦年齢相関
	if( shubetu == 2 )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 29 && buffer[2] == nenrei )
			{
				Sokan_Kafu[0][nenrei - MIN_HIHO_NENREI] = buffer[3];
			}
			else
			{
				readkiso_error(29);
			}
		}
		
		for( sotai_nendo = 1 ; sotai_nendo <= SAISHUNENDO - SHONENDO ; sotai_nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Sokan_Kafu[sotai_nendo][nenrei - MIN_HIHO_NENREI] = Sokan_Kafu[0][nenrei - MIN_HIHO_NENREI];
			}
		}
	}
	
	// 35．寡婦失権率
	if( shubetu == 2 )
	{
		for( nenrei = MIN_KAFU_JUKYU ; nenrei <= MAX_KAFU_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 30 && buffer[2] == nenrei )
			{
				shikkenritu[nenrei - 0][5] = buffer[3];
			}
			else
			{
				readkiso_error(30);
			}
		}
		
		// 死亡率
		for( nendo = SHONENDO + 1 ; nendo <= SHIKKENRITU_MAX ; nendo++ )
		{
			for( nenrei = MIN_KAFU_JUKYU ; nenrei <= MAX_KAFU_JUKYU ; nenrei++ )
			{
				Shikkenritu_Kafu[nendo - SHONENDO][nenrei - MIN_KAFU_JUKYU] = shikkenritu[nenrei - 0][5];
				
				// 失権率が１を超えた場合、補正
				if( Shikkenritu_Kafu[nendo - SHONENDO][nenrei - MIN_KAFU_JUKYU] > 1. )
				{
					Shikkenritu_Kafu[nendo - SHONENDO][nenrei - MIN_KAFU_JUKYU] = 1.;
				}
			}
		}
		
		for( nendo = SHIKKENRITU_MAX + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_KAFU_JUKYU ; nenrei <= MAX_KAFU_JUKYU ; nenrei++ )
			{
				Shikkenritu_Kafu[nendo - SHONENDO][nenrei - MIN_KAFU_JUKYU] = Shikkenritu_Kafu[SHIKKENRITU_MAX - SHONENDO][nenrei - MIN_KAFU_JUKYU];
			}
		}
	}
	
	// 36．支給率
	// その１ 老齢基礎年金
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nenrei = MIN_ROREI_JUKYU ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 311 && buffer[2] == nenrei )
			{
				Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].ninzu = buffer[3];
				Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].noufu = buffer[4];
				for( dankai = 0 ; dankai <= 1 ; dankai++ )
				{
					for( kokko = 0 ; kokko <= KOKKO_HIKIAGE - 1 ; kokko++ )
					{
						Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].menjo[dankai][kokko] = buffer[5];
					}
				}
				for( dankai = 2 ; dankai <= MAX_MENJO - 1 ; dankai++ )
				{
					for( kokko = 0 ; kokko <= KOKKO_HIKIAGE - 1 ; kokko++ )
					{
						Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].menjo[dankai][kokko] = buffer[6];
					}
				}
				Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].rofuku_shitasasae = buffer[7];
				Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].fuka = buffer[8];
			}
			else
			{
				readkiso_error(321);
			}
		}
	}
	else
	{
		for( nenrei = MIN_ROREI_JUKYU ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 311 && buffer[2] == nenrei )
			{
				Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].noufu = buffer[3];
			}
			else
			{
				readkiso_error(321);
			}
		}
	}
	
	// 年度
	for( nendo = SHONENDO + 2 ; nendo <= SAISHUNENDO ; nendo++ )
	{
		for( nenrei = MIN_ROREI_JUKYU ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
		{
			Shikyuritu_Rorei[nendo - SHONENDO][nenrei - MIN_ROREI_JUKYU].ninzu = Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].ninzu;
			Shikyuritu_Rorei[nendo - SHONENDO][nenrei - MIN_ROREI_JUKYU].noufu = Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].noufu;
			for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
			{
				for( kokko = 0 ; kokko <= KOKKO_HIKIAGE - 1 ; kokko++ )
				{
					Shikyuritu_Rorei[nendo - SHONENDO][nenrei - MIN_ROREI_JUKYU].menjo[dankai][kokko]
					 = Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].menjo[dankai][kokko];
				}
			}
			Shikyuritu_Rorei[nendo - SHONENDO][nenrei - MIN_ROREI_JUKYU].fuka = Shikyuritu_Rorei[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].fuka;
			
			if( nenrei >= MIN_ROREI_JUKYU + 1 )
			{
				Shikyuritu_Rorei[nendo - SHONENDO][nenrei - MIN_ROREI_JUKYU].rofuku_shitasasae
				 = Shikyuritu_Rorei[nendo - 1 - SHONENDO][nenrei - 1 - MIN_ROREI_JUKYU].rofuku_shitasasae;
			}
			else
			{
				Shikyuritu_Rorei[nendo - SHONENDO][nenrei - MIN_ROREI_JUKYU].rofuku_shitasasae = 1.;
			}
		}
	}
	
	if( shubetu == 2 || shubetu == 5 )
	{
	  // その２ 旧法老齢年金
		for( nenrei = MIN_ROREI_JUKYU ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 312 && buffer[2] == nenrei )
			{
				Shikyuritu_Rorei_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].ninzu = buffer[3];
				Shikyuritu_Rorei_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].noufu = buffer[4];
				Shikyuritu_Rorei_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].menjo = buffer[5];
				Shikyuritu_Rorei_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].kasa_noufu = buffer[6];
				Shikyuritu_Rorei_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].kasa_menjo = buffer[7];
				Shikyuritu_Rorei_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].rofuku_shitasasae = buffer[8];
				Shikyuritu_Rorei_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].fuka = buffer[9];
			}
			else
			{
				readkiso_error(322);
			}
		}
		
		// 年度
		for( nendo = SHONENDO + 2 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_ROREI_JUKYU + 1 ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
			{
				Shikyuritu_Rorei_Kyu[nendo - SHONENDO][nenrei - MIN_ROREI_JUKYU] = Shikyuritu_Rorei_Kyu[nendo - 1 - SHONENDO][nenrei - 1 - MIN_ROREI_JUKYU];
			}
			Shikyuritu_Rorei_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].ninzu = 1.;
			Shikyuritu_Rorei_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].noufu = 1.;
			Shikyuritu_Rorei_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].menjo = 1.;
			Shikyuritu_Rorei_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].kasa_noufu = 1.;
			Shikyuritu_Rorei_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].kasa_menjo = 1.;
			Shikyuritu_Rorei_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].rofuku_shitasasae = 1.;
			Shikyuritu_Rorei_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].fuka = 1.;
		}
		
		// その３ 旧法通老年金
		for( nenrei = MIN_ROREI_JUKYU ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 313 && buffer[2] == nenrei )
			{
				Shikyuritu_Turo_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].ninzu = buffer[3];
				Shikyuritu_Turo_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].noufu = buffer[4];
				Shikyuritu_Turo_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].menjo = buffer[5];
				Shikyuritu_Turo_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].kasa_noufu = buffer[6];
				Shikyuritu_Turo_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].kasa_menjo = buffer[7];
				Shikyuritu_Turo_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].rofuku_shitasasae = buffer[8];
				Shikyuritu_Turo_Kyu[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU].fuka = buffer[9];
			}
			else
			{
				readkiso_error(323);
			}
		}
		// 年度
		for( nendo = SHONENDO + 2 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_ROREI_JUKYU + 1 ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
			{
				Shikyuritu_Turo_Kyu[nendo - SHONENDO][nenrei - MIN_ROREI_JUKYU] = Shikyuritu_Turo_Kyu[nendo - 1 - SHONENDO][nenrei - 1 - MIN_ROREI_JUKYU];
			}
			Shikyuritu_Turo_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].ninzu = 1.;
			Shikyuritu_Turo_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].noufu = 1.;
			Shikyuritu_Turo_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].menjo = 1.;
			Shikyuritu_Turo_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].kasa_noufu = 1.;
			Shikyuritu_Turo_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].kasa_menjo = 1.;
			Shikyuritu_Turo_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].rofuku_shitasasae = 1.;
			Shikyuritu_Turo_Kyu[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU].fuka = 1.;
		}
		
		// その４ ５年年金
		for( nenrei = MIN_ROREI_JUKYU ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 314 && buffer[2] == nenrei )
			{
				Shikyuritu_Gonen[SHONENDO + 1 - SHONENDO][nenrei - MIN_ROREI_JUKYU] = buffer[3];
			}
			else
			{
				readkiso_error(324);
			}
		}
		// 年度
		for( nendo = SHONENDO + 2 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_ROREI_JUKYU + 1 ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
			{
				Shikyuritu_Gonen[nendo - SHONENDO][nenrei - MIN_ROREI_JUKYU] = Shikyuritu_Gonen[nendo - 1 - SHONENDO][nenrei - 1 - MIN_ROREI_JUKYU];
			}
			Shikyuritu_Gonen[nendo - SHONENDO][MIN_ROREI_JUKYU - MIN_ROREI_JUKYU] = 1.;
		}
		
		// その５ 一般障害基礎年金
		for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 315 && buffer[2] == nenrei )
			{
				Shikyuritu_Shogai_Ippan[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][1] = buffer[5];
				Shikyuritu_Shogai_Ippan[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][2] = buffer[6];
				Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][1] = buffer[3];
				Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][2] = buffer[4];
			}
			else
			{
				readkiso_error(325);
			}
		}
		// 経年変化
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( tokyu = 1 ; tokyu <= 2 ; tokyu++ )
			{
				for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= SHONENDO + 1 - N_O_NENDO ; nenrei++ )
				{
					Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
				 		= Shikyuritu_Shogai_Ippan[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
					
					if( shubetu == 2 )
					{
						if( ( nendo - nenrei == 1953 || nendo - nenrei == 1954 ) && ( nenrei >= 60 && nenrei <= 60 ) )
						{
							Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 		= Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1955 || nendo - nenrei == 1956 ) && ( nenrei >= 60 && nenrei <= 61 ) )
						{
							Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 		= Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1957 || nendo - nenrei == 1958 ) && ( nenrei >= 60 && nenrei <= 62 ) )
						{
							Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 		= Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1959 || nendo - nenrei == 1960 ) && ( nenrei >= 60 && nenrei <= 63 ) )
						{
							Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 		= Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( nendo - nenrei >= 1961 && ( nenrei >= 60 && nenrei <= 64 ) )
						{
							Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 		= Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
					}
					if( shubetu == 5 )
					{
						if( ( nendo - nenrei == 1958 || nendo - nenrei == 1959 ) && ( nenrei >= 60 && nenrei <= 60 ) )
						{
							Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 		= Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1960 || nendo - nenrei == 1961 ) && ( nenrei >= 60 && nenrei <= 61 ) )
						{
							Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 		= Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1962 || nendo - nenrei == 1963 ) && ( nenrei >= 60 && nenrei <= 62 ) )
						{
							Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 		= Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1964 || nendo - nenrei == 1965 ) && ( nenrei >= 60 && nenrei <= 63 ) )
						{
							Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 		= Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( nendo - nenrei >= 1966 && ( nenrei >= 60 && nenrei <= 64 ) )
						{
							Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 		= Shikyuritu_Shogai_Ippan_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
					}
				}
				for( nenrei = SHONENDO + 2 - N_O_NENDO ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
				{
					if( nendo == SHONENDO + 1 )
					{
						Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
						 = Shikyuritu_Shogai_Ippan[nendo - 1 - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
					}
					if(nendo >= SHONENDO + 2)
					{
						Shikyuritu_Shogai_Ippan[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
						 = Shikyuritu_Shogai_Ippan[nendo - 1 - SHONENDO][nenrei - 1 - MIN_SHOGAI_JUKYU][tokyu];
					}
				}
			}
		}
		
		// その６ ２０歳前障害年金
		for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 316 && buffer[2] == nenrei )
			{
				Shikyuritu_Shogai_20mae[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][1] = buffer[5];
				Shikyuritu_Shogai_20mae[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][2] = buffer[6];
				Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][1] = buffer[3];
				Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][2] = buffer[4];
			}
			else
			{
				readkiso_error(326);
			}
		}
		
		//経年変化
		// 年度
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( tokyu = 1 ; tokyu <= 2 ; tokyu++ )
			{
				for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= SHONENDO + 1 - N_O_NENDO ; nenrei++ )
				{
					Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 = Shikyuritu_Shogai_20mae[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
					
					if( shubetu == 2 )
					{
						if( ( nendo - nenrei == 1953 || nendo - nenrei == 1954 ) && ( nenrei >= 60 && nenrei <= 60 ) )
						{
							Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1955 || nendo - nenrei == 1956 ) && ( nenrei >= 60 && nenrei <= 61 ) )
						{
							Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1957 || nendo - nenrei == 1958 ) && ( nenrei >= 60 && nenrei <= 62 ) )
						{
							Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1959 || nendo - nenrei == 1960 ) && ( nenrei >= 60 && nenrei <= 63 ) )
						{
							Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( nendo - nenrei >= 1961 && ( nenrei >= 60 && nenrei <= 64 ) )
						{
							Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
					}
					if( shubetu == 5 )
					{
						if( ( nendo - nenrei == 1958 || nendo - nenrei == 1959 ) && ( nenrei >= 60 && nenrei <= 60 ) )
						{
							Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1960 || nendo - nenrei == 1961 ) && ( nenrei >= 60 && nenrei <= 61 ) )
						{
							Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1962 || nendo - nenrei == 1963 ) && ( nenrei >= 60 && nenrei <= 62 ) )
						{
							Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1964 || nendo - nenrei == 1965 ) && ( nenrei >= 60 && nenrei <= 63 ) )
						{
							Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( nendo - nenrei >= 1966 && ( nenrei >= 60 && nenrei <= 64 ) )
						{
							Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_20mae_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
					}
				}
				for( nenrei = SHONENDO + 2 - N_O_NENDO ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
				{
					if( nendo == SHONENDO + 1 )
					{
						Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
						 = Shikyuritu_Shogai_20mae[nendo - 1 - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
					}
					if( nendo >= SHONENDO + 2 )
					{
						Shikyuritu_Shogai_20mae[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
						 = Shikyuritu_Shogai_20mae[nendo - 1 - SHONENDO][nenrei - 1 - MIN_SHOGAI_JUKYU][tokyu];
					}
				}
			}
		}
		
		// その７ 旧法障害年金
		for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 317 && buffer[2] == nenrei )
			{
				Shikyuritu_Shogai_Kyu[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][1] = buffer[5];
				Shikyuritu_Shogai_Kyu[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][2] = buffer[6];
				Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][1] = buffer[3];
				Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][2] = buffer[4];
			}
			else
			{
				readkiso_error(327);
			}
		}
		
		//経年変化
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( tokyu = 1 ; tokyu <= 2 ; tokyu++ )
			{
				for( nenrei = MIN_SHOGAI_JUKYU ; nenrei <= SHONENDO + 1 - N_O_NENDO ; nenrei++ )
				{
					Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
					 = Shikyuritu_Shogai_Kyu[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
					
					if( shubetu == 2 )
					{
						if( ( nendo - nenrei == 1953 || nendo - nenrei == 1954 ) && ( nenrei >= 60 && nenrei <= 60 ) )
						{
							Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1955 || nendo - nenrei == 1956 ) && ( nenrei >= 60 && nenrei <= 61 ) )
						{
							Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1957 || nendo - nenrei == 1958 ) && ( nenrei >= 60 && nenrei <= 62 ) )
						{
							Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1959 || nendo - nenrei == 1960 ) && ( nenrei >= 60 && nenrei <= 63 ) )
						{
							Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( nendo - nenrei >= 1961 && ( nenrei >= 60 && nenrei <= 64 ) )
						{
							Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
					}
					if( shubetu == 5 )
					{
						if( ( nendo - nenrei == 1958 || nendo - nenrei == 1959 ) && ( nenrei >= 60 && nenrei <= 60 ) )
						{
							Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1960 || nendo - nenrei == 1961 ) && ( nenrei >= 60 && nenrei <= 61 ) )
						{
							Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1962 || nendo - nenrei == 1963 ) && ( nenrei >= 60 && nenrei <= 62 ) )
						{
							Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( ( nendo - nenrei == 1964 || nendo - nenrei == 1965 ) && ( nenrei >= 60 && nenrei <= 63 ) )
						{
							Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
						if( nendo - nenrei >= 1966 && ( nenrei >= 60 && nenrei <= 64 ) )
						{
							Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
							 = Shikyuritu_Shogai_Kyu_keinen[SHONENDO - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
						}
					}
				}
				for( nenrei = SHONENDO + 2 - N_O_NENDO ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
				{
					if( nendo == SHONENDO + 1 )
					{
						Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
						 = Shikyuritu_Shogai_Kyu[nendo - 1 - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu];
					}
					if( nendo >= SHONENDO + 2 )
					{
						Shikyuritu_Shogai_Kyu[nendo - SHONENDO][nenrei - MIN_SHOGAI_JUKYU][tokyu]
						 = Shikyuritu_Shogai_Kyu[nendo - 1 - SHONENDO][nenrei - 1 - MIN_SHOGAI_JUKYU][tokyu];
					}
				}
			}
		}
	}
	
	if( shubetu == 2 )
	{
		// その８ 遺族基礎年金（妻及び子）
		if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 318 && buffer[2] == 328 )
		{
			Shikyuritu_Tuma[SHONENDO + 1 - SHONENDO] = buffer[3];
			Shikyuritu_Ko[SHONENDO + 1 - SHONENDO] = buffer[4];
		}
		else
		{
			readkiso_error(328);
		}
		// 年度
		for( nendo = SHONENDO + 2 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			Shikyuritu_Tuma[nendo - SHONENDO] = Shikyuritu_Tuma[SHONENDO + 1 - SHONENDO];
			Shikyuritu_Ko[nendo - SHONENDO] = Shikyuritu_Ko[SHONENDO + 1 - SHONENDO];
		}
		
		// その９ 寡婦年金
		for( nenrei = 60 ; nenrei <= MAX_KAFU_JUKYU ; nenrei++ )
		{
			if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 319 && buffer[2] == nenrei )
			{
				Shikyuritu_Kafu[SHONENDO + 1 - SHONENDO][nenrei - 60] = buffer[3];
			}
			else
			{
				readkiso_error(329);
			}
		}
		// 年度
		for( nendo = SHONENDO + 2 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = 60 ; nenrei <= MAX_KAFU_JUKYU ; nenrei++ )
			{
				Shikyuritu_Kafu[nendo - SHONENDO][nenrei - 60] = Shikyuritu_Kafu[SHONENDO + 1 - SHONENDO][nenrei - 60];
				
				if( Option3 == 1 )
				{
					if( ( ( nendo - nenrei == 1958 || nendo - nenrei == 1959 ) && nenrei <= 60 ) ||
							( ( nendo - nenrei == 1960 || nendo - nenrei == 1961 ) && nenrei <= 61 ) ||
							( ( nendo - nenrei == 1962 || nendo - nenrei == 1963 ) && nenrei <= 62 ) ||
							( ( nendo - nenrei == 1964 || nendo - nenrei == 1965 ) && nenrei <= 63 ) ||
							( nendo - nenrei >= 1966 && nenrei <= 64 ) )
					{
						Shikyuritu_Kafu[nendo - SHONENDO][nenrei - 60] = 0.;
					}
				}
			}
		}
	}
	
	if( shubetu == 5 || shubetu == 6 )
	{
		// その10 遺族基礎年金（夫）
		if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == 318 && buffer[2] == 328 )
		{
			Shikyuritu_Otto[SHONENDO + 1 - SHONENDO] = buffer[3];
		}
		else
		{
			readkiso_error(328);
		}
		// 年度
		for( nendo = SHONENDO + 2 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			Shikyuritu_Otto[nendo - SHONENDO] = Shikyuritu_Otto[SHONENDO + 1 - SHONENDO];
		}
	}
	
	// 37．一部繰り上げ者の６５歳以降の給付費計算用
	// ゼロクリア
 	for( seinendo = SHONENDO + 1 - MAX_ROREI_JUKYU ; seinendo <= SAISHUNENDO - MIN_ROREI_JUKYU ; seinendo++ )
	{
		for( jukyu_nenrei = MIN_ROREI_JUKYU ; jukyu_nenrei <= 70 ; jukyu_nenrei++ )
		{
			Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu = 1.;
			Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].noufu = 1.;
			for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
			{
				for( kokko = 0 ; kokko <= KOKKO_HIKIAGE - 1 ; kokko++ )
				{
					Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].menjo[dankai][kokko] = 1.;
				}
			}
			Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].rofuku_shitasasae = 1.;
			Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].fuka = 1.;
		}
	}
	
	if( shubetu == 2 || shubetu == 5 )
	{
		for( seinendo = SHONENDO + 1 - 64 ; seinendo <= SHONENDO + 1 - 60 ; seinendo++ )
		{
			for( jukyu_nenrei = 60 ; jukyu_nenrei <= 64 ; jukyu_nenrei++ )
			{
				if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == seinendo && buffer[2] == jukyu_nenrei )
				{
					Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].noufu = buffer[3];
					Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].menjo[ZENGAKU][1] = buffer[4];
					Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].menjo[MENJO_3_4][1] = buffer[5];
					Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].menjo[MENJO_1_2][1] = buffer[6];
					Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].menjo[MENJO_1_4][1] = buffer[7];
					Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].fuka = buffer[8];
				}
				else
				{
					readkiso_error(33);
				}
			}
		}
	}
	else
	{
		for( seinendo = SHONENDO + 1 - 64 ; seinendo <= SHONENDO + 1 - 60 ; seinendo++ )
		{
			for( jukyu_nenrei = 60 ; jukyu_nenrei <= 64 ; jukyu_nenrei++ )
			{
				if( read_data( buffer , fp_kisoritu , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == seinendo && buffer[2] == jukyu_nenrei )
				{
					Kakudai_Ichibu[seinendo - ( SHONENDO + 1 - MAX_ROREI_JUKYU )][jukyu_nenrei - MIN_ROREI_JUKYU].noufu = buffer[3];
				}
				else
				{
					readkiso_error(33);
				}
			}
		}
	}
}


void readkiso_error( int shurui )
{
	printf( "基礎率ファイル読み込み中にＥＯＦを検出しました。 基礎率種類は、%d\n" , shurui );
	exit(1);
}
