walkeranthonyp / MAAT

MAAT
GNU General Public License v3.0
12 stars 17 forks source link

MAAT crashes during unit_testing.R on mac osx #34

Closed serbinsh closed 3 years ago

serbinsh commented 4 years ago

Running via Rscript

NULL
Error in if (.$wpars$UQ | .$wpars$mcmc) .$init_uq() :
  argument is of length zero
Calls: <Anonymous> -> res -> <Anonymous> -> res
Execution halted

and via R studio


[1] "init_dynamic"
NULL
 Error in if (.$wpars$UQ | .$wpars$mcmc) .$init_uq() : 
  argument is of length zero 
9.
res(x, ...) 
8.
.$init() at wrapper_object.R#578
7.
res(x, ...) 
6.
wrapper_object$.test_init() at unit_testing.R#63
5.
eval(ei, envir) 
4.
eval(ei, envir) 
3.
withVisible(eval(ei, envir)) 
2.
source("~/Data/GitHub/MAAT/src/unit_testing.R") 
1.
source("~/Data/GitHub/MAAT/src/unit_testing.R") 

Session info

> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] deSolve_1.28        randtoolbox_1.30.0  rngWELL_0.10-6      xtable_1.8-4        proto_1.0.0         shiny_1.4.0.2       FieldSpectra_0.9222
 [8] Rcpp_1.0.4          signal_0.7-6        Hmisc_4.4-0         ggplot2_3.3.0       Formula_1.2-3       survival_3.1-8      lattice_0.20-38    
[15] XML_3.99-0.3        spectrolab_0.0.8    dplyr_0.8.5        

loaded via a namespace (and not attached):
 [1] pkgload_1.0.2       jsonlite_1.6.1      splines_3.6.2       foreach_1.5.0       assertthat_0.2.1    latticeExtra_0.6-29 remotes_2.1.1      
 [8] sessioninfo_1.1.1   pillar_1.4.4        backports_1.1.7     glue_1.4.1          digest_0.6.25       RColorBrewer_1.1-2  promises_1.1.0     
[15] checkmate_1.9.4     colorspace_1.4-1    htmltools_0.4.0     httpuv_1.5.2        Matrix_1.2-18       pkgconfig_2.0.3     devtools_2.3.0     
[22] purrr_0.3.4         scales_1.1.0        processx_3.4.2      jpeg_0.1-8.1        later_1.0.0         prospectr_0.2.0     htmlTable_1.13.3   
[29] tibble_3.0.1        usethis_1.6.1       ellipsis_0.3.1      withr_2.2.0         shinyjs_1.1         nnet_7.3-12         cli_2.0.2          
[36] magrittr_1.5        crayon_1.3.4        mime_0.9            memoise_1.1.0       ps_1.3.3            fs_1.4.1            fansi_0.4.1        
[43] MASS_7.3-51.5       foreign_0.8-75      pkgbuild_1.0.8      tools_3.6.2         data.table_1.12.8   prettyunits_1.1.1   lifecycle_0.2.0    
[50] stringr_1.4.0       munsell_0.5.0       cluster_2.1.0       callr_3.4.3         compiler_3.6.2      rlang_0.4.6         grid_3.6.2         
[57] iterators_1.0.12    rstudioapi_0.11     htmlwidgets_1.5.1   base64enc_0.1-3     testthat_2.3.2      gtable_0.3.0        codetools_0.2-16   
[64] R6_2.4.1            gridExtra_2.3       knitr_1.28          fastmap_1.0.1       rprojroot_1.3-2     desc_1.2.0          stringi_1.4.6      
[71] vctrs_0.3.0         rpart_4.1-15        acepack_1.4.1       png_0.1-7           tidyselect_1.0.0    xfun_0.13          
serbinsh commented 4 years ago

Also when running via Rscript I get the following

Rplots.pdf

Not sure if the plotting issues are a result of not finishing? But I suspect the intent is not looped line plotting?

serbinsh commented 4 years ago

Also working through leaf system models

10-4-25-253:leaf sserbin$ pwd
/Users/sserbin/Data/GitHub/MAAT/src/system_models/leaf
open -na Rstudio unit_testing.R

$oi
[1] 21.27825

$ca
[1] 30.3975

$cb
[1] 30.3975

$ci
[1] 23.65628

$cc
[1] 23.65628

$leaf_temp
[1] 25

$leafN_area
[1] 2

$fwdw_ratio
[1] 5

$J
[1] 112.1699

$Acg
[1] 17.4139

$Ajg
[1] 21.99895

$Apg
[1] 40.57308

$A
[1] 13.97193

$rd
[1] 1.05

$lim
[1] 2

$A_ana_rbzero
[1] 0

$A_ana_rbg0zero
[1] 0

$aguess
[1] 0 0 0 0

$faguess
[1] 0 0 0 0

$aguess_flag
[1] 0

$iter
[1] 0

$estimprec
[1] 0

$assim
[1] 0 0

$fA_ana_final
[1] 0 0

$A_noR
[1] 0

$transition
[1] 0

