allocate f_p array before reading