use sepin your program. All operations with parameter and header files should be enclosed in two subroutine calls:
call sep_init ()and
call sep_close ()Essentially, sep_init sep_init initialize header and parameter interface just calls initpar, and sep_close sep_close close header interface calls hclose, but the new names make them look more like a constructor-destructor pair, typical for the object-based style of programming. The calls to data access functions (sep_read and sep_write), described below, can be placed anywhere in the program.
My typical main-program style is
An example main program is Clip . Next
sections explain the function interface used in this example.
implicit none
integer :: n1, n2, i2
real :: c
real, dimension (:), allocatable :: data
call sep_init()
call from_history (n1,n2,compress=.true.)
call from_par ("clip", c)
call sep_close ()
allocate (data (n1))
do i2 = 1, n2
call sep_read (data)
where (data > c) data = c
call sep_write (data)
end do
deallocate (data)
call exit (0)
end program Clip
program Clip
use sep