
Use dynamic root inputs

MEND_main.F90 -->
      DEALLOCATE(sINI%SIN)

MOD_MEND_TYPE.F90 --> 
      sMEND_INI  -->
          REAL(8), ALLOCATABLE:: SIN_R(:)                  ![mgC/cm3/h],C input from root system
          REAL(8) SIN_R_frac(3)                          !fraction of SOC_R input to 3 pools (POM1, POM2, & DOC)
      sMEND_INP -->
          REAL(8) SIN_R                                  ![mgC/cm3/h], C input from root system	

MEND_IN.F90 -->
      character(len=20)   :: sfilename_ST(20), sfilename_SM(20), sfilename_type1(20), sfilename_type3(20), sfilename_pH(20)
      real(8)             :: Fraction_type1(3), Fraction_type3(3), Input_type2(3), Input_type3(3)
      integer             :: ifdata_type3, nfile_type3
      character(len=10)   :: sUnits_type3
      character(len=10)   :: step_type3
      ifdata_type3, sUnits_type3, step_type3, nfile_type3, sfilename_type3, Fraction_type3, &
      
      ALLOCATE(sINI%SIN_R(sINI%nHour)) !!SOC input from roots

      if(ifdata_type3.eq.1) then  !!nfile = 1 if ststep='monthly'
          sUnits = StrCompress(sUnits_type3)
          ststep = StrCompress(step_type3)  !!convert data with time-step(ststep=monthly,daily) to hourly
          is_total = 0  !!usually litter_input is the total amount during aperiod
          CALL sINP_Read(nfile_type1,sfilename_type1,sINI%dirinp,ststep,is_total,nmons,sINI%nHour,sINI%SIN_R)

      else !!constant input [mgC/cm3/h]
          sINI%SIN_R = Input_type3
      end if

MOD_MEND.F90 -->
      
      sINP%SIN_R = sINI%SIN_R(k)
      
      sOUT % CFLUX % POMadd(1) = sINP%SIN * sINI%SIN_frac(1) + sINI%SIN_other(1,1) + sINP%SIN_R * sINI%SIN_R_frac(1)  !![mg POM/g soil/h], inputs to POM
      sOUT % CFLUX % POMadd(2) = sINP%SIN * sINI%SIN_frac(2) + sINI%SIN_other(1,2) + sINP%SIN_R * sINI%SIN_R_frac(2)
      sOUT % CFLUX % DOMadd    = sINP%SIN * sINI%SIN_frac(3) + sINI%SIN_other(1,3) + sINP%SIN_R * sINI%SIN_R_frac(3)  !![mg DOM/g soil/h], inputs to DOM

      !if(i.ge.jbeg.and.i.le.jend) then
      !    sOUT%CFLUX%POMadd(1) = sOUT%CFLUX%POMadd(1)+sINI%SIN_other(2,1)/DBLE(jend-jbeg+1)
      !    sOUT%CFLUX%POMadd(2) = sOUT%CFLUX%POMadd(2)+sINI%SIN_other(2,2)/DBLE(jend-jbeg+1)
      !    sOUT%CFLUX%DOMadd    = sOUT%CFLUX%DOMadd   +sINI%SIN_other(2,3)/DBLE(jend-jbeg+1)
      !end if

      IF(.NOT.sINI%Carbon_only) THEN
          sOUT % NFLUX % POMadd(1) = sINP%SIN * sINI%SIN_frac(1)/sINI%CN_LITT(1) + sINI%SIN_other(1,1)/sINI%CN_WOOD(1)  !![mg POM/g soil/h], inputs to POM
          sOUT % NFLUX % POMadd(2) = sINP%SIN * sINI%SIN_frac(2)/sINI%CN_LITT(2) + sINI%SIN_other(1,2)/sINI%CN_WOOD(2)
          sOUT % NFLUX % DOMadd    = sINP%SIN * sINI%SIN_frac(3)/sINI%CN_LITT(3) + sINI%SIN_other(1,3)/sINI%CN_WOOD(3)  !![mg DOM/g soil/h], inputs to DOM

          sOUT%NFLUX%POMadd(1) = sOUT%NFLUX%POMadd(1) + sINP%SIN_R * sINI%SIN_R_frac(1)/sINI%CN_LITT(1)
          sOUT%NFLUX%POMadd(2) = sOUT%NFLUX%POMadd(2) + sINP%SIN_R * sINI%SIN_R_frac(2)/sINI%CN_LITT(2)
          sOUT%NFLUX%DOMadd    = sOUT%NFLUX%DOMadd    + sINP%SIN_R * sINI%SIN_R_frac(3)/sINI%CN_LITT(3)
          !if(i.ge.jbeg.and.i.le.jend) then
          !    sOUT%NFLUX%POMadd(1) = sOUT%NFLUX%POMadd(1)+sINI%SIN_other(2,1)/DBLE(jend-jbeg+1)/sINI%CN_ROOT(1)
          !    sOUT%NFLUX%POMadd(2) = sOUT%NFLUX%POMadd(2)+sINI%SIN_other(2,2)/DBLE(jend-jbeg+1)/sINI%CN_ROOT(2)
          !    sOUT%NFLUX%DOMadd    = sOUT%NFLUX%DOMadd   +sINI%SIN_other(2,3)/DBLE(jend-jbeg+1)/sINI%CN_ROOT(3)
          !end if

          sOUT%MNFLUX%NH4_dep = sINI%SIN_NH4(k)
          sOUT%MNFLUX%NO3_dep = sINI%SIN_NO3(k)
      END IF













