Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • airGR airGR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 60
    • Issues 60
    • List
    • Boards
    • Service Desk
    • Milestones
  • Redmine
    • Redmine
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • HYCAR-Hydro
  • airGRairGR
  • Issues
  • #141

Closed
Open
Created Dec 09, 2021 by Thirel Guillaume@guillaume.thirelOwner

Vignette about CemaNeige hysteresis to complete

As explained in Riboust et al. (2019)'s paper, the CemaNeige hysteresis must be used with a MeanAnSolidPrecip argument of CreateRunOptions set to different values for each elevation zone. As a consequence, we must add/modify a couple of things in the vignette showing how to use it, as well as in the example of RunModel_CemaNeigeGR4J.

In the vignette:

    SolidPrecip_Cal <- rep(0, 5)
    SolidPrecip_Val <- rep(0, 5)
    for(iLayer in 1:5){
      SolidPrecip_Cal[iLayer] <- mean(InputsModel$LayerFracSolidPrecip[[iLayer]][Ind_Cal]*InputsModel$LayerPrecip[[iLayer]][Ind_Cal]);
      SolidPrecip_Val[iLayer] <- mean(InputsModel$LayerFracSolidPrecip[[iLayer]][Ind_Val]*InputsModel$LayerPrecip[[iLayer]][Ind_Val]);
    }
    if(inherits(InputsModel,"hourly" )){ Factor <- 365.25*24; }
    if(inherits(InputsModel,"daily"  )){ Factor <-    365.25; }
    if(inherits(InputsModel,"monthly")){ Factor <-        12; }
    if(inherits(InputsModel,"yearly" )){ Factor <-         1; }
    SolidPrecip_Cal <- SolidPrecip_Cal*Factor
    SolidPrecip_Val <- SolidPrecip_Val*Factor

    ## preparation of RunOptions object
    RunOptions_Cal <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR4J,
                                   InputsModel = InputsModel, IndPeriod_Run = Ind_Cal, IsHyst = TRUE,
                                   MeanAnSolidPrecip = SolidPrecip_Cal)

    ## preparation of RunOptions object
    RunOptions_Val <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR4J,
                                   InputsModel = InputsModel, IndPeriod_Run = Ind_Val, IsHyst = TRUE,
                                   MeanAnSolidPrecip = SolidPrecip_Val)

In the example:

    SolidPrecip <- rep(0, 5)
    for(iLayer in 1:5){
      SolidPrecip[iLayer] <- mean(InputsModel$LayerFracSolidPrecip[[iLayer]][Ind_Run]*InputsModel$LayerPrecip[[iLayer]][Ind_Run]);
    }
    if(inherits(InputsModel,"hourly" )){ Factor <- 365.25*24; }
    if(inherits(InputsModel,"daily"  )){ Factor <-    365.25; }
    if(inherits(InputsModel,"monthly")){ Factor <-        12; }
    if(inherits(InputsModel,"yearly" )){ Factor <-         1; }
    SolidPrecip <- SolidPrecip*Factor

## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR4J, InputsModel = InputsModel,
                               IndPeriod_Run = Ind_Run, IsHyst = TRUE, MeanAnSolidPrecip = SolidPrecip)

@olivier.delaigue, please make it R beautiful. :D

I'm doing some tests and confirm tomorrow.

Thanks @francois.bourgin for spotting that.

Edited Feb 21, 2022 by Delaigue Olivier
Assignee
Assign to
Time tracking