wet_read.f90 Source File


This file depends on

sourcefile~~wet_read.f90~~EfferentGraph sourcefile~wet_read.f90 wet_read.f90 sourcefile~basin_module.f90 basin_module.f90 sourcefile~wet_read.f90->sourcefile~basin_module.f90 sourcefile~constituent_mass_module.f90 constituent_mass_module.f90 sourcefile~wet_read.f90->sourcefile~constituent_mass_module.f90 sourcefile~hru_module.f90 hru_module.f90 sourcefile~wet_read.f90->sourcefile~hru_module.f90 sourcefile~hydrograph_module.f90 hydrograph_module.f90 sourcefile~wet_read.f90->sourcefile~hydrograph_module.f90 sourcefile~input_file_module.f90 input_file_module.f90 sourcefile~wet_read.f90->sourcefile~input_file_module.f90 sourcefile~maximum_data_module.f90 maximum_data_module.f90 sourcefile~wet_read.f90->sourcefile~maximum_data_module.f90 sourcefile~pesticide_data_module.f90 pesticide_data_module.f90 sourcefile~wet_read.f90->sourcefile~pesticide_data_module.f90 sourcefile~res_cs_module.f90 res_cs_module.f90 sourcefile~wet_read.f90->sourcefile~res_cs_module.f90 sourcefile~res_salt_module.f90 res_salt_module.f90 sourcefile~wet_read.f90->sourcefile~res_salt_module.f90 sourcefile~reservoir_data_module.f90 reservoir_data_module.f90 sourcefile~wet_read.f90->sourcefile~reservoir_data_module.f90 sourcefile~reservoir_module.f90 reservoir_module.f90 sourcefile~wet_read.f90->sourcefile~reservoir_module.f90 sourcefile~hydrograph_module.f90->sourcefile~basin_module.f90 sourcefile~time_module.f90 time_module.f90 sourcefile~hydrograph_module.f90->sourcefile~time_module.f90

Source Code

      subroutine wet_read
      
      use basin_module
      use input_file_module
      use maximum_data_module
      use reservoir_data_module
      use reservoir_module
      use hydrograph_module
      use constituent_mass_module
      use pesticide_data_module
      use res_salt_module
      use res_cs_module
      use hru_module, only : hru
      
      implicit none

      character (len=80) :: titldum = "" !           |title of file
      character (len=80) :: header = ""  !           |header of file
      integer :: eof = 0                 !           |end of file
      integer :: imax = 0                !none       |determine max number for array (imax) and total number in file
      logical :: i_exist                 !none       |check to determine if file exists
      integer :: i = 0                   !none       |counter
      integer :: ires = 0                !none       |counter 
      integer :: k = 0                   !none       |counter 
      
      eof = 0
      imax = 0
            
      !read wetland.wet
      imax = 0
      inquire (file=in_res%wet, exist=i_exist)
      if (.not. i_exist .or. in_res%wet == "null") then
        allocate (wet_dat_c(0:0))
        allocate (wet_dat(0:0))
      else   
        do
          open (105,file=in_res%wet)
          read (105,*,iostat=eof) titldum
          if (eof < 0) exit
          read (105,*,iostat=eof) header
          if (eof < 0) exit
          do while (eof == 0)
            read (105,*,iostat=eof) i
            if (eof < 0) exit
            imax = imax + 1
          end do
        
          db_mx%wet_dat = imax
       
          allocate (wet_dat_c(imax))
          allocate (wet_dat(imax))
      
          rewind (105)
          read (105,*,iostat = eof) titldum
          if (eof < 0) exit
          read (105,*,iostat=eof) header
          if (eof < 0) exit
      
          do ires = 1, db_mx%wet_dat
            read (105,*,iostat=eof) i
            if (eof < 0) exit
            backspace (105)
            read (105,*,iostat=eof) k, wet_dat_c(ires)
            if (eof < 0) exit
          end do
      
          db_mx%wet_dat = imax
            
         close (105)
         exit
       end do
      end if
      
      return
      end subroutine wet_read