id summary reporter owner description type status priority milestone component version severity resolution keywords cc 1237 bug in fldread when accessing monthly mean files jamesharle nemo " The following issue arose when using boundary data that happen to be stored as monthly files with freq = -1 and time interp = .true. When the bdy code calls fldread to update boundary conditions then the record indices and time (sdjf%nrec_a) for the input field related variables are updated in the following code (ln 519:553 fldread.F90). The issues arise when itime_add != 0. ztmp is initial set as a fraction of a month. It is then modified by adding itime_add*rdttra(1) (in the case of PRESENT(jit)=.false.). In my simulation rdttra is 360s. Consequently sdjf%nrec_a(2) is set some 360 months further on from the current time step rendering the time interpolation meaningless. {{{ ELSEIF( sdjf%nfreqh == -1 ) THEN ! monthly mean ! ! ! ============ ! ! IF( sdjf%ln_tint ) THEN ! time interpolation, shift by 1/2 record ! ! INT( ztmp ) ! /|\ ! 1 | *---- ! 0 |----( ! |----+----|--> time ! 0 /|\ 1 (nday/nmonth_len(nmonth)) ! | ! | ! forcing record : nmonth ! ztmp = REAL( nday, wp ) / REAL( nmonth_len(nmonth), wp ) + 0.5 IF( PRESENT(jit) ) THEN ztmp = ztmp + (jit+itime_add)*rdt/REAL(nn_baro,wp) ELSE ztmp = ztmp + itime_add*rdttra(1) ENDIF imth = nmonth + INT( ztmp ) - COUNT((/llbefore/)) IF( sdjf%cltype == 'monthly' ) THEN ; sdjf%nrec_a(1) = 1 + INT( ztmp ) - COUNT((/llbefore/)) ELSE ; sdjf%nrec_a(1) = imth ENDIF sdjf%nrec_a(2) = nmonth_half( imth ) + nsec1jan000 ! swap at the middle of the month ELSE ! no time interpolation IF( sdjf%cltype == 'monthly' ) THEN ; sdjf%nrec_a(1) = 1 ELSE ; sdjf%nrec_a(1) = nmonth ENDIF sdjf%nrec_a(2) = nmonth_end(nmonth ) + nsec1jan000 ! swap at the end of the month sdjf%nrec_b(2) = nmonth_end(nmonth-1) + nsec1jan000 ! beginning of the month (only for print) ENDIF ! ! ! ================================ ! }}} " Bug closed low OCE v3.4 duplicate SBC