Changes between Initial Version and Version 2 of Ticket #786
- Timestamp:
- 10/02/18 21:08:36 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #786
- Property Resolution → Fixed
- Property Status new → closed
- Property Summary reading forcing data with dt<1 sec → Reading forcing data with DT < 1 second
- Property Type bug → defect
-
Ticket #786 – Description
initial v2 1 I am using a netcdf forcing data file with a dt of 0.2 sec to drive a lab test case. But roms does not interpolate the data correctly because in set_ngfld (same for set_2dlfd and set_3dlfd) we have: 1 I am using a NetCDF forcing data file with a baroclinic '''DT''' of 0.2 sec to drive a lab test case. But ROMS does not interpolate the data correctly because in '''set_ngfld''' (same for '''set_2dlfd''' and '''set_3dlfd''') we have: 2 {{{ 2 3 fac1=ANINT(Tintrp(it2,ifield,ng)-time(ng),r8) 3 4 fac2=ANINT(time(ng)-Tintrp(it1,ifield,ng),r8) 4 but this truncates to a whole number. 5 }}} 6 which truncates the time interpolation weights to a whole number for the nearest second towards zero. 5 7 6 I got it to work by using 7 fac1=ANINT((Tintrp(it2,ifield,ng)-time(ng))*100.0_r8,r8)/100.0_r8 8 fac2=ANINT((time(ng)-Tintrp(it1,ifield,ng))*100.0_r8,r8)/100.0_r8 9 but this will not work for all time steps. 8 We got it to work for smaller than a second baroclinic timestep by using: 9 {{{ 10 fac1=ANINT((Tintrp(it2,ifield,ng)-time(ng))*SecScale,r8) 11 fac2=ANINT((time(ng)-Tintrp(it1,ifield,ng))*SecScale,r8) 12 }}} 13 where '''!SecScale=1000'''. That is, the time interpolation weights are rounded to the nearest millisecond instead. 10 14 11 This did not work: 15 The following statements at the full precision did not work: 16 {{{ 12 17 fac1=Tintrp(it2,ifield,ng)-time(ng) 13 18 fac2=time(ng)-Tintrp(it1,ifield,ng) 14 because there can be a small value of fac1 that is < 0 (roundoff) and then the interpolation is stopped by 19 }}} 20 21 because there can be a small value of '''fac1''' that is negative because of roundoff, and then the interpolation is stopped by 22 {{{ 15 23 ELSE IF (((fac1*fac2).ge.0.0_r8).and.(fac1+fac2).gt.0.0_r8) THEN 16 24 ... 25 }}} 17 26 18 So we need a way to use forcing data with a dt < 1 sec. 27 indicating unbounded interpolants. 19 28 20 thanks 21 john 29 ---- 22 30 31 == WARNING: == 23 32 33 Notice that we no longer will get identical solutions with previous versions due to very small differences in the time interpolated fields. It does not matter much because the differences are in the order of roundoff. However, users need to be aware of such fact. 24 34 25 35