Changes between Initial Version and Version 2 of Ticket #786


Ignore:
Timestamp:
10/02/18 21:08:36 (7 years ago)
Author:
arango
Comment:

Agree about division precision. I added the SecScale variable and set it to 1000, so the rounding is in the order of milliseconds. Notice that we need to divide by this scale when reporting interpolation fails because of unbounded time snapshots.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #786

    • Property ResolutionFixed
    • Property Status newclosed
    • Property Summary reading forcing data with dt<1 secReading forcing data with DT < 1 second
    • Property Type bugdefect
  • 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:
     1I 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 {{{
    23      fac1=ANINT(Tintrp(it2,ifield,ng)-time(ng),r8)
    34      fac2=ANINT(time(ng)-Tintrp(it1,ifield,ng),r8)
    4 but this truncates to a whole number.
     5}}}
     6which truncates the time interpolation weights to a whole number for the nearest second towards zero.
    57
    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.
     8We 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}}}
     13where '''!SecScale=1000'''. That is, the time interpolation weights are rounded to the nearest millisecond instead.
    1014
    11 This did not work:
     15The following statements at the full precision did not work:
     16 {{{
    1217      fac1=Tintrp(it2,ifield,ng)-time(ng)
    1318      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
     21because there can be a small value of '''fac1''' that is negative because of roundoff, and then the interpolation is stopped by
     22 {{{
    1523      ELSE IF (((fac1*fac2).ge.0.0_r8).and.(fac1+fac2).gt.0.0_r8) THEN
    1624...
     25}}}
    1726
    18 So we need a way to use forcing data with a dt <  1 sec.
     27indicating unbounded interpolants.
    1928
    20 thanks
    21 john
     29----
    2230
     31== WARNING: ==
    2332
     33Notice 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.
    2434
    2535