id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 1325,Incorrect output restart filenames generated if files exist and ln_clobber is .true.,acc,nemo,"With ln_clobber set to .true. it should be possible to repeat runs and overwrite earlier versions of output files. The logic is currently flawed in that the processor number is appended to the base filename for checking if the file exists in iom_open and again in iom_nf90_open for output files. The string variable is reset between calls if the file does not exist but not if the file exists and ln_clobber is .true. The result is an extra set of restart files with names such as: {{{ ORCA2_00000465_restart_0000_0000.nc }}} Changing: {{{ IF( llwrt .AND. .NOT. ln_clobber ) THEN ! we stop as we want to write in a new file CALL ctl_stop( TRIM(clinfo), 'We want to write in a new file but '//TRIM(clname)//' already exists...' ) istop = nstop + 1 ! make sure that istop /= nstop so we don't open the file ENDIF }}} to: {{{ IF( llwrt .AND. .NOT. ln_clobber ) THEN ! we stop as we want to write in a new file CALL ctl_stop( TRIM(clinfo), 'We want to write in a new file but '//TRIM(clname)//' already exists...' ) istop = nstop + 1 ! make sure that istop /= nstop so we don't open the file ELSEIF( llwrt ) THEN ! the file exists and we are in write mode with permission to clname = cltmpn ! overwrite so get back the file name without the cpu number ENDIF }}} in iom.F90 gives the correct behaviour. ",Bug,closed,low,,OCE,v3.6,,fixed,,