Opened 6 years ago
Closed 6 years ago
#371 closed defect (fixed)
exception is raised when NBUFF is not divisible by the number of forcing timesteps
Reported by: | ajornet | Owned by: | jgipsl |
---|---|---|---|
Priority: | major | Milestone: | ORCHIDEE 2.0 |
Component: | Driver files | Version: | trunc |
Keywords: | nbuff | Cc: |
Description
The call NF90_GET_VAR (located in IOIPSL flinget_mat) call fails when NBUFF is not divisible by the total number of forcing file timesteps. This happens in the last iteration. When the requested timesteps (NBUFF) are bigger than the remaing part to be read.
NF90_GET_VAR is requested to read more values than actually found in the netcdf forcing file.
IOIPSL does not check the returning error code. Those uncontrolled values go back to Orchidee. Eventualy fails due to the inconsistency.
This can be reproduced:
In run.def:
- Forcing_file.nc: input forcing file of 1460 timesteps
- NBUFF: 15
Modify IOIPSL/src/flincom.f90 so it stops when the call returns an error:
[p529jorn@curie70 src]$ svn diff Index: flincom.f90 =================================================================== --- flincom.f90 (revision 4284) +++ flincom.f90 (working copy) @@ -1612,6 +1612,11 @@ iret = NF90_GET_VAR (fid, vid, var_tmp, & start=w_sta(:), count=w_len(:)) !--- + IF (iret /= NF90_NOERR) THEN + WRITE(ipslout,*) 'flinget_mat 2.9 : ',NF90_STRERROR (iret) + CALL ipslerr(3, 'flinget_mat','Error on netcdf NF90_GET_VAR','', '') + ENDIF +!--- itau_len=itau_fin-itau_dep+1 IF (l_dbg) WRITE(ipslout,*) 'flinget_mat 3.0 : clen, itau_len ',clen,itau_len var(:) = mis_v @@ -1630,9 +1635,14 @@ ELSE iret = NF90_GET_VAR (fid, vid, var, & start=w_sta(:), count=w_len(:)) + + IF (iret /= NF90_NOERR) THEN + WRITE(ipslout,*) 'flinget_mat 3.1 : ',NF90_STRERROR (iret) + CALL ipslerr(3, 'flinget_mat','Error on netcdf NF90_GET_VAR','Read in netcdf failed', '') + ENDIF ENDIF !- - IF (l_dbg) WRITE(ipslout,*) 'flinget_mat 3.1 : ',NF90_STRERROR (iret) + IF (l_dbg) WRITE(ipslout,*) 'flinget_mat 3.2 : ',NF90_STRERROR (iret) !-------------------------- END SUBROUTINE flinget_mat !-
Change History (3)
comment:1 Changed 6 years ago by ajornet
comment:2 Changed 6 years ago by jgipsl
- Milestone changed from orchidee_1_9_6 to ORCHIDEE 2.0
- Owner changed from somebody to jgipsl
- Status changed from new to assigned
comment:3 Changed 6 years ago by jgipsl
- Resolution set to fixed
- Status changed from assigned to closed
done in the trunk rev [4621]
Suggested modification in flinget_buffer to allow any NBUFF value: