New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#324 (bug in fldread when reading the last record of previous year file with monthly non-climatological file) – NEMO

Opened 15 years ago

Closed 15 years ago

Last modified 2 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: v3.0
Severity: Keywords: OPA surface v3.0
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 (12)

comment:1 Changed 15 years ago by ctlod

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

comment:2 Changed 15 years ago by ctlod

  • Milestone set to New Surface Module

comment:3 Changed 8 years ago by nicolasmartin

  • Keywords New Surface module added

comment:4 Changed 8 years ago by nicolasmartin

  • Keywords new added; New removed

comment:5 Changed 8 years ago by nicolasmartin

  • Keywords surface added; Surface removed

comment:6 Changed 8 years ago by nicolasmartin

  • Keywords nemo_v3* added

comment:7 Changed 8 years ago by nicolasmartin

  • Milestone New Surface Module deleted

Milestone New Surface Module deleted

comment:8 Changed 8 years ago by nicolasmartin

  • Keywords module removed

comment:9 Changed 8 years ago by nicolasmartin

  • Keywords new removed

comment:10 Changed 6 years ago by nemo

  • Keywords release-3.0 added; nemo_v3* removed

comment:11 Changed 2 years ago by nemo

  • Keywords OPA r3.0 added; release-3.0 removed

comment:12 Changed 2 years ago by nemo

  • Keywords v3.0 added; r3.0 removed
Note: See TracTickets for help on using tickets.