CABLE-LSM / CABLE-Trac-archive

Archive CABLE Trac contents as issues
Other
0 stars 0 forks source link

changes relating to site level simulations, including tiling #211

Closed penguian closed 2 years ago

penguian commented 5 years ago

keyword_leap_year_loy_doy_tiled_nogit owner:vxh599@nci.org.au resolution_duplicate type_defect | by vxh599


Tiled 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

     ALLOCATE( inLon(nlon), inLat(nlat) )
     ALLOCATE( inVeg(nlon, nlat, nmetpatches) )
     ALLOCATE( inPFrac(nlon, nlat, nmetpatches) )
     ALLOCATE( inSoil(nlon, nlat) )
     ALLOCATE( idummy(nlon, nlat, npatch) )
     ALLOCATE( rdummy(nlon, nlat, npatch) )
     ALLOCATE(  inWB(nlon, nlat, nslayer,ntime) )
     ALLOCATE( inTGG(nlon, nlat, nslayer,ntime) )
     ALLOCATE( inALB(nlon, nlat, nmetpatches,nband) )
     ALLOCATE( inSND(nlon, nlat, nmetpatches,ntime) )
     ALLOCATE( inLAI(nlon, nlat, ntime) )
     ALLOCATE( r3dum(nlon, nlat, nband) )
     ALLOCATE( r3dum2(nlon, nlat, ntime) )

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

penguian commented 5 years ago

@vxh599@nci.org.au changed owner from bep599 to vxh599

penguian commented 5 years ago

@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
penguian commented 4 years ago

@jxs599@nci.org.au set milestone to 6. Report

penguian commented 2 years ago

@jxs599@nci.org.au set keywords to leap year loy doy tiled

penguian commented 2 years ago

@jxs599@nci.org.au changed status from new to closed

penguian commented 2 years ago

@jxs599@nci.org.au set resolution to duplicate

penguian commented 2 years ago

@jxs599@nci.org.au changed milestone from 6. Report to 1. Closed

penguian commented 2 years ago

@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

penguian commented 1 year ago

@ccc561@nci.org.au changed keywords from leap year loy doy tiled to leap year loy doy tiled nogit