$d13c
[1] 0

            oi             ca             cb             ci             cc      leaf_temp     leafN_area     fwdw_ratio              J            Acg 
     21.278250      30.397500      30.397500      23.656279      23.656279      25.000000       2.000000       5.000000     112.169861      17.413897 
           Ajg            Apg              A             rd            lim   A_ana_rbzero A_ana_rbg0zero        aguess1        aguess2        aguess3 
     21.998954      40.573080      13.971927       1.050000       2.000000       0.000000       0.000000       0.000000       0.000000       0.000000 
       aguess4       faguess1       faguess2       faguess3       faguess4    aguess_flag           iter      estimprec         assim1         assim2 
      0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000 
 fA_ana_final1  fA_ana_final2          A_noR     transition           d13c          vcmax        vcmaxlt           jmax         jmaxlt            tpu 
      0.000000       0.000000       0.000000       0.000000       0.000000      70.000000      70.000000     120.441091     120.441091      11.666667 
         tpult             rd             Kc             Ko             Km          gstar            tau          gamma             rb             rs 
     11.666667       1.050000      40.490000      27.840000      71.436708       3.249404       0.000000       4.386756       0.000000       2.976087 
            ri          alpha       cica_chi 
      0.000000       0.385000       0.000000 
> leaf_object$.test(verbose=F, cverbose=T )
[1] 
[1] Configure: leaf , pars .
[1] df passed to configure:
              leaf.diag               leaf.d13c        leaf.deltaA_prop         leaf.solver_min         leaf.solver_max                  leaf.a 
           0.000000e+00            0.000000e+00            1.500000e-01           -2.983400e-03            5.183644e+01            8.000000e-01 
                 leaf.f        leaf.ko_kc_ratio            leaf.theta_j       leaf.theta_col_cj      leaf.theta_col_cjp             leaf.avn_25 
           2.300000e-01            2.100000e-01            9.000000e-01            9.500000e-01            9.800000e-01            1.000000e+01 
            leaf.bvn_25             leaf.ajv_25             leaf.bjv_25           leaf.a_jvt_25           leaf.b_jvt_25           leaf.e_ajv_25 
           3.000000e+01            2.900000e+01            1.630000e+00            2.590000e+00           -3.500000e-02            1.010000e+00 
          leaf.e_bjv_25             leaf.atv_25             leaf.btv_25               leaf.flnr                leaf.fnr                leaf.Rsa 
           8.900000e-01            0.000000e+00            1.666667e-01            9.000000e-02            7.160000e+00            6.000000e+01 
         leaf.Apg_alpha                 leaf.g0          leaf.g1_medlyn         leaf.g1_leuning                 leaf.d0            leaf.g1_ball 
           0.000000e+00            1.000000e-02            6.000000e+00            1.000000e+01            1.000000e+00            6.000000e+00 
          leaf.g_a1_yin           leaf.g_b1_yin                 leaf.rs           leaf.cica_chi                 leaf.rb            leaf.can_ttc 
           8.500000e-01            1.400000e-01            6.666667e+00            7.000000e-01            1.000000e-01            1.000000e-02 
        leaf.leaf_width                 leaf.ri           leaf.co2_diff      leaf.hco_co2_ratio leaf.hco_co2_diff_ratio             leaf.d13c_a 
           1.000000e-01            6.666667e+00            1.700000e-09            0.000000e+00            5.600000e-01            4.400000e+00 
            leaf.d13c_b       leaf.d13c_b_prime            leaf.d13c_am             leaf.d13c_f           leaf.a_rdv_25           leaf.b_rdv_25 
           2.700000e+01            3.000000e+01            1.800000e+00            1.200000e+01            0.000000e+00            1.500000e-02 
          leaf.a_rdn_25           leaf.b_rdn_25        leaf.rl_rd_ratio      leaf.rl_rd_lloyd_a      leaf.rl_rd_lloyd_b         leaf.a_rdv_25_t 
           5.000000e-01            1.500000e-01            1.000000e+00            5.000000e-01            5.000000e-02            1.500000e-02 
        leaf.b_rdv_25_t         leaf.reftemp.rd      leaf.reftemp.vcmax       leaf.reftemp.jmax        leaf.reftemp.tpu         leaf.reftemp.Kc 
          -5.000000e-04            2.500000e+01            2.500000e+01            2.500000e+01            2.500000e+01            2.500000e+01 
        leaf.reftemp.Ko      leaf.reftemp.gstar        leaf.reftemp.tau           leaf.atref.rd        leaf.atref.vcmax         leaf.atref.jmax 
           2.500000e+01            2.500000e+01            2.500000e+01            2.000000e+00            5.000000e+01            1.000000e+02 
         leaf.atref.tpu           leaf.atref.Kc           leaf.atref.Ko        leaf.atref.gstar          leaf.atref.tau        leaf.atref.vomax 
           5.000000e+00            4.049000e+01            2.784000e+01            4.325000e+00            2.600000e+03            0.000000e+00 
             leaf.Ha.rd           leaf.Ha.vcmax            leaf.Ha.jmax             leaf.Ha.tpu              leaf.Ha.Kc              leaf.Ha.Ko 
           6.983000e+04            6.983000e+04            1.002800e+05            6.983000e+04            7.943000e+04            3.638000e+04 
          leaf.Ha.gstar             leaf.Ha.tau           leaf.Ha.vomax              leaf.Hd.rd           leaf.Hd.vcmax            leaf.Hd.jmax 
           3.783000e+04           -4.157200e+04            6.011000e+04            2.000000e+05            2.000000e+05            2.000000e+05 
            leaf.Hd.tpu            leaf.Topt.rd         leaf.Topt.vcmax          leaf.Topt.jmax           leaf.Topt.tpu          leaf.deltaS.rd 
           2.000000e+05            2.756000e+01            2.756000e+01            1.989000e+01            2.756000e+01            0.000000e+00 
      leaf.deltaS.vcmax        leaf.deltaS.jmax         leaf.deltaS.tpu      leaf.a_deltaS_t.rd   leaf.a_deltaS_t.vcmax    leaf.a_deltaS_t.jmax 
           0.000000e+00            0.000000e+00            0.000000e+00            4.900000e+02            6.680000e+02            6.600000e+02 
    leaf.a_deltaS_t.tpu      leaf.b_deltaS_t.rd   leaf.b_deltaS_t.vcmax    leaf.b_deltaS_t.jmax     leaf.b_deltaS_t.tpu             leaf.q10.rd 
           4.850000e+02            0.000000e+00           -1.070000e+00           -7.500000e-01            0.000000e+00            2.000000e+00 
         leaf.q10.vcmax           leaf.q10.jmax            leaf.q10.tpu             leaf.q10.Kc             leaf.q10.Ko            leaf.q10.tau 
           2.000000e+00            2.000000e+00            2.000000e+00            2.000000e+00            2.000000e+00            5.700000e-01 
        leaf.a_q10_t.rd         leaf.b_q10_t.rd     leaf.tupp_cox.vcmax        leaf.tupp_cox.rd     leaf.tlow_cox.vcmax        leaf.tlow_cox.rd 
           3.220000e+00           -4.600000e-02            3.600000e+01            4.500000e+01            0.000000e+00            5.000000e+00 
     leaf.exp_cox.vcmax         leaf.exp_cox.rd         leaf.gstar_bf_a         leaf.gstar_bf_b         leaf.gstar_bf_c                  leaf.R 
           3.000000e-01            4.000000e-01            1.200000e-02            1.680000e+00            4.270000e+01            8.314460e+00 
