hollorol / RBBGCMuso

RBBGCMuso is a software package that supports the application of the Biome-BGCMuSo biogeochemical model.
GNU General Public License v2.0
20 stars 11 forks source link

error with compareMuso #12

Closed rhg321 closed 3 years ago

rhg321 commented 3 years ago

setupMuso(calibrationPar =c(26,50),epcInput="dbf.epc") compareMuso( settings = NULL, parameters=45, variable = 3009, calibrationPar = 26, fileToChange = "epc", skipSpinup = TRUE, timeFrame = "day" )

error: Error in calibMuso(postProcString = postProcString, settings, calibrationPar = calibrationPar, : Modell Failure

hollorol commented 3 years ago

Hi, Thanks for writing the issue! If you set the settings to NULL, the package assumes the following:

  1. you must be in the directory where you run the model.
  2. spinup file and normal file must end to s.ini and n.ini.
  3. The model name is muso.exe (in Windows) or muso(in Linux)

These are the default settings. You can modify it if you provide the settings variable (get from the setupMuso function).

Can you show me the output of the setupMuso function?

rhg321 commented 3 years ago

thanks for your reply. This is running in the Windows environment, Here are some of my settings:

setupMuso(calibrationPar =c(26,50),epcInput="dbf.epc") $executable [1] "E:\language\R_yuyan\muso_run\muso_cbs_dbf_tp\/muso.exe"

$calibrationPar [1] 26 50

$outputLoc [1] "E:\language\R_yuyan\muso_run\muso_cbs_dbf_tp\/."

$outputNames [1] "cbs_dbf_Spinup" "cbs_dbf_def"

$inputLoc [1] "E:\language\R_yuyan\muso_run\muso_cbs_dbf_tp\"

$iniInput [1] "E:\language\R_yuyan\muso_run\muso_cbs_dbf_tp\/s.ini" [2] "E:\language\R_yuyan\muso_run\muso_cbs_dbf_tp\/n.ini"

$metInput spinup normal "cbs.mtc43" "cbs.mtc43"

$epcInput spinup normal "dbf_spinup.epc" "dbf.epc"

$inputFiles [1] "E:\language\R_yuyan\muso_run\muso_cbs_dbf_tp\/s.ini" [2] "E:\language\R_yuyan\muso_run\muso_cbs_dbf_tp\/n.ini" [3] "dbf.epc"

$numData [1] 5840 192 16

$startYear [1] 2003

$numYears [1] 8

$outputVars $outputVars[[1]] [1] "proj_lai" "daily_gpp"

$outputVars[[2]] [1] "annprcp" "cum_gpp"

$soilFile spinup normal "cbs.soi" "cbs.soi"

$dailyVarCodes [1] "2520" "3009"

$annualVarCodes [1] "3000" "3025"

$dailyOutputTable index code name 1 1 2520 proj_lai 2 2 3009 daily_gpp

$annualOutputTable index code name 1 1 3000 annprcp 2 2 3025 cum_gpp

$normOutputFlags daily annual 1 1

rhg321 commented 3 years ago

In addition, First of all, "runMuso" is directly called for simulation, which can run smoothly. The code is as follows:

library(RBBGCMuso) setwd("E:/language/R_yuyan/muso_run/muso_cbs_dbf") runMuso(skipSpinup = False)

Then, I modify the "calibrationPar" parameter of "setupMuso" to the index row number vector of the parameter to be modified, and set the specific parameter value vector with the "parameters" parameter of "calibMuso" accordingly. This also works well, code is as below:

setupMuso(calibrationPar =c(26,50),epcInput="dbf.epc") calibMuso(parameters=c(80,0.5),skipSpinup = TRUE)

However, the results before and after modifying the parameters are the same without any change. What is the reason?

hollorol commented 3 years ago

Sorry for the late reply.

setupMuso(calibrationPar =c(26,50),epcInput="dbf.epc") calibMuso(parameters=c(80,0.5),skipSpinup = TRUE) However, the results before and after modifying the parameters are the same without any change. > What is the reason?

calibMuso function has a parameter called settings. At default it is equal to setupMuso(), so if you do not provide a settings parameter It does not do anything, just call the setupmMuso() function. However, this will work:

settings <- setupMuso(calibrationPar =c(26,50),epcInput="dbf.epc")
calibMuso(settings=settings, parameters=c(80,0.5), skipSpinup = TRUE)
rhg321 commented 3 years ago

The problem has been successfully solved. Thank you for your reply. May I ask when the detailed description of the GLUE based optimization method will be published ?

hollorol commented 3 years ago

We are working on the GLUE details, It will be published on next week.