real*8 function readkey_dbl(fname,key,defval,minval,maxval) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Copyright (C) 2007 UNESCO-IHE, WL|Delft Hydraulics and Delft University ! ! Dano Roelvink, Ap van Dongeren, Ad Reniers, Jamie Lescinski, ! ! Jaap van Thiel de Vries, Robert McCall ! ! ! ! d.roelvink@unesco-ihe.org ! ! UNESCO-IHE Institute for Water Education ! ! P.O. Box 3015 ! ! 2601 DA Delft ! ! The Netherlands ! ! ! ! This library is free software; you can redistribute it and/or ! ! modify it under the terms of the GNU Lesser General Public ! ! License as published by the Free Software Foundation; either ! ! version 2.1 of the License, or (at your option) any later version. ! ! ! ! This library is distributed in the hope that it will be useful, ! ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! ! Lesser General Public License for more details. ! ! ! ! You should have received a copy of the GNU Lesser General Public ! ! License along with this library; if not, write to the Free Software ! ! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ! ! USA ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! character*(*) :: fname,key character*80 :: value real*8 :: value_dbl real*8 :: defval,minval,maxval call readkey(fname,key,value) if (value/=' ') then read(value,'(f10.0)')value_dbl if (value_dbl>maxval) then write(*,*)'Warning: variable ',trim(key),value_dbl,' > recommended value of ',maxval elseif (value_dblmaxval) then write(*,*)'Warning: variable ',trim(key),value_int,' > recommended value of ',maxval elseif (value_int0) then ikey=ikey+1 keyword(ikey)=adjustl(line(1:ic-1)) values(ikey)=adjustl(line(ic+1:80)) endif enddo nkeys=ikey close(lun) endif value='' do ikey=1,nkeys if (key.eq.keyword(ikey)) then value=values(ikey) endif enddo end