[1] listnames:
     [,1] [,2] [,3]        [,4]       [,5]       [,6] [,7] [,8]        [,9]    [,10]        [,11]         [,12]  [,13]  [,14]  [,15]  [,16]    [,17]   
[1,] leaf leaf leaf        leaf       leaf       leaf leaf leaf        leaf    leaf         leaf          leaf   leaf   leaf   leaf   leaf     leaf    
[2,] diag d13c deltaA_prop solver_min solver_max a    f    ko_kc_ratio theta_j theta_col_cj theta_col_cjp avn_25 bvn_25 ajv_25 bjv_25 a_jvt_25 b_jvt_25
[3,]                                                                                                                                                   
     [,18]    [,19]    [,20]  [,21]  [,22] [,23] [,24] [,25]     [,26] [,27]     [,28]      [,29] [,30]   [,31]    [,32]    [,33] [,34]    [,35] [,36]  
[1,] leaf     leaf     leaf   leaf   leaf  leaf  leaf  leaf      leaf  leaf      leaf       leaf  leaf    leaf     leaf     leaf  leaf     leaf  leaf   
[2,] e_ajv_25 e_bjv_25 atv_25 btv_25 flnr  fnr   Rsa   Apg_alpha g0    g1_medlyn g1_leuning d0    g1_ball g_a1_yin g_b1_yin rs    cica_chi rb    can_ttc
[3,]                                                                                                                                                    
     [,37]      [,38] [,39]    [,40]         [,41]              [,42]  [,43]  [,44]        [,45]   [,46]  [,47]    [,48]    [,49]    [,50]    [,51]      
[1,] leaf       leaf  leaf     leaf          leaf               leaf   leaf   leaf         leaf    leaf   leaf     leaf     leaf     leaf     leaf       
[2,] leaf_width ri    co2_diff hco_co2_ratio hco_co2_diff_ratio d13c_a d13c_b d13c_b_prime d13c_am d13c_f a_rdv_25 b_rdv_25 a_rdn_25 b_rdn_25 rl_rd_ratio
[3,]                                                                                                                                                     
     [,52]         [,53]         [,54]      [,55]      [,56]   [,57]   [,58]   [,59]   [,60]   [,61]   [,62]   [,63]   [,64] [,65] [,66] [,67] [,68] [,69]
[1,] leaf          leaf          leaf       leaf       leaf    leaf    leaf    leaf    leaf    leaf    leaf    leaf    leaf  leaf  leaf  leaf  leaf  leaf 
[2,] rl_rd_lloyd_a rl_rd_lloyd_b a_rdv_25_t b_rdv_25_t reftemp reftemp reftemp reftemp reftemp reftemp reftemp reftemp atref atref atref atref atref atref
[3,]                                                   rd      vcmax   jmax    tpu     Kc      Ko      gstar   tau     rd    vcmax jmax  tpu   Kc    Ko   
     [,70] [,71] [,72] [,73] [,74] [,75] [,76] [,77] [,78] [,79] [,80] [,81] [,82] [,83] [,84] [,85] [,86] [,87] [,88] [,89] [,90]  [,91]  [,92]  [,93] 
