anchor.diff:    err = NF90_PUT_VAR(r%fid,idxl,r%hgrid%xl)
     err = NF90_PUT_VAR(r%fid,idel,r%hgrid%el)
     err = NF90_PUT_VAR(r%fid,idsph,r%hgrid%spherical)
  +  err = NF90_PUT_VAR(r%fid,idang,r%hgrid%angle)
  +  err = NF90_PUT_VAR(r%fid,idh,r%hgrid%h)
  +  err = NF90_PUT_VAR(r%fid,idhraw,r%hgrid%hraw)
  +  err = NF90_PUT_VAR(r%fid,idf,r%hgrid%f)
  +  err = NF90_PUT_VAR(r%fid,idpm,r%hgrid%pm)
  +  err = NF90_PUT_VAR(r%fid,idpn,r%hgrid%pn)
     err = NF90_PUT_VAR(r%fid,idxr,r%hgrid%lon_rho)
     err = NF90_PUT_VAR(r%fid,idyr,r%hgrid%lat_rho)
  -  err = NF90_PUT_VAR(r%fid,idang,r%hgrid%angle)
  +  err = NF90_PUT_VAR(r%fid,idxu,r%hgrid%lon_u)
  +  err = NF90_PUT_VAR(r%fid,idyu,r%hgrid%lat_u)
  +  err = NF90_PUT_VAR(r%fid,idxv,r%hgrid%lon_v)
  +  err = NF90_PUT_VAR(r%fid,idyv,r%hgrid%lat_v)
  +  err = NF90_PUT_VAR(r%fid,idxp,r%hgrid%lon_psi)
  +  err = NF90_PUT_VAR(r%fid,idyp,r%hgrid%lat_psi)
   
   
     err = NF90_CLOSE(r%fid)
  
positive.code:   endif
  
  
    ! ... Read h
    ! ...
    err = NF90_INQ_VARID(r%fid,'h',ii)
    if (err.NE.NF90_NOERR) then
  
negative.code: 
    err = NF90_INQ_VARID(r%fid,'lon_psi',ii)
    if (err.EQ.NF90_NOERR) then
      err = NF90_GET_VAR(r%fid,ii,r%hgrid%lon_psi)
      if (err.NE.NF90_NOERR) stop 'ERROR: Reading variable lon_psi'
    endif
  
    err = NF90_INQ_VARID(r%fid,'lat_psi',ii)
    if (err.EQ.NF90_NOERR) then
      err = NF90_GET_VAR(r%fid,ii,r%hgrid%lat_psi)
      if (err.NE.NF90_NOERR) stop 'ERROR: Reading variable lat_psi'
    endif
  