Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#1237 closed Bug (duplicate)

bug in fldread when accessing monthly mean files

Reported by: jamesharle Owned by: nemo
Priority: low Milestone:
Component: OCE Version: release-3.4
Severity: Keywords: SBC
Cc:

Description

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
         !
         !                                   ! ================================ !

Commit History (0)

(No commits)

Change History (3)

comment:1 Changed 7 years ago by sallen@…

This is the same as ticket 1201.

comment:2 Changed 7 years ago by jamesharle

  • Resolution set to duplicate
  • Status changed from new to closed

Apologies. I missed that one. Marking as duplicate and closing.

James

comment:3 Changed 4 years ago by nicolasmartin

  • Keywords SBC added; fldread removed
Note: See TracTickets for help on using tickets.