Opened 8 years ago

Closed 6 years ago

#98 closed enhancement (fixed)

User-defined model time-step instead of 'split_dt'

Reported by: nvuilsce Owned by: nvuilsce
Priority: minor Milestone: ORCHIDEE 1.9.7
Component: Driver files Version: orchidee_1_9_6
Keywords: split_dt Cc:

Description

I'm a bit annoyed with the use of the 'split_dt' parameter.
split_dt is the number of steps within a forcing time step (dt_force) that you define to get the model (sechiba) time-step (dt). So, dt equals dt_force/split_dt

The default value for split_dt is 12, assuming probably a 6-hour forcing file in order to get a dt value of 30 minutes.

The problem for me is that depending of the time resolution of the forcing, split_dt value should change to get a dt of 30 minutes.

Instead of setting the split_dt value, I would prefer to define a parameter for the model time-step (dt), with a default value of 30 minutes and to infer split_dt from dt_force/dt.

In order to let the possibility to the user to still work with the split_dt parameter, I suggest the following the part of code in dim2driver :

  IF ( .NOT. weathergen ) THEN
     !Config Key   = SPLIT_DT
     !Config Desc  = splits the timestep imposed by the forcing
     !Config If    = NOT(WEATHERGEN)
     !Config Def   = 12
     !Config Help  = With this value the time step of the forcing
     !Config         will be devided. In principle this can be run
     !Config         in explicit mode but it is strongly suggested
     !Config         to use the implicit method so that the
     !Config         atmospheric forcing has a smooth evolution.
     !Config Units = [-]
!-
     split = 12
     CALL getin_p('SPLIT_DT', split)
  ELSE
     split = 1
  ENDIF
!-
! The time step which is going to be used is computed
! from the forcing time step and the user input.
!-
  IF (split > 0) THEN
     dt = dt_force/split
  ELSE
     split = 1
     dt = dt_force
  ENDIF

by

  IF ( .NOT. weathergen ) THEN
     !Config Key   = DT
     !Config Desc  = Calculation Time-step of the SECHIBA component
     !Config If    = NOT(WEATHERGEN)
     !Config Def   = 1800.
     !Config Help  = Determines the time resolution at which
     !Config         the calculations in the SECHIBA component
     !Config         are done
     !Config Units = [seconds]
     dt = 1800
     CALL getin_p('DT', dt)
     split = INT(dt_force/dt)
     IF (dt .NE. dt_force/split) THEN
        WRITE (numout,*) "Sechiba time-step will be modified from ",dt,&
       &" to ",dt_force/split," for being a diviser of dt_force"  
     ENDIF
     !Config Key   = SPLIT_DT
     !Config Desc  = splits the timestep imposed by the forcing
     !Config If    = NOT(WEATHERGEN)
     !Config Def   = 12
     !Config Help  = With this value the time step of the forcing
     !Config         will be devided. In principle this can be run
     !Config         in explicit mode but it is strongly suggested
     !Config         to use the implicit method so that the
     !Config         atmospheric forcing has a smooth evolution.
     !Config Units = [-]
!-
     CALL getin_p('SPLIT_DT', split)
     CALL ipslerr_p ( 3, 'dim2_driver','split_dt', &
          &         ' is lower than 1 !','stop driver')     
  ELSE
     split = 1
  ENDIF
!-
! The time step which is going to be used is computed
! from the forcing time step and the split value.
!-
  dt = dt_force/split

Change History (9)

comment:1 Changed 8 years ago by nvuilsce

We decided to:

  • Rename the parameter name DT in TIME_STEP_SECHIBA
  • To avoid the use of the former parameter SPLIT_DT