[1,] leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf   leaf   leaf   leaf  
[2,] atref atref atref Ha    Ha    Ha    Ha    Ha    Ha    Ha    Ha    Ha    Hd    Hd    Hd    Hd    Topt  Topt  Topt  Topt  deltaS deltaS deltaS deltaS
[3,] gstar tau   vomax rd    vcmax jmax  tpu   Kc    Ko    gstar tau   vomax rd    vcmax jmax  tpu   rd    vcmax jmax  tpu   rd     vcmax  jmax   tpu   
     [,94]      [,95]      [,96]      [,97]      [,98]      [,99]      [,100]     [,101]     [,102] [,103] [,104] [,105] [,106] [,107] [,108] [,109]  [,110] 
[1,] leaf       leaf       leaf       leaf       leaf       leaf       leaf       leaf       leaf   leaf   leaf   leaf   leaf   leaf   leaf   leaf    leaf   
[2,] a_deltaS_t a_deltaS_t a_deltaS_t a_deltaS_t b_deltaS_t b_deltaS_t b_deltaS_t b_deltaS_t q10    q10    q10    q10    q10    q10    q10    a_q10_t b_q10_t
[3,] rd         vcmax      jmax       tpu        rd         vcmax      jmax       tpu        rd     vcmax  jmax   tpu    Kc     Ko     tau    rd      rd     
     [,111]   [,112]   [,113]   [,114]   [,115]  [,116]  [,117]     [,118]     [,119]     [,120]
[1,] leaf     leaf     leaf     leaf     leaf    leaf    leaf       leaf       leaf       leaf  
[2,] tupp_cox tupp_cox tlow_cox tlow_cox exp_cox exp_cox gstar_bf_a gstar_bf_b gstar_bf_c R     
[3,] vcmax    rd       vcmax    rd       vcmax   rd                                             
[1]   subscripts for this model object: leaf
  [1]   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39
 [39]  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77
 [77]  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
[115] 116 117 118 119 120
[1]   subscripts for variables that are lists:
 [1]  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93
[39]  94  95  96  97  98  99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
[1]   subscripts for variables that are not lists:
 [1]   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39
[39]  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55 117 118 119 120
[1]   subscripts in: leaf pars  for variables that are not lists:
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
[52] 52 53 54 69 70 71 72
 [1] d13c               deltaA_prop        solver_min         solver_max         a                  f                  ko_kc_ratio        theta_j           
 [9] theta_col_cj       theta_col_cjp      avn_25             bvn_25             ajv_25             bjv_25             a_jvt_25           b_jvt_25          
[17] e_ajv_25           e_bjv_25           atv_25             btv_25             flnr               fnr                Rsa                Apg_alpha         
[25] g0                 g1_medlyn          g1_leuning         d0                 g1_ball            g_a1_yin           g_b1_yin           rs                
[33] cica_chi           rb                 can_ttc            leaf_width         ri                 co2_diff           hco_co2_ratio      hco_co2_diff_ratio
[41] d13c_a             d13c_b             d13c_b_prime       d13c_am            d13c_f             a_rdv_25           b_rdv_25           a_rdn_25          
[49] b_rdn_25           rl_rd_ratio        rl_rd_lloyd_a      rl_rd_lloyd_b      a_rdv_25_t         b_rdv_25_t         reftemp            atref             
[57] Ha                 Hd                 Topt               deltaS             a_deltaS_t         b_deltaS_t         q10                a_q10_t           
[65] b_q10_t            tupp_cox           tlow_cox           exp_cox            gstar_bf_a         gstar_bf_b         gstar_bf_c         R                 
[1] 
[1] Configure: leaf , env .
[1] df passed to configure:
  leaf.ca_conc   leaf.o2_conc       leaf.par   leaf.water_l   leaf.sphag_l      leaf.temp       leaf.vpd        leaf.rh leaf.atm_press      leaf.wind 
        400.00           0.21        1000.00           0.00           0.00          25.00           1.00           0.00      101325.00           1.00 
[1] listnames:
     [,1]    [,2]    [,3] [,4]    [,5]    [,6] [,7] [,8] [,9]      [,10]
[1,] leaf    leaf    leaf leaf    leaf    leaf leaf leaf leaf      leaf 
[2,] ca_conc o2_conc par  water_l sphag_l temp vpd  rh   atm_press wind 
[3,]                                                                    
[1]   subscripts for this model object: leaf
 [1]  1  2  3  4  5  6  7  8  9 10
[1]   subscripts for variables that are lists:
NULL
[1]   subscripts for variables that are not lists:
 [1]  1  2  3  4  5  6  7  8  9 10
[1]   subscripts in: leaf env  for variables that are not lists:
 [1]  1  2  3  4  5  6  7  8  9 10
 [1] ca_conc   o2_conc   par       water_l   sphag_l   temp      vpd       rh        atm_press wind     
