Flux distribution and critical currents in a one-dimensional row of a Josephson junction square lattice