isfcpl: wrong check on iom_varid when starting from a restart without geometry variables.
If variables are missing in restart, iom_varid return -1 (not 0) => bug in isfcpl.F90 when we want to start from a restart without the geometry variables of the previous leg.
Solution: instead of id * iom_varid(...)
use MIN(id,iom_varid(...))
and test the sign of id
.
!
! check presence of variable needed for coupling
! iom_varid return 0 if not found
id = 1
id = id * iom_varid(numror, 'ssmask', ldstop = .false.)
id = id * iom_varid(numror, 'tmask' , ldstop = .false.)
id = id * iom_varid(numror, 'e3t_n' , ldstop = .false.)
id = id * iom_varid(numror, 'e3u_n' , ldstop = .false.)
id = id * iom_varid(numror, 'e3v_n' , ldstop = .false.)
IF(lwp) WRITE(numout,*) ' isfcpl_init:', id
IF (id == 0) THEN
IF(lwp) WRITE(numout,*) ' isfcpl_init: restart variables for ice sheet coupling are missing, skip coupling for this leg '
IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~'
IF(lwp) WRITE(numout,*) ''
ELSE