Consequently, the section of code should look like:

  IF ( .NOT. weathergen ) THEN
     split = zero
     CALL getin_p('SPLIT_DT', split)
     IF ( split .NE. zero ) THEN
        CALL ipslerr_p ( 3, 'dim2_driver','split_dt parameter should &
       & not be used anymore', 'Please, use TIME_STEP_SECHIBA parameter & 
       & instead','stop driver')     
     ENDIF

     !Config Key   = TIME_STEP_SECHIBA
     !Config Desc  = Calculation Time-step of the SECHIBA component
     !Config If    = NOT(WEATHERGEN)
     !Config Def   = 1800.
     !Config Help  = Determines the time resolution at which
     !Config         the calculations in the SECHIBA component
     !Config         are done
     !Config Units = [seconds]
     dt = 1800
     CALL getin_p('TIME_STEP_SECHIBA', dt)
     split = INT(dt_force/dt)
     IF (dt .NE. dt_force/split) THEN
        WRITE (numout,*) "Sechiba time-step will be modified from ",dt,&
       &" to ",dt_force/split," for being a diviser of dt_force"  
     ENDIF

     IF ( split .LT. 1. ) THEN
        CALL ipslerr_p ( 3, 'dim2_driver','split is lower than 1', &
             &         ' Please, modify TIME_STEP_SECHIBA parameter &
             &         value !','stop driver')     
     ENDIF
  ELSE
     split = 1
  ENDIF
!-
! The time step which is going to be used is computed
! from the forcing time step and the split value.
!-
  dt = dt_force/split

comment:2 Changed 8 years ago by jgipsl

  • I would prefere DT_SECHIBA or DT_FAST instead of TIME_STEP_SECHIBA. We already have several parameters named DT_ so it doesn't make sense to call this parmeter for TIME_STEP_xxx.
  • Move dt=dt_force/split from the last ligne to the IF(dt/=dt_force/split) to make it easier to read. This gives the following :
     ...
     ...
     CALL getin_p('DT_FAST', dt)
     split = INT(dt_force/dt)
     IF (dt .NE. dt_force/split) THEN
        WRITE (numout,*) "Sechiba time-step will be modified from ",dt,&
        " to ",dt_force/split," for being a diviser of dt_force" 
        dt = dt_force/split
     ENDIF

     IF ( split .LT. 1. ) THEN
        CALL ipslerr_p ( 3, 'dim2_driver','split is lower than 1', &
             &         ' Please, modify TIME_STEP_SECHIBA parameter &
             &         value !','stop driver')     
     ENDIF
  ELSE
     split = 1
  ENDIF

comment:3 Changed 8 years ago by jgipsl

Sorry I was wrong, we need to keep dt=dt_force/split in ELSE, so it makes (with DT_SECHIBA or DT_FAST) :

 IF ( .NOT. weathergen ) THEN
     split = zero
     CALL getin_p('SPLIT_DT', split)
     IF ( split .NE. zero ) THEN
        CALL ipslerr_p ( 3, 'dim2_driver','split_dt parameter should &
       & not be used anymore', 'Please, use TIME_STEP_SECHIBA parameter & 
       & instead','stop driver')     
     ENDIF

     !Config Key   = DT_SECHIBA
     !Config Desc  = Time-step of the SECHIBA component
     !Config If    = NOT(WEATHERGEN)
     !Config Def   = 1800.
     !Config Help  = Determines the time resolution at which
     !Config         the calculations in the SECHIBA component
     !Config         are done
     !Config Units = [seconds]
     dt = 1800
     CALL getin_p('DT_SECHIBA', dt)
     split = INT(dt_force/dt)
     IF (dt .NE. dt_force/split) THEN
        WRITE (numout,*) "Sechiba time-step will be modified from ",dt,&
        " to ",dt_force/split," for being a diviser of dt_force"  
        dt=dt_force/split
     ENDIF

     IF ( split .LT. 1. ) THEN
        CALL ipslerr_p ( 3, 'dim2_driver','split is lower than 1', &
             &         ' Please, modify TIME_STEP_SECHIBA parameter &
             &         value !','stop driver')     
     ENDIF
  ELSE
     ! The time step which is going to be used is computed
     ! from the forcing time step and the split value.
     split=1
     dt=dt_force/split
  ENDIF

comment:4 follow-up: Changed 8 years ago by nvuilsce

On Tuesday, we agree on TIME_STEP_SECHIBA, so I would prefer to keep this parameter name.
For the instruction "dt = dt_force/split", I'm usually in favor of simplifying the code and to avoid duplication of the same instruction. In other words, if in both IF and ELSE statement sections, you have the same instruction, let's put the instruction after the ENDIF statement.

comment:5 follow-up: Changed 8 years ago by nvuilsce

The call to the getin function for the split_dt parameter is done for stopping the run in case this parameter is still present in the run.def.
But this call will induce the presence of this parameter in the used_run.def that is created during the simulation. So, we will produce an used_run.def that can not be used as an input parameter file.
Consequently, I suggest to remove the following lines

     CALL getin_p('SPLIT_DT', split)
     IF ( split .NE. zero ) THEN
        CALL ipslerr_p ( 3, 'dim2_driver','split_dt parameter should &
       & not be used anymore', 'Please, use TIME_STEP_SECHIBA parameter & 
       & instead','stop driver')     
     ENDIF

In any cas, if the TIME_STEP_SECHIBA parameter is not present in the run.def, the 'split' value will be 0 (initialization value), and one will stop the simulation anyway because of the instructions :

     IF ( split .LT. 1. ) THEN
        CALL ipslerr_p ( 3, 'dim2_driver','split is lower than 1', &
             &         ' Please, modify TIME_STEP_SECHIBA parameter &
             &         value !','stop driver')     
     ENDIF

The returning message can be change as followed:
Please, fill or modify TIME_STEP_SECHIBA parameter value in the run.def

comment:6 in reply to: ↑ 5 Changed 8 years ago by nvuilsce

Replying to nvuilsce:

This is wrong:

"In any cas, if the TIME_STEP_SECHIBA parameter is not present in the run.def, the >'split' value will be 0 (initialization value), and one will stop the simulation anyway".

comment:7 in reply to: ↑ 4 Changed 8 years ago by jgipsl

Replying to nvuilsce:

On Tuesday, we agree on TIME_STEP_SECHIBA, so I would prefer to keep this parameter name.

This decision was taken without looking into the code. After thinking and looking into the code, I do not agree. In run.def we already have following parmaters containing DT for time-step : DT_SLOW, DT_WATCHOUT, DT_WEATHGEN, DT_TURNOVER_TIME, STOMATE_HIST_DT, STOMATE_IPCC_HIST_DT. Therefore it do not make sense to add a new variable named TIME_STEP_xxx. It is important to think about consistency of the code to make it understandable for the users (and developers). Also, as the variables DT_SLOW exist, it would be preferalble that the new variables is named DT_FAST.

For the instruction "dt = dt_force/split", I'm usually in favor of simplifying the code and to avoid duplication of the same instruction. In other words, if in both IF and ELSE statement sections, you have the same instruction, let's put the instruction after the ENDIF statement.

In a general case where the instruction is the same, I agree with you. But in this case it is different. In the first case, dt is not calculated, it is read from run.def. Then split is calculated to have following true dt=dt_force/split. Only if dt is not coherent with the forcing file, it will be readjusted using dt=dt_force/split. The result for dt is the same but the consept is different.

Some more lines often simplifies a lot for the understanding.

comment:8 Changed 8 years ago by jgipsl

Due to meeting 30/04/2013, the variable name was choosen to be DT_SECHIBA.

We also noticed that the variable ROUTING_TIMESTEP is not following the same structure. This variable will be renamed to DT_ROUTING.

DT_TURNOVER_TIME is also read from run.def but never used. I suggest to remove this parameter at the same time.

comment:9 Changed 6 years ago by jgipsl

  • Resolution set to fixed
  • Status changed from new to closed

Done in the trunk rev [2575]

Note: See TracTickets for help on using tickets.