Changeset 4784


Ignore:
Timestamp:
2014-09-24T10:44:53+02:00 (6 years ago)
Author:
jamesharle
Message:

Correction to monthly and yearly interpolation in fld_rec subroutine (see ticket #1372 for details)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90

    r4663 r4784  
    473473            !       forcing record :    1  
    474474            !                             
    475             ztmp = REAL( nday, wp ) / REAL( nyear_len(1), wp ) + 0.5 + REAL( it_offset, wp ) 
     475            ztmp = REAL( nsec_year, wp ) / ( REAL( nyear_len(1), wp ) * rday ) + 0.5 & 
     476           &       + REAL( it_offset, wp ) / ( REAL( nyear_len(1), wp ) * rday ) 
    476477            sdjf%nrec_a(1) = 1 + INT( ztmp ) - COUNT((/llbefore/)) 
    477478            ! swap at the middle of the year 
    478             IF( llbefore ) THEN   ;   sdjf%nrec_a(2) = nsec1jan000 - NINT(0.5 * rday) * nyear_len(0) 
    479             ELSE                  ;   sdjf%nrec_a(2) = nsec1jan000 + NINT(0.5 * rday) * nyear_len(1)    
     479            IF( llbefore ) THEN   ;   sdjf%nrec_a(2) = nsec1jan000 - (1 - INT(ztmp)) * NINT(0.5 * rday) * nyear_len(0) + & 
     480                                    & INT(ztmp) * NINT( 0.5 * rday) * nyear_len(1)  
     481            ELSE                  ;   sdjf%nrec_a(2) = nsec1jan000 + (1 - INT(ztmp)) * NINT(0.5 * rday) * nyear_len(1) + & 
     482                                    & INT(ztmp) * INT(rday) * nyear_len(1) + INT(ztmp) * NINT( 0.5 * rday) * nyear_len(2)  
    480483            ENDIF 
    481484         ELSE                                    ! no time interpolation 
     
    501504            !       forcing record :  nmonth  
    502505            !                             
    503             ztmp = REAL( nday, wp ) / REAL( nmonth_len(nmonth), wp ) + 0.5 + REAL( it_offset, wp ) 
     506            ztmp = REAL( nsec_month, wp ) / ( REAL( nmonth_len(nmonth), wp ) * rday ) + 0.5 & 
     507           &       + REAL( it_offset, wp ) / ( REAL( nmonth_len(nmonth), wp ) * rday ) 
    504508            imth = nmonth + INT( ztmp ) - COUNT((/llbefore/)) 
    505509            IF( sdjf%cltype == 'monthly' ) THEN   ;   sdjf%nrec_a(1) = 1 + INT( ztmp ) - COUNT((/llbefore/)) 
Note: See TracChangeset for help on using the changeset viewer.