hru_allo.f90 Source File


This file depends on

sourcefile~~hru_allo.f90~~EfferentGraph sourcefile~hru_allo.f90 hru_allo.f90 sourcefile~carbon_module.f90 carbon_module.f90 sourcefile~hru_allo.f90->sourcefile~carbon_module.f90 sourcefile~channel_velocity_module.f90 channel_velocity_module.f90 sourcefile~hru_allo.f90->sourcefile~channel_velocity_module.f90 sourcefile~constituent_mass_module.f90 constituent_mass_module.f90 sourcefile~hru_allo.f90->sourcefile~constituent_mass_module.f90 sourcefile~hru_module.f90 hru_module.f90 sourcefile~hru_allo.f90->sourcefile~hru_module.f90 sourcefile~hydrograph_module.f90 hydrograph_module.f90 sourcefile~hru_allo.f90->sourcefile~hydrograph_module.f90 sourcefile~organic_mineral_mass_module.f90 organic_mineral_mass_module.f90 sourcefile~hru_allo.f90->sourcefile~organic_mineral_mass_module.f90 sourcefile~plant_module.f90 plant_module.f90 sourcefile~hru_allo.f90->sourcefile~plant_module.f90 sourcefile~res_cs_module.f90 res_cs_module.f90 sourcefile~hru_allo.f90->sourcefile~res_cs_module.f90 sourcefile~res_salt_module.f90 res_salt_module.f90 sourcefile~hru_allo.f90->sourcefile~res_salt_module.f90 sourcefile~reservoir_data_module.f90 reservoir_data_module.f90 sourcefile~hru_allo.f90->sourcefile~reservoir_data_module.f90 sourcefile~reservoir_module.f90 reservoir_module.f90 sourcefile~hru_allo.f90->sourcefile~reservoir_module.f90 sourcefile~soil_module.f90 soil_module.f90 sourcefile~hru_allo.f90->sourcefile~soil_module.f90 sourcefile~water_body_module.f90 water_body_module.f90 sourcefile~hru_allo.f90->sourcefile~water_body_module.f90 sourcefile~basin_module.f90 basin_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 hru_allo
    
      use hru_module
      use hydrograph_module
      use organic_mineral_mass_module
      use constituent_mass_module
      use reservoir_module
      use reservoir_data_module
      use carbon_module
      use plant_module
      use soil_module
      use water_body_module
      use channel_velocity_module
      use res_salt_module !rtb
      use res_cs_module !rtb
      
      implicit none

      integer :: imax = 0             !none       |determine max number for array (imax) and total number in file
      integer :: ii = 0               !none       |hru counter

      imax = sp_ob%hru
      if (imax == 0) then
        allocate (hru(0:0))
        allocate (grwway_vel(0:0))
        allocate (soil(0:0))
        allocate (soil1(0:0))
        allocate (soil1_init(0:0))
        allocate (pl_mass(0:0))
        allocate (pcom(0:0))
        allocate (rsd1(0:0))
        allocate (cs_soil(0:0))
        allocate (cs_pl(0:0))
        allocate (cs_irr(0:0))
        allocate (irrig(0:0))
      else 
        allocate (hru(0:imax))
        allocate (grwway_vel(0:imax))
        allocate (soil(0:imax))
        allocate (soil1(0:imax))
        allocate (soil1_init(0:imax))
        allocate (pcom(0:imax))
        allocate (pl_mass(0:imax))
        allocate (cs_soil(0:imax))
        allocate (cs_pl(0:imax))
        allocate (cs_irr(0:imax))
        allocate (irrig(0:imax))
        
        allocate (wet(0:imax))
        allocate (wet_prm(0:imax))
        allocate (wet_hyd(0:imax))
        allocate (wet_om_init(0:imax))
        allocate (wet_ob(imax))
        allocate (wet_in_d(imax))
        allocate (wet_in_m(imax))
        allocate (wet_in_y(imax))
        allocate (wet_in_a(imax))
        allocate (wet_out_d(imax))
        allocate (wet_out_m(imax))
        allocate (wet_out_y(imax))
        allocate (wet_out_a(imax))
        allocate (wet_wat_d(imax))
        allocate (wet_wat_m(imax))
        allocate (wet_wat_y(imax))
        allocate (wet_wat_a(imax))
        allocate (rsd1(0:imax))
        allocate (wet_seep_day(imax))
        allocate (wet_water(imax))
        
        !rtb salt - allocate wetland arrays
        if(cs_db%num_salts > 0) then
          allocate (wetsalt_d(imax))
          allocate (wetsalt_m(imax))
          allocate (wetsalt_y(imax))
          allocate (wetsalt_a(imax))
          do ii=1,imax
            allocate (wetsalt_d(ii)%salt(cs_db%num_salts))
            allocate (wetsalt_m(ii)%salt(cs_db%num_salts))
            allocate (wetsalt_y(ii)%salt(cs_db%num_salts))
            allocate (wetsalt_a(ii)%salt(cs_db%num_salts))
            allocate (wet_water(ii)%salt(cs_db%num_salts))
            allocate (wet_water(ii)%saltc(cs_db%num_salts), source = 0.)
          enddo
        endif
        
        !rtb cs - allocate wetland arrays
        if(cs_db%num_cs > 0) then
          allocate (wetcs_d(imax))
          allocate (wetcs_m(imax))
          allocate (wetcs_y(imax))
          allocate (wetcs_a(imax))
          do ii=1,imax
            allocate (wetcs_d(ii)%cs(cs_db%num_cs))
            allocate (wetcs_m(ii)%cs(cs_db%num_cs))
            allocate (wetcs_y(ii)%cs(cs_db%num_cs))
            allocate (wetcs_a(ii)%cs(cs_db%num_cs))
            allocate (wet_water(ii)%cs(cs_db%num_cs))
            allocate (wet_water(ii)%csc(cs_db%num_cs), source = 0.)
          enddo
        endif
        
      endif

      return
      end subroutine hru_allo