cs_uptake_read.f90 Source File


This file depends on

sourcefile~~cs_uptake_read.f90~~EfferentGraph sourcefile~cs_uptake_read.f90 cs_uptake_read.f90 sourcefile~basin_module.f90 basin_module.f90 sourcefile~cs_uptake_read.f90->sourcefile~basin_module.f90 sourcefile~climate_module.f90 climate_module.f90 sourcefile~cs_uptake_read.f90->sourcefile~climate_module.f90 sourcefile~constituent_mass_module.f90 constituent_mass_module.f90 sourcefile~cs_uptake_read.f90->sourcefile~constituent_mass_module.f90 sourcefile~cs_module.f90 cs_module.f90 sourcefile~cs_uptake_read.f90->sourcefile~cs_module.f90 sourcefile~hydrograph_module.f90 hydrograph_module.f90 sourcefile~cs_uptake_read.f90->sourcefile~hydrograph_module.f90 sourcefile~input_file_module.f90 input_file_module.f90 sourcefile~cs_uptake_read.f90->sourcefile~input_file_module.f90 sourcefile~maximum_data_module.f90 maximum_data_module.f90 sourcefile~cs_uptake_read.f90->sourcefile~maximum_data_module.f90 sourcefile~time_module.f90 time_module.f90 sourcefile~cs_uptake_read.f90->sourcefile~time_module.f90 sourcefile~hydrograph_module.f90->sourcefile~basin_module.f90 sourcefile~hydrograph_module.f90->sourcefile~time_module.f90

Source Code

      !read in cs uptake parameters (rtb cs)
      subroutine cs_uptake_read
      
      use basin_module
      use input_file_module
      use climate_module
      use time_module
      use maximum_data_module
      use constituent_mass_module
      use hydrograph_module
      use cs_module
      use maximum_data_module
      
      implicit none
      
      character (len=80) :: file = "" !           |filename
      character (len=80) :: header = "" !           |header of file
      character (len=30) :: name = "" !           |header of file
      character (len=30) :: plnt_typ = ""!           |header of file
      logical :: i_exist              !none       |check to determine if file exists
      integer :: eof = 0              !           |end of file
      integer :: i = 0                !           |counters
      integer :: j = 0                !           |counters
      
      
      eof = 0

      !only proceed if there are constituents in the simulation
      if(cs_db%num_cs > 0) then
      
      cs_uptake_on = 0
      inquire (file='cs_uptake',exist=i_exist)
      if(i_exist) then
        
        !turn on constituent uptake feature
        cs_uptake_on = 1
        
        !open and read first lines
        open(5054,file='cs_uptake')
        read(5054,*) header
        read(5054,*) header
        read(5054,*) header
        
        !allocate array
        allocate (cs_uptake_kg(db_mx%plantparm,cs_db%num_cs), source = 0.)
        cs_uptake_kg = 0.
        
        !loop through the plant communities
        do i=1,db_mx%plantparm
          read(5054,*) name,(cs_uptake_kg(i,j),j=1,cs_db%num_cs)
        enddo
        
        close(5054) 
      endif
      
      endif
      
            
      return
      end subroutine cs_uptake_read