Hi Tristan:
I suspect one reason that GPP<0 with the L2SM code in JULES, is that I don’t currently return all the output variables from the albpft routine:
Currently, there are values returned in can_rad_mod == 5
normal non-L2SM usage:
rnet_dir(i) = rdird - rdiru
rnet_dif(i) = rdifd - rdifu
fapar_dir(l,n,i) = (rnet_dir(i-1) - rnet_dir(i)) / dlai
fapar_dif(l,n,i) = (rnet_dif(i-1) - rnet_dif(i)) / dlai
fapar_dir2dir(l,n,i) = (1.0 - om) * dabeer_dla(i)
fapar_dir2dif(l,n,i) = om * dabeer_dla(i) + fapar_dir(l,n,i)
fapar_dif2dif(l,n,i) = fapar_dif(l,n,i)
fsun(l,n,i) = exp_minus_kla * (EXP(k * dlai) - 1.0) / (k * dlai)
fapar_dir(l,n,i) = fapar_dir(l,n,i) * can_struct_a(n)
fapar_dif(l,n,i) = fapar_dif(l,n,i) * can_struct_a(n)
fapar_dir2dir(l,n,i) = fapar_dir2dir(l,n,i) * can_struct_a(n)
fapar_dir2dif(l,n,i) = fapar_dir2dif(l,n,i) * can_struct_a(n)
fapar_dif2dif(l,n,i) = fapar_dif2dif(l,n,i) * can_struct_a(n)
But in the L2SM version with can_rad_mod == 7, I currently only return a couple of the variables (fapar_dir & fapar_dif). I need to go through the math and return the other variables besides those 2).
!Original L2SM Python code from Tristan Quaife:
!Idn=self.layers[layer].Idn_dir
!Iup=self.layers[layer].Iup_dir
!self.layers[layer].Iab_dir=np.abs(Iup_below-Iup+Idn_above-Idn)
!self.layers[layer].Iab_dir=np.abs(Iup_below-Iup+Idn_above-Idn)
!Idn=self.layers[layer].Idn_dif
!Iup=self.layers[layer].Iup_dif
!self.layers[layer].Iab_dif=np.abs(Iup_below-Iup+Idn_above-Idn)
!initial L2SM FORTRAN code using JULES variable names, by Patrick McGuire
rdn = rdirdn(i)
rup = rdirup(i)
fapar_dir(l,n,i) = ABS(rdirup_below-rup+rdirdn_above-rdn)
rdn = rdifdn(i)
rup = rdifup(i)
fapar_dif(l,n,i) = ABS(rdifup_below-rup+rdifdn_above-rdn)
Patrick