[1] 
[1] Configure: leaf , fnames .
[1] df passed to configure:
                   leaf.sys                 leaf.solver          leaf.residual_func                leaf.semiana                    leaf.Acg 
              f_sys_enzymek              f_solver_brent     f_residual_func_leaf_Ar              f_semiana_quad          f_Acg_farquhar1980 
                   leaf.Ajg                    leaf.Apg                 leaf.etrans               leaf.gas_diff                   leaf.Alim 
              f_Ajg_generic              f_Apg_vonc2000         f_etrans_harley1992         f_gas_diff_ficks_ci         f_Alim_farquhar1980 
                 leaf.vcmax                   leaf.jmax              leaf.tcor_jmax                    leaf.tpu                     leaf.rd 
                f_vcmax_lin                f_jmax_power               f_scalar_none                   f_tpu_lin              f_rd_lin_vcmax 
                 leaf.rl_rd                  leaf.gstar                     leaf.ri                     leaf.rs                     leaf.rb 
              f_scalar_none               f_gstar_f1980                    f_r_zero             f_rs_medlyn2011                f_rb_leafdim 
            leaf.cica_ratio                   leaf.d13c         leaf.tcor_asc.vcmax          leaf.tcor_asc.jmax           leaf.tcor_asc.tpu 
      f_cica_ratio_constant            f_d13c_classical        f_tcor_asc_Arrhenius        f_tcor_asc_Arrhenius        f_tcor_asc_Arrhenius 
           leaf.tcor_asc.rd         leaf.tcor_asc.gstar           leaf.tcor_asc.tau            leaf.tcor_asc.Kc            leaf.tcor_asc.Ko 
       f_tcor_asc_Arrhenius f_tcor_asc_quadratic_bf1985              f_tcor_asc_Q10        f_tcor_asc_Arrhenius        f_tcor_asc_Arrhenius 
        leaf.tcor_des.vcmax          leaf.tcor_des.jmax           leaf.tcor_des.tpu            leaf.tcor_des.rd           leaf.tcor_dep.tpu 
    f_tcor_des_modArrhenius     f_tcor_des_modArrhenius     f_tcor_des_modArrhenius               f_scalar_none      f_tcor_dep_independent 
           leaf.tcor_dep.rd           leaf.tcor_dep.tau              leaf.deltaS.rd           leaf.deltaS.vcmax            leaf.deltaS.jmax 
     f_tcor_dep_independent      f_tcor_dep_independent                    f_deltaS                    f_deltaS                    f_deltaS 
            leaf.deltaS.tpu                 leaf.q10.rd              leaf.q10.vcmax               leaf.q10.jmax                leaf.q10.tau 
                   f_deltaS              f_q10_constant              f_q10_constant              f_q10_constant              f_q10_constant 
                leaf.q10.Kc                 leaf.q10.Ko 
             f_q10_constant              f_q10_constant 
[1] listnames:
     [,1] [,2]   [,3]          [,4]    [,5] [,6] [,7] [,8]   [,9]     [,10] [,11] [,12] [,13]     [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21]      [,22]
[1,] leaf leaf   leaf          leaf    leaf leaf leaf leaf   leaf     leaf  leaf  leaf  leaf      leaf  leaf  leaf  leaf  leaf  leaf  leaf  leaf       leaf 
[2,] sys  solver residual_func semiana Acg  Ajg  Apg  etrans gas_diff Alim  vcmax jmax  tcor_jmax tpu   rd    rl_rd gstar ri    rs    rb    cica_ratio d13c 
[3,]                                                                                                                                                        
     [,23]    [,24]    [,25]    [,26]    [,27]    [,28]    [,29]    [,30]    [,31]    [,32]    [,33]    [,34]    [,35]    [,36]    [,37]    [,38]  [,39] 
[1,] leaf     leaf     leaf     leaf     leaf     leaf     leaf     leaf     leaf     leaf     leaf     leaf     leaf     leaf     leaf     leaf   leaf  
[2,] tcor_asc tcor_asc tcor_asc tcor_asc tcor_asc tcor_asc tcor_asc tcor_asc tcor_des tcor_des tcor_des tcor_des tcor_dep tcor_dep tcor_dep deltaS deltaS
[3,] vcmax    jmax     tpu      rd       gstar    tau      Kc       Ko       vcmax    jmax     tpu      rd       tpu      rd       tau      rd     vcmax 
     [,40]  [,41]  [,42] [,43] [,44] [,45] [,46] [,47]
[1,] leaf   leaf   leaf  leaf  leaf  leaf  leaf  leaf 
[2,] deltaS deltaS q10   q10   q10   q10   q10   q10  
[3,] jmax   tpu    rd    vcmax jmax  tau   Kc    Ko   
[1]   subscripts for this model object: leaf
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
[1]   subscripts for variables that are lists:
 [1] 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
[1]   subscripts for variables that are not lists:
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22
[1]   subscripts in: leaf fnames  for variables that are not lists:
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22
 [1] sys           solver        residual_func semiana       Acg           Ajg           Apg           etrans        gas_diff      Alim          vcmax        
