file_gunzip Subroutine

public subroutine file_gunzip(filename)

Arguments

Type IntentOptional Attributes Name
character(len=*) :: filename

Calls

proc~~file_gunzip~~CallsGraph proc~file_gunzip file_gunzip interface~reg reg proc~file_gunzip->interface~reg

Called by

proc~~file_gunzip~~CalledByGraph proc~file_gunzip file_gunzip proc~file_length file_length proc~file_length->proc~file_gunzip

Source Code

  subroutine file_gunzip(filename)
    character(len=*)             :: filename
    character(len=3),parameter   :: type='.gz'
    logical                      :: iexist,iopen
    integer                      :: unit
    !
    inquire(file=reg(filename),exist=iexist)
    if(iexist)return           !nothing to be done:
    !
    inquire(file=reg(filename)//type,exist=iexist)
    if(.not.iexist)then
       write(*,"(A)")"file "//reg(filename)//" not found, not even with .gz extension"
       stop
    endif
    write(*,"(A)")"deflate "//reg(filename)//type
    call system("gunzip "//reg(filename)//type)
    inquire(file=reg(filename),opened=iopen,number=unit)
    if(iopen)close(unit)
  end subroutine file_gunzip