00001 subroutine peos_lookup(qp,qpar,iphase) 00002 ! 00003 use phys_constant !nnpeos 00004 use def_peos_parameter !abc,abi,rhoi,qi,hi,nphase 00005 implicit none 00006 ! 00007 real(8), intent(in) :: qp, qpar(0:nnpeos) 00008 real(8) :: det 00009 integer, intent(out) :: iphase 00010 integer :: ii 00011 ! 00012 ! -- Monotonically increasing qpar is assumed. 00013 ! 00014 iphase = 1 00015 do ii = 1, nphase 00016 det = (qp-qpar(ii))*(qp-qpar(ii-1)) 00017 if (det <= 0.0d0) then 00018 iphase = ii 00019 exit 00020 end if 00021 end do 00022 ! 00023 end subroutine peos_lookup