[12] jmax          tcor_jmax     tpu           rd            rl_rd         gstar         ri            rs            rb            cica_ratio    d13c         
[23] tcor_asc      tcor_des      tcor_dep      deltaS        q10          
            oi             ca             cb             ci             cc      leaf_temp     leafN_area     fwdw_ratio              J            Acg 
     21.278250      30.397500      30.397500      23.656279      23.656279      25.000000       2.000000       5.000000     112.169861      17.413897 
           Ajg            Apg              A             rd            lim   A_ana_rbzero A_ana_rbg0zero        aguess1        aguess2        aguess3 
     21.998954      40.573080      13.971927       1.050000       2.000000       0.000000       0.000000       0.000000       0.000000       0.000000 
       aguess4       faguess1       faguess2       faguess3       faguess4    aguess_flag           iter      estimprec         assim1         assim2 
      0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000 
 fA_ana_final1  fA_ana_final2          A_noR     transition           d13c          vcmax        vcmaxlt           jmax         jmaxlt            tpu 
      0.000000       0.000000       0.000000       0.000000       0.000000      70.000000      70.000000     120.441091     120.441091      11.666667 
         tpult             rd             Kc             Ko             Km          gstar            tau          gamma             rb             rs 
     11.666667       1.050000      40.490000      27.840000      71.436708       3.249404       0.000000       4.386756       0.000000       2.976087 
            ri          alpha       cica_chi 
      0.000000       0.385000       0.000000 
> leaf_object$fnames
$sys
[1] "f_sys_enzymek"

$solver
[1] "f_solver_brent"

$residual_func
[1] "f_residual_func_leaf_Ar"

$semiana
[1] "f_semiana_quad"

$Acg
[1] "f_Acg_farquhar1980"

$Ajg
[1] "f_Ajg_generic"

$Apg
[1] "f_Apg_vonc2000"

$etrans
[1] "f_etrans_harley1992"

$gas_diff
[1] "f_gas_diff_ficks_ci"

$Alim
[1] "f_Alim_farquhar1980"

$vcmax
[1] "f_vcmax_lin"

$jmax
[1] "f_jmax_power"

$tcor_jmax
[1] "f_scalar_none"

$tpu
[1] "f_tpu_lin"

$rd
[1] "f_rd_lin_vcmax"

$rl_rd
[1] "f_scalar_none"

$gstar
[1] "f_gstar_f1980"

$ri
[1] "f_r_zero"

$rs
[1] "f_rs_medlyn2011"

$rb
[1] "f_r_zero"

$cica_ratio
[1] "f_cica_ratio_constant"

$d13c
[1] "f_d13c_classical"

$tcor_asc
$tcor_asc$vcmax
[1] "f_tcor_asc_Arrhenius"

$tcor_asc$jmax
[1] "f_tcor_asc_Arrhenius"

$tcor_asc$tpu
[1] "f_tcor_asc_Arrhenius"

$tcor_asc$rd
[1] "f_tcor_asc_Arrhenius"

$tcor_asc$gstar
[1] "f_tcor_asc_quadratic_bf1985"

$tcor_asc$tau
[1] "f_tcor_asc_Q10"

$tcor_asc$Kc
[1] "f_tcor_asc_Arrhenius"

$tcor_asc$Ko
[1] "f_tcor_asc_Arrhenius"

$tcor_des
$tcor_des$vcmax
[1] "f_tcor_des_modArrhenius"

$tcor_des$jmax
[1] "f_tcor_des_modArrhenius"

$tcor_des$tpu
[1] "f_tcor_des_modArrhenius"

$tcor_des$rd
[1] "f_scalar_none"

$tcor_dep
$tcor_dep$tpu
[1] "f_tcor_dep_independent"

$tcor_dep$rd
[1] "f_tcor_dep_independent"

$tcor_dep$tau
[1] "f_tcor_dep_independent"

$deltaS
$deltaS$rd
[1] "f_deltaS"

$deltaS$vcmax
[1] "f_deltaS"

$deltaS$jmax
[1] "f_deltaS"

$deltaS$tpu
[1] "f_deltaS"

$q10
$q10$rd
[1] "f_q10_constant"

$q10$vcmax
[1] "f_q10_constant"

$q10$jmax
[1] "f_q10_constant"

$q10$tau
[1] "f_q10_constant"

$q10$Kc
[1] "f_q10_constant"

$q10$Ko
[1] "f_q10_constant"

> leaf_object$state
$oi
[1] 21.27825

$ca
[1] 30.3975

$cb
[1] 30.3975

$ci
[1] 23.65628

$cc
[1] 23.65628

$leaf_temp
[1] 25

$leafN_area
[1] 2

$fwdw_ratio
[1] 5

$J
[1] 112.1699

$Acg
[1] 17.4139

$Ajg
[1] 21.99895

$Apg
[1] 40.57308

$A
[1] 13.97193

$rd
[1] 1.05

$lim
[1] 2

$A_ana_rbzero
[1] 0

$A_ana_rbg0zero
[1] 0

$aguess
[1] 0 0 0 0

$faguess
[1] 0 0 0 0

$aguess_flag
[1] 0

$iter
[1] 0

$estimprec
[1] 0

$assim
[1] 0 0

$fA_ana_final
[1] 0 0

$A_noR
[1] 0

$transition
[1] 0

$d13c
[1] 0

> leaf_object$state_pars
$vcmax
[1] 70

$vcmaxlt
[1] 70

$jmax
[1] 120.4411

$jmaxlt
[1] 120.4411

$tpu
[1] 11.66667

$tpult
[1] 11.66667

$rd
[1] 1.05

$Kc
[1] 40.49

$Ko
[1] 27.84

$Km
[1] 71.43671

$gstar
[1] 3.249404

