Explicit use of ssh in hpg_djc no matter linear/non-linear free surface
The use of ssh without any consideration on the free surface option should not appear in hpg_djc:
DO_2D( 0, 1, 0, 1)
z_rho_k(ji,jj,1) = grav * ( ssh(ji,jj,Kmm) + gde3w(ji,jj,1) ) &
& * ( rhd(ji,jj,1) &
& + 0.5_wp * ( rhd (ji,jj,2) - rhd (ji,jj,1) ) &
& * ( ssh (ji,jj,Kmm) + gde3w(ji,jj,1) ) &
& / ( - gde3w(ji,jj,2) + gde3w(ji,jj,1) ) )
END_2D
I guess that this should rather be:
DO_2D( 0, 1, 0, 1)
z_rho_k(ji,jj,1) = grav * gdept(ji,jj,1,Kmm) &
& * ( rhd(ji,jj,1) &
& + 0.5_wp * ( rhd (ji,jj,2) - rhd (ji,jj,1) ) &
& * gdept(ji,jj,1,Kmm) &
& / ( - gde3w(ji,jj,2) + gde3w(ji,jj,1) ) )
END_2D
and after some simplifications:
DO_2D( 0, 1, 0, 1)
z_rho_k(ji,jj,1) = grav * gdept(ji,jj,1,Kmm) &
& * ( rhd(ji,jj,1) &
& -0.5_wp * ( rhd(ji,jj,2) - rhd(ji,jj,1) ) &
& * gdept(ji,jj,1,Kmm) / e3w(ji,jj,2,Kmm) &
& )
END_2D