Closed penguian closed 2 years ago
@vxh599@nci.org.au changed owner from bep599
to vxh599
@mgk576@nci.org.au commented
I don't think this logic works?
import calendar import sys import math
st_yr = 2002 en_yr = st_yr + 3
ktau = 1 kstart = 1 ktauday = 24 koffset = 0 for yr in range(st_yr, en_yr + 1):
if calendar.isleap(yr):
days_in_year = 366
else:
days_in_year = 365
for d in range(1, days_in_year + 1):
for h in range(1, ktauday + 1):
LOY = days_in_year
idoy_old = int( float(math.ceil(float((ktau+koffset)/ktauday))) % float(LOY))
idoy_new = int( float(math.ceil(float((ktau+koffset)/float(ktauday)))) % float(LOY))
print(yr,d, h, idoy_old,idoy_new,)
ktau += 1
@jxs599@nci.org.au set milestone to 6. Report
@jxs599@nci.org.au set keywords to leap year loy doy tiled
@jxs599@nci.org.au changed status from new
to closed
@jxs599@nci.org.au set resolution to duplicate
@jxs599@nci.org.au changed milestone from 6. Report
to 1. Closed
@jxs599@nci.org.au commented
The tiled sidle-site issues raised here seem to have been covered in work with Anna, Martin, Jhan. A cursory glance appears to show LOY is set correctly for leap years AND the DOY thing - so long as either numerator or denominator is REAL then so to will be the result be. Thus this added REAL()-isation seems to be semantical.
Close
@ccc561@nci.org.au changed keywords from leap year loy doy tiled
to leap year loy doy tiled nogit
keyword_leap_year_loy_doy_tiled_nogit
owner:vxh599@nci.org.au
resolution_duplicate
type_defect
| by vxh599Tiled simulations using single site forcing are intended to be enabled by setting patchfrac and iveg in the site met files. However this only works if the inputs are allocated to the appropriate patch dimension. Also there are a couple of bug fixes relating to doy and leap years.
These changes were implemented in https://trac.nci.org.au/svn/cable/branches/Share/NESP2pt9
in cable_parameters.f90 at ~ line 277:
elseif (nmetpatches .gt. npatch) then
Leap-year bug fix:
cable_driver line 564: IF (IS_LEAPYEAR(CurYear)) LOY = 366 should be: IF (IS_LEAPYEAR(MetYear)) LOY = 366
DOY bug fix: cable_driver line 693: idoy =INT( MOD(REAL(CEILING(REAL((ktau+koffset)/ktauday))),REAL(LOY))) should be: idoy =INT( MOD(REAL(CEILING((real(ktau+koffset))/real(ktauday))),REAL(LOY)))
Issue migrated from trac:211 at 2023-11-27 11:27:53 +1100