anchor.diff:    return
   end function encode_ip_2
   !===============================================================================================
  -!decode ip1/2/3 into three (value,kind) pairs
  -! function returns: CONVERT_OK           everything is OK
  -!                   CONVERT_ERROR        error (bad kind, ip1 not a level, etc ....)
  -!                   CONVERT_WARNING      coding convention violations
  -!                   CONVERT_GOOD_GUESS   old style ip1 and/or ip2 are present
  -!                   CONVERT_BAD_GUESS    old style ip3, interpreted as time
  -!                   CONVERT_TERRIBLE_GUESS old style ip3, interpreted as arbitrary code
  -!
  -! in case of error, (value,kind) pairs are undefined (may contain anything)
  -!notes:
  +!****f* rmnlib/decode_ip_2
  +! SUMMARY
  +! decode ip1/2/3 into three (value,kind) pairs
  +! explicit, independent (ip) to (rp,kind) conversion
  +! AUTHOR
  +!  M.Valin 2013
  +! SYNOPSIS
   function decode_ip_2(RP1,kind1,RP2,kind2,RP3,kind3,IP1V,IP2V,IP3V) result(status) BIND(C,name='ConvertIPtoPK')
  -implicit none ! explicit, independent (ip) to (rp,kind) conversion
  -
  +implicit none 
  +
  +! ARGUMENTS
     integer(C_INT) :: status
     real(C_FLOAT),        intent(OUT)  :: RP1,RP2,RP3
     integer(C_INT),        intent(OUT) :: kind1,kind2,kind3
     integer(C_INT), value, intent(IN)  :: IP1V,IP2V,IP3V
  +! INPUTS
  +!  IP1V,IP2V,IP3V IP values to be decoded
  +! OUTPUTS
  +!  RP1,kind1  result of IP1V decoding
  +!  RP2,kind2  result of IP2V decoding
  +!  RP3,kind3  result of IP3V decoding
  +! RESULT
  +!   CONVERT_OK           everything is OK
  +!   CONVERT_ERROR        error (bad kind, ip1 not a level, etc ....)
  +!   CONVERT_WARNING      coding convention violations
  +!   CONVERT_GOOD_GUESS   old style ip1 and/or ip2 are present
  +!   CONVERT_BAD_GUESS    old style ip3, interpreted as time
  +!   CONVERT_TERRIBLE_GUESS old style ip3, interpreted as arbitrary code
  +! NOTES
  +! - this function is C interoperable
  +! - in case of error, (value,kind) pairs are undefined (may contain anything)
  +!******
   
     character(len=1) :: dummy
     integer :: IP1, IP2, IP3
  
positive.code:   return
  end function decode_ip_2
  !===============================================================================================
  ! vector version of encode_ip_2 (ConvertPKtoIP)
  function encode_ip_3(IP,RP,kind) result(status) BIND(C,name='ConvertPKtoIP_v')
  implicit none  ! explicit, independent (rp,kind) to (ip) conversion
  
    integer(C_INT) :: status
    integer(C_INT), dimension(3), intent(OUT) :: IP
    real(C_FLOAT), dimension(3), intent(IN)   :: RP
    integer(C_INT), dimension(3), intent(IN)  :: kind
  
    status=encode_ip_2(IP(1),IP(2),IP(3),RP(1),kind(1),RP(2),kind(2),RP(3),kind(3))
  
  return
  end function encode_ip_3
  !===============================================================================================
  !vector version of decode_ip_2 (ConvertIPtoPK)
  function decode_ip_3(RP,kind,IP) result(status) BIND(C,name='ConvertIPtoPK_v')
  implicit none ! explicit, independent (ip) to (rp,kind) conversion
  
    integer(C_INT) :: status
    real(C_FLOAT),  dimension(3), intent(OUT) :: RP
    integer(C_INT), dimension(3), intent(OUT) :: kind
    integer(C_INT), dimension(3), intent(IN)  :: IP
  
    status=decode_ip_2(RP(1),kind(1),RP(2),kind(2),RP(3),kind(3),IP(1),IP(2),IP(3))
  
  return
  
negative.code:     call CONVIP_plus( ip, p, kind, mode2,string,.false.)
  end subroutine C_CONV_IP
  !===============================================================================================
  !****f* rmnlib/convip_plus
  ! SUMMARY
  !  successeur de convip,  Codage/Decodage P,kind <-> IP pour IP1, IP2, IP3
  !  necessaire avant de lire/ecrire un enregistrement sur un fichier standard.
  ! SYNOPSIS
  SUBROUTINE CONVIP_plus( ip, p, kind, mode, string, flagv )
    implicit none
  ! ARGUMENTS
    integer, intent(INOUT) :: ip, kind
    integer, intent(IN) :: mode
    real, intent(INOUT) :: p
    character *(*), intent(OUT) :: string 
    logical, intent(IN) :: flagv
  
  ! Notes
  !
  !  Etendue des valeurs reelles encodees: 10e-5 -> 10e10
  !  pseudo mantisses :
  !  1024x1024-1 = 1048575
  !  1048001 -> 1048575 non utilise
  !  1000001 -> 1048000 utilise pour valeurs negatives
  ! AUTHOR
  !     Auteurs: N. Ek et B. Dugas - Mars 1996
  !     Revision 001  M. Lepine - juin 1997 convpr devient convip
  !     Revision 002  M. Valin  - mai  1998 fichiers std 98
  