Opened 12 years ago

Closed 12 years ago

Last modified 3 years ago

#324 closed Bug (fixed)

bug in fldread when reading the last record of previous year file with monthly non-climatological file

Reported by: spolod Owned by: nemo
Priority: low Milestone:
Component: OCE Version: release-3.0
Severity: Keywords: release-3.0 surface
Cc:

Description

Hi

When using monthly non-climatological files (frequency = -1 and clim == false in namelist) , if we need to read the last record of previous year in another file, there is a bug: we read the last record of the current year file instead of the previous one.

In fldread.F90 (SUBROUTINE fld_init)

Add

	       llprevyr = .NOT. sdjf%ln_clim

After line 331

329	         IF( sdjf%rec_b(1) == 0.e0 ) THEN   ! we redefine record sdjf%rec_b(1) with the last record of previous year file
330	            IF( sdjf%freqh == -1. ) THEN    ! monthly mean
331	               sdjf%rec_b(1) = 12.          ! force to read december mean

	               llprevyr = .NOT. sdjf%ln_clim

332	            ELSE   
333	               IF( sdjf%cltype == 'monthly' ) THEN   ! monthly file
334	                  sdjf%rec_b(1) = 24. / sdjf%freqh * REAL( nmonth_len(nmonth-1), wp )   ! last record of previous month
335	                  llprevmth = .NOT. sdjf%ln_clim                                        ! use previous month file?
336	                  llprevyr  = .NOT. sdjf%ln_clim .AND. nmonth == 1                      ! use previous year  file?
337	               ELSE                                  ! yearly file
338	                  sdjf%rec_b(1) = 24. / sdjf%freqh * REAL( nyear_len(0), wp )           ! last record of year month
339	                  llprevyr  = .NOT. sdjf%ln_clim                                        ! use previous year  file?
340	               ENDIF
341	            ENDIF
342	         ENDIF

Stephane

Commit History (0)

(No commits)

Change History (10)

comment:1 Changed 12 years ago by ctlod

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

comment:2 Changed 12 years ago by ctlod

  • Milestone set to New Surface Module

comment:3 Changed 4 years ago by nicolasmartin

  • Keywords New Surface module added

comment:4 Changed 4 years ago by nicolasmartin

  • Keywords new added; New removed

comment:5 Changed 4 years ago by nicolasmartin

  • Keywords surface added; Surface removed

comment:6 Changed 4 years ago by nicolasmartin

  • Keywords nemo_v3* added

comment:7 Changed 4 years ago by nicolasmartin

  • Milestone New Surface Module deleted

Milestone New Surface Module deleted

comment:8 Changed 4 years ago by nicolasmartin

  • Keywords module removed

comment:9 Changed 4 years ago by nicolasmartin

  • Keywords new removed

comment:10 Changed 3 years ago by nemo

  • Keywords release-3.0 added; nemo_v3* removed
Note: See TracTickets for help on using tickets.