Loop to `nz-1` instead of `nz` because upper boundary conditionis set in the lines immediately below.