  To understand the origin of the nodal gap structure realized in
BaFe$_2$(As,P)$_2$, we study the three-dimensional gap structure based on the
three-dimensional ten-orbital Hubbard model with quadrupole interaction. In
this model, strong spin and orbital fluctuations develop by using the
random-phase-approximation. By solving the Eliashberg gap equation, we obtain
the fully-gapped s-wave state with (without) sign reversal between hole-like
and electron-like Fermi surfaces due to strong spin (orbital) fluctuations, so
called the $s_\pm$-wave ($s_{++}$-wave) state. When both spin and orbital
fluctuations strongly develop, which will be realized near the orthorhombic
phase, we obtain the nodal s-wave state in the crossover region between
$s_{++}$-wave and $s_\pm$-wave states. The obtained nodal s-wave state
possesses the loop-shape nodes on electron-like Fermi surfaces, due to the
competition between attractive and repulsive interactions in k-space. In
contrast, the SC gaps on the hole-like Fermi surfaces are fully-gapped due to
orbital fluctuations. The present study explains the main characters of the
anisotropic gap structure in BaFe$_2$(As,P)$_2$ observed experimentally.
