202 |
C Add the variable definition |
C Add the variable definition |
203 |
CALL MNC_FILE_REDEF(fname, myThid) |
CALL MNC_FILE_REDEF(fname, myThid) |
204 |
err = NF_DEF_VAR(fid, vname, vtype, nd, ids, vid) |
err = NF_DEF_VAR(fid, vname, vtype, nd, ids, vid) |
205 |
write(msgbuf,'(5a)') 'defining variable ''', vname(1:lenv), |
IF ( err .NE. NF_NOERR ) THEN |
206 |
|
write(msgbuf,'(2a)') 'ERROR: MNC will not ', |
207 |
|
& 'overwrite variables in existing NetCDF' |
208 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
209 |
|
write(msgbuf,'(2a)') ' files. Please', |
210 |
|
& ' make sure that you are not trying to' |
211 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
212 |
|
write(msgbuf,'(2a)') ' overwrite output', |
213 |
|
& 'files from a previous model run!' |
214 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
215 |
|
write(msgbuf,'(5a)') 'defining variable ''', vname(1:lenv), |
216 |
& ''' in file ''', fname(1:lenf), '''' |
& ''' in file ''', fname(1:lenf), '''' |
217 |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
CALL MNC_HANDLE_ERR(err, msgbuf, myThid) |
218 |
|
ENDIF |
219 |
|
|
220 |
C Success, so save the variable info |
C Success, so save the variable info |
221 |
CALL MNC_GET_NEXT_EMPTY_IND(MNC_MAX_ID,mnc_v_names,indv, myThid) |
CALL MNC_GET_NEXT_EMPTY_IND(MNC_MAX_ID,mnc_v_names,indv, myThid) |