Opened 2 years ago

Last modified 15 months ago

# one_year variable unclear definition

Reported by: Owned by: ajornet somebody major Not scheduled yet Model architecture trunc gregorian leap one_year

### Description

The variable one_year found in time.f90 is defined as:

```  REAL(r_std), PUBLIC                 :: one_year           !! Length of current year in days (d)
```

But regarding its given value on Orchidee in a Gregorian calendar(1988 is a leap year):

``` time_nextstep: Start of interval         1988-01-01       0.0000
time_nextstep: End of interval           1988-01-01    1800.0000
time_nextstep: month_len=          31  one_year=   365.242500000000
```

365.2425 is the average year length in the Gregorian calendar. But it's not the length in days of the current year.

In order to find out which one is the right choice. It might be a good idea to take a look to the source code:

• Example 1)

In readdim2.f90:

```!-
!- Number of time steps is meaningless in this case
!-
!    ttm_full = HUGE( ttm_full )
!MM Number (realistic) of time steps for half hour dt
ttm_full = NINT(one_year * 86400. / dt_force)
```

For the year 1988 (leap):

```ttm_full = NINT(365.2425 * 86400. / 3600.0) = INT(8765.82) = 8765 -> wrong (currently)
ttm_full = NINT(366.0000 * 86400. / 3600.0) = INT(8764.00) = 8784 -> correct
```

Regarding the 1988 era5 forcing file:

```[p529jorn@irene170 SpinUpMICT-era5v2ORC-1.3615]\$ ncdump -h era5_europe_1988.nc
netcdf era5_europe_1988 {
dimensions:
time = UNLIMITED ; // (8784 currently)
lat = 173 ;
lon = 305 ;
variables:
double time(time) ;
time:axis = "T" ;
time:calendar = "standard" ;
time:long_name = "Time axis" ;
time:standard_name = "time" ;
time:units = "seconds since 1988-01-01 00:00:00" ;
time:tstep_sec = 3600.f ;
time:time_origin = "1988-01-01 00:00:00" ;

```
• Example 2)

In stomate.f90, variable nsft, It's defined as:

```INTEGER(i_std),SAVE                                :: nsft                !! Number of time steps in a year (unitless)
```

and calculated:

```! Total number of forcing steps
nsft = INT(one_year/(dt_stomate/one_day))
```

For the year 1988 (leap=366):

```nsft = INT(365.2425/(86400/86400)) = 365 -> wrong (currently)
nsft = INT(366.0000/(86400/86400)) = 366 -> correct
```
• Example 3)

In stomate_season.f90, regarding the calculation of ncd_max:

```    !! 1. Initializations
!! 1.1 Calculate ::ncd_max - the maximum possible NCD (number of chilling days) as:
!!     \latexonly
!!     \input{season_ncdmax_eqn2.tex}
!!     \endlatexonly
!!     \n
!!     where one_year is 1 year in seconds (defined in ::constantes).
!
ncd_max = ncd_max_year * one_year
```

one_year is wrongly used as it is defined in years (instead of seconds, check the comments). It also matters whether it is a leap year. one_year name seems to be a bit confusing.

• Example 4)

In lpj_stablish.f90:

```bm_eff(:,icarbon) = MIN( npp_longterm(:,j)/one_year, bm_new(:,icarbon)-bm_non(:,icarbon) )
```

But it is not clear whether the average year length (365.2425) should be used intead of the current year length (365 or 366)

```REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)            :: npp_longterm         !! "Long term" mean yearly primary productivity
```
• Conclusion

It some cases seems to be wrong (1,2,3) but in others (4) I can't decide whether it's good or there is an issue.

### comment:1 Changed 15 months ago by luyssaert

• Milestone changed from ORCHIDEE 4.0 to Not scheduled yet
Note: See TracTickets for help on using tickets.