$tau
[1] 0

$gamma
[1] 4.386756

$rb
[1] 0

$rs
[1] 2.976087

$ri
[1] 0

$alpha
[1] 0.385

$cica_chi
[1] 0

> leaf_object$pars
$d13c
[1] 0

$deltaA_prop
[1] 0.15

$solver_min
[1] -0.0029834

$solver_max
[1] 51.83644

$a
[1] 0.8

$f
[1] 0.23

$ko_kc_ratio
[1] 0.21

$theta_j
[1] 0.9

$theta_col_cj
[1] 0.95

$theta_col_cjp
[1] 0.98

$avn_25
[1] 10

$bvn_25
[1] 30

$ajv_25
[1] 29

$bjv_25
[1] 1.63

$a_jvt_25
[1] 2.59

$b_jvt_25
[1] -0.035

$e_ajv_25
[1] 1.01

$e_bjv_25
[1] 0.89

$atv_25
[1] 0

$btv_25
[1] 0.1666667

$flnr
[1] 0.09

$fnr
[1] 7.16

$Rsa
[1] 60

$Apg_alpha
[1] 0

$g0
[1] 0.01

$g1_medlyn
[1] 6

$g1_leuning
[1] 10

$d0
[1] 1

$g1_ball
[1] 6

$g_a1_yin
[1] 0.85

$g_b1_yin
[1] 0.14

$rs
[1] 6.666667

$cica_chi
[1] 0.7

$rb
[1] 0.1

$can_ttc
[1] 0.01

$leaf_width
[1] 0.1

$ri
[1] 6.666667

$co2_diff
[1] 1.7e-09

$hco_co2_ratio
[1] 0

$hco_co2_diff_ratio
[1] 0.56

$d13c_a
[1] 4.4

$d13c_b
[1] 27

$d13c_b_prime
[1] 30

$d13c_am
[1] 1.8

$d13c_f
[1] 12

$a_rdv_25
[1] 0

$b_rdv_25
[1] 0.015

$a_rdn_25
[1] 0.5

$b_rdn_25
[1] 0.15

$rl_rd_ratio
[1] 1

$rl_rd_lloyd_a
[1] 0.5

$rl_rd_lloyd_b
[1] 0.05

$a_rdv_25_t
[1] 0.015

$b_rdv_25_t
[1] -5e-04

$reftemp
$reftemp$rd
[1] 25

$reftemp$vcmax
[1] 25

$reftemp$jmax
[1] 25

$reftemp$tpu
[1] 25

$reftemp$Kc
[1] 25

$reftemp$Ko
[1] 25

$reftemp$gstar
[1] 25

$reftemp$tau
[1] 25

$atref
$atref$rd
[1] 2

$atref$vcmax
[1] 50

$atref$jmax
[1] 100

$atref$tpu
[1] 5

$atref$Kc
[1] 40.49

$atref$Ko
[1] 27.84

$atref$gstar
[1] 4.325

$atref$tau
[1] 2600

$atref$vomax
[1] 0

$Ha
$Ha$rd
[1] 69830

$Ha$vcmax
[1] 69830

$Ha$jmax
[1] 100280

$Ha$tpu
[1] 69830

$Ha$Kc
[1] 79430

$Ha$Ko
[1] 36380

$Ha$gstar
[1] 37830

$Ha$tau
[1] -41572

$Ha$vomax
[1] 60110

$Hd
$Hd$rd
[1] 2e+05

$Hd$vcmax
[1] 2e+05

$Hd$jmax
[1] 2e+05

$Hd$tpu
[1] 2e+05

$Topt
$Topt$rd
[1] 27.56

$Topt$vcmax
[1] 27.56

$Topt$jmax
[1] 19.89

$Topt$tpu
[1] 27.56

$deltaS
$deltaS$rd
[1] 0

$deltaS$vcmax
[1] 0

$deltaS$jmax
[1] 0

$deltaS$tpu
[1] 0

$a_deltaS_t
$a_deltaS_t$rd
[1] 490

$a_deltaS_t$vcmax
[1] 668

$a_deltaS_t$jmax
[1] 660

$a_deltaS_t$tpu
[1] 485

$b_deltaS_t
$b_deltaS_t$rd
[1] 0

$b_deltaS_t$vcmax
[1] -1.07

$b_deltaS_t$jmax
[1] -0.75

$b_deltaS_t$tpu
[1] 0

$q10
$q10$rd
[1] 2

$q10$vcmax
[1] 2

$q10$jmax
[1] 2

$q10$tpu
[1] 2

$q10$Kc
[1] 2

$q10$Ko
[1] 2

$q10$tau
[1] 0.57

$a_q10_t
$a_q10_t$rd
[1] 3.22

$b_q10_t
$b_q10_t$rd
[1] -0.046

$tupp_cox
$tupp_cox$vcmax
[1] 36

$tupp_cox$rd
[1] 45

$tlow_cox
$tlow_cox$vcmax
[1] 0

$tlow_cox$rd
[1] 5

$exp_cox
$exp_cox$vcmax
[1] 0.3

$exp_cox$rd
[1] 0.4

$gstar_bf_a
[1] 0.012

$gstar_bf_b
[1] 1.68

$gstar_bf_c
[1] 42.7

