Opened 2 years ago

Last modified 15 months ago

#548 new defect

hardcoded year length not consistent with leap years

Reported by: ajornet Owned by: somebody
Priority: major Milestone: Not scheduled yet
Component: Model architecture Version: trunc
Keywords: leap year 365 days one_year Cc:

Description

All references in the code regarding the year length in days cannot be hardcoded -seen as 365-. They require the use of one_year variable to overcome the leap years when the gregorian calendar is used.

Those values can easily be found by:

[p529jorn@irene170 ORCHIDEE_TRUNK]$ grep 365 src*/*90
src_driver/dim2_driver.f90:  !Config         nM  : n month after the first time-step (year of 365 days)
src_driver/dim2_driver.f90:  !Config         nY  : n years after the first time-step (year of 365 days)
src_driver/dim2_driver.f90:  !Config         nM  : n month after the first time-step (year of 365 days)
src_driver/dim2_driver.f90:  !Config         nY  : n years after the first time-step (year of 365 days)
src_driver/readdim2.f90:          CALL ioconf_calendar("gregorian") !! = 365.2425 ; "noleap" = 365.0; "360d"; "julian"=365.25
src_driver/testrouting.f90:  INTEGER(i_std)                                      :: simlen                           !! Lenght of simulation: simlen = 365*48*nbyears
src_driver/testrouting.f90:  simlen = NINT(nbyears*365*one_day_loc/dtradia)
src_driver/weather.f90: & asat0 = 6.1078000,    asat1 = 4.4365185e-1, asat2 = 1.4289458e-2, &   !! lowe(1977),jam,16,101-103.
src_driver/weather.f90: & asat0 = 6.1078000,    asat1 = 4.4365185e-1, asat2 = 1.4289458e-2, &   !! polynomials for svp(t), d(svp)/dt over water and ice
src_driver/weather.f90: & asat0 = 6.1078000,    asat1 = 4.4365185e-1, asat2 = 1.4289458e-2, &
src_global/solar.f90:          step = one_year/365.2425
src_global/solar.f90:    orbit = 2.0*pi*jday/365.2425
src_parallel/xios_orchidee.f90:    REAL(r_std), INTENT(in)                               :: julian_diff      !! Current day in the year [1,365(366)]
src_sechiba/chemistry.f90:             So(ji) = Sct*( un + 0.033*COS(360.*pi/180.*julian_diff/365.))*coszang(ji)
src_sechiba/chemistry.f90:                ! 1/(365/12*24*60*60*4) for conversion from year to seconds corrected for 4 months of emissions
src_sechiba/chemistry.f90:                     & *1e12/(365*24*60*60*4/12)/(area2(ji)*veget_max(ji,jv))
src_sechiba/chemistry.f90:                     & *1e12/(365*24*60*60)/(area2(ji)*veget_max(ji,jv))
src_sechiba/diffuco.f90:!! DOI 10.1111/j.1365-2486.2008.01744.x
src_sechiba/slowproc.f90:                N_input(:,:,:,iammonium)=N_input(:,:,:,iammonium)/1000./365.
src_sechiba/slowproc.f90:                N_input(:,:,:,initrate)=N_input(:,:,:,initrate)/1000./365.
src_sechiba/slowproc.f90:                N_input(:,:,:,ifert) = N_input_temp(:,:,:)/365.
src_sechiba/slowproc.f90:                N_input(:,:,:,ifert) = N_input(:,:,:,ifert)+ N_input_temp(:,:,:)/365.
src_sechiba/slowproc.f90:                N_input(:,:,:,ifert) = N_input(:,:,:,ifert)+ N_input_temp(:,:,:)/365.
src_sechiba/slowproc.f90:                N_input(:,:,:,imanure) = N_input_temp(:,:,:)/1000./365.
src_sechiba/slowproc.f90:                N_input(:,:,:,imanure) = N_input(:,:,:,imanure)+N_input_temp(:,:,:)/365.
src_sechiba/slowproc.f90:                N_input(:,:,:,imanure) = N_input(:,:,:,imanure)+N_input_temp(:,:,:)/365.
src_sechiba/slowproc.f90:                N_input(:,:,:,ibnf) = N_input(:,:,:,ibnf)/1000./365.
src_sechiba/slowproc.f90:             N_input(:,:,:,iammonium)=N_input(:,:,:,iammonium)/1000/365
src_sechiba/slowproc.f90:             N_input(:,:,:,initrate)=N_input(:,:,:,initrate)/1000/365
src_sechiba/slowproc.f90:             N_input(:,:,:,ifert) = N_input_temp(:,:,:)/365.
src_sechiba/slowproc.f90:             N_input(:,:,:,ifert) = N_input(:,:,:,ifert)+ N_input_temp(:,:,:)/365.
src_sechiba/slowproc.f90:             N_input(:,:,:,ifert) = N_input(:,:,:,ifert)+ N_input_temp(:,:,:)/365.
src_sechiba/slowproc.f90:             N_input(:,:,:,imanure) = N_input_temp(:,:,:)/1000./365.
src_sechiba/slowproc.f90:             N_input(:,:,:,imanure) = N_input(:,:,:,imanure)+N_input_temp(:,:,:)/365.
src_sechiba/slowproc.f90:             N_input(:,:,:,imanure) = N_input(:,:,:,imanure)+N_input_temp(:,:,:)/365.
src_sechiba/slowproc.f90:             N_input(:,:,:,ibnf) = N_input(:,:,:,ibnf)/1000./365.
src_sechiba/slowproc.f90:!! databases and continuous pedotransfer functions, WRR, 36, 3653-3662
src_stomate/lpj_fire.f90:!! - Kuhlbusch et al. JGR 101, 23651-23665, 1996
src_stomate/lpj_fire.f90:       ! annual_fire_fraction = 1. - ( 1. - daily_fire_fraction )**365
src_stomate/lpj_fire.f90:       ! Thus, daily_fire_fraction = 1. - ( 1. - annual_fire_fraction )**(1/365)
src_stomate/stomate_data.f90:!! stand characteristics among diverse ecosystems. Ecological Monographs, Vol 62, pp 365-392.
src_stomate/stomate.f90:       !Config Def   = 365
src_stomate/stomate.f90:       nparan = 365
src_stomate/stomate.f90:             !    spinup_period*365 (we consider only the noleap calendar)
src_stomate/stomate.f90:             nbp_flux(:) = nbp_accu(:) / ( spinup_period * 365.)
src_stomate/stomate_io.f90:    IF (ALL(gdd_init_date(:,1) == val_exp)) gdd_init_date(:,1) = 365.

By replacing the hardcoded value with one_year variable should be enough.

PS: this does not apply to the calculation of a period of time. Further calculations are required when the calendar that takes into account leap years. The use of the average length year might not be enough neither.

Change History (2)

comment:2 Changed 15 months ago by luyssaert

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