$R
[1] 8.31446

> leaf_object$env
$ca_conc
[1] 300

$o2_conc
[1] 0.21

$par
[1] 1000

$water_l
[1] 0

$sphag_l
[1] 0

$temp
[1] 25

$vpd
[1] 1

$rh
[1] 0.6843213

$atm_press
[1] 101325

$wind
[1] 1

> leaf_object$.test(verbose=F, leaf.par=1000, leaf.ca_conc=1100 )
            oi             ca             cb             ci             cc      leaf_temp     leafN_area     fwdw_ratio              J            Acg 
     21.278250     111.457500     111.457500      87.541841      87.541841      25.000000       2.000000       5.000000     112.169861      38.545634 
           Ajg            Apg              A             rd            lim   A_ana_rbzero A_ana_rbg0zero        aguess1        aguess2        aguess3 
     26.104552      36.349221      24.085597       1.050000       3.000000       0.000000       0.000000       0.000000       0.000000       0.000000 
       aguess4       faguess1       faguess2       faguess3       faguess4    aguess_flag           iter      estimprec         assim1         assim2 
      0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000       0.000000 
 fA_ana_final1  fA_ana_final2          A_noR     transition           d13c          vcmax        vcmaxlt           jmax         jmaxlt            tpu 
      0.000000       0.000000       0.000000       0.000000       0.000000      70.000000      70.000000     120.441091     120.441091      11.666667 
         tpult             rd             Kc             Ko             Km          gstar            tau          gamma             rb             rs 
     11.666667       1.050000      40.490000      27.840000      71.436708       3.249404       0.000000       4.386756       0.000000       6.124750 
            ri          alpha       cica_chi 
      0.000000       0.385000       0.000000 
> leaf_object$.test(verbose=F, leaf.par=1000, leaf.ca_conc=1 )
            oi             ca             cb             ci             cc      leaf_temp     leafN_area     fwdw_ratio              J            Acg 
    21.2782500      0.1013250      0.1013250      4.1154459      4.1154459     25.0000000      2.0000000      5.0000000    112.1698607      3.8130112 
           Ajg            Apg              A             rd            lim   A_ana_rbzero A_ana_rbg0zero        aguess1        aguess2        aguess3 
    10.8728548    166.3206607     -0.2476018      1.0500000      3.0000000      0.0000000      0.0000000      0.0000000      0.0000000      0.0000000 
       aguess4       faguess1       faguess2       faguess3       faguess4    aguess_flag           iter      estimprec         assim1         assim2 
     0.0000000      0.0000000      0.0000000      0.0000000      0.0000000      0.0000000      0.0000000      0.0000000      0.0000000      0.0000000 
 fA_ana_final1  fA_ana_final2          A_noR     transition           d13c          vcmax        vcmaxlt           jmax         jmaxlt            tpu 
     0.0000000      0.0000000      0.0000000      0.0000000      0.0000000     70.0000000     70.0000000    120.4410914    120.4410914     11.6666667 
         tpult             rd             Kc             Ko             Km          gstar            tau          gamma             rb             rs 
    11.6666667      1.0500000     40.4900000     27.8400000     71.4367077      3.2494043      0.0000000      4.3867563      0.0000000    100.0000000 
            ri          alpha       cica_chi 
     0.0000000      0.3850000      0.0000000 
> source('leaf_object.R')
> leaf_object$.test_aci(leaf.ca_conc=seq(0.1,2000,50), verbose=F )
 Error in 1:.$dataf$lm : argument of length 0 
9.
vapply(1:.$dataf$lm, .$run_met1, .$dataf$mout) 
8.
t(vapply(1:.$dataf$lm, .$run_met1, .$dataf$mout)) at generic_model_functions.R#114
7.
res(x, ...) 
6.
FUN(X[[i]], ...) 
5.
lapply(1:length(.$dataf$met[, 1]), .$run_met) 
4.
do.call(rbind, lapply(1:length(.$dataf$met[, 1]), .$run_met)) 
3.
data.frame(do.call(rbind, lapply(1:length(.$dataf$met[, 1]), 
    .$run_met))) at leaf_object.R#545
2.
res(x, ...) 
1.
leaf_object$.test_aci(leaf.ca_conc = seq(0.1, 2000, 50), verbose = F) 

Failing at "leaf_object$.test_aci(leaf.ca_conc=seq(0.1,2000,50), verbose=F )"

walkeranthonyp commented 4 years ago

Is this on master? We've been bug-fixing that error and others, though I thought they were on a different branch. We're actively pursuing those bugfixes and it's gotten a bit messy. Might be worth holding off until the bugs are fixed and I have a chance to merge everything into master.

serbinsh commented 4 years ago

I believe this was on master but I will hold off for now until you have a chance to try and finish the bug squashing. Its not really impacting me at the moment, it was more that I was trying to get another user up to speed and notice the crash

walkeranthonyp commented 4 years ago

Sorry this is taking longer than expected. I'll deal with it asap.

walkeranthonyp commented 4 years ago

Hi @serbinsh apologies for the delay. I hope it didn't hold you up, and if my slow responses do in the future please feel free to hassle me.

This issue should be resolved with the latest commit on master. Please let me know if not, otherwise please mark as resolved. Thanks!