42 |
integer ILNBLNK |
integer ILNBLNK |
43 |
|
|
44 |
C Local Variables |
C Local Variables |
45 |
integer i,n, err, fid, ind |
integer n, err, fid, ind |
|
character*(MNC_MAX_CHAR) aname |
|
46 |
character*(MAX_LEN_MBUF) msgbuf |
character*(MAX_LEN_MBUF) msgbuf |
47 |
|
|
48 |
C Is the file already open? |
C Is the file already open? |
78 |
mnc_f_info(ind,2) = fid |
mnc_f_info(ind,2) = fid |
79 |
mnc_f_info(ind,3) = 0 |
mnc_f_info(ind,3) = 0 |
80 |
mnc_fv_ids(ind,1) = 0 |
mnc_fv_ids(ind,1) = 0 |
81 |
|
mnc_f_alld(ind,1) = 0 |
82 |
|
|
83 |
RETURN |
RETURN |
84 |
END |
END |
93 |
|
|
94 |
implicit none |
implicit none |
95 |
C Arguments |
C Arguments |
96 |
integer myThid, len |
integer myThid |
97 |
character*(*) fname, atname, sval |
character*(*) fname, atname, sval |
98 |
|
|
99 |
CALL MNC_FILE_ADD_ATTR_ANY(myThid,fname,atname, 1, |
CALL MNC_FILE_ADD_ATTR_ANY(myThid,fname,atname, 1, |
114 |
C Arguments |
C Arguments |
115 |
integer myThid, len |
integer myThid, len |
116 |
character*(*) fname, atname |
character*(*) fname, atname |
117 |
_RL dval |
REAL*8 dval |
118 |
|
|
119 |
CALL MNC_FILE_ADD_ATTR_ANY(myThid,fname,atname, 2, |
CALL MNC_FILE_ADD_ATTR_ANY(myThid,fname,atname, 2, |
120 |
& ' ', len, dval, 0.0, 0 ) |
& ' ', len, dval, 0.0, 0 ) |
134 |
C Arguments |
C Arguments |
135 |
integer myThid, len |
integer myThid, len |
136 |
character*(*) fname, atname |
character*(*) fname, atname |
137 |
_RS rval |
REAL*4 rval |
138 |
|
|
139 |
CALL MNC_FILE_ADD_ATTR_ANY(myThid,fname,atname, 3, |
CALL MNC_FILE_ADD_ATTR_ANY(myThid,fname,atname, 3, |
140 |
& ' ', len, 0.0D0, rval, 0 ) |
& ' ', len, 0.0D0, rval, 0 ) |
176 |
C Arguments |
C Arguments |
177 |
integer myThid, atype, len, iv |
integer myThid, atype, len, iv |
178 |
character*(*) fname, atname, sv |
character*(*) fname, atname, sv |
179 |
_RL dv |
REAL*8 dv |
180 |
_RS rv |
REAL*4 rv |
181 |
|
|
182 |
C Functions |
C Functions |
183 |
integer ILNBLNK |
integer ILNBLNK |
184 |
|
|
185 |
C Local Variables |
C Local Variables |
186 |
integer i, n, err, fid, ind, n1,n2, lens |
integer n, err, fid, ind, n1, lens |
187 |
character*(MNC_MAX_CHAR) s1 |
character*(MNC_MAX_CHAR) s1 |
188 |
character*(MAX_LEN_MBUF) msgbuf |
character*(MAX_LEN_MBUF) msgbuf |
189 |
|
|
264 |
write(msgbuf,'(3a)') ' cannot close file ''', fname, '''' |
write(msgbuf,'(3a)') ' cannot close file ''', fname, '''' |
265 |
CALL MNC_HANDLE_ERR(myThid, err, msgbuf) |
CALL MNC_HANDLE_ERR(myThid, err, msgbuf) |
266 |
|
|
267 |
C Clear all the file, grid, and variable names and refs |
C Clear all the file, grid, variable, and dim names and refs |
268 |
n = mnc_fv_ids(ind,1) |
n = mnc_fv_ids(ind,1) |
269 |
IF (n .GE. 1) THEN |
IF (n .GE. 1) THEN |
270 |
DO i = 1,n |
DO i = 1,n |
273 |
mnc_v_names(k)(1:MNC_MAX_CHAR)=mnc_blank_name(1:MNC_MAX_CHAR) |
mnc_v_names(k)(1:MNC_MAX_CHAR)=mnc_blank_name(1:MNC_MAX_CHAR) |
274 |
ENDDO |
ENDDO |
275 |
ENDIF |
ENDIF |
276 |
|
n = mnc_f_alld(ind,1) |
277 |
|
DO i = 1,n |
278 |
|
j = mnc_f_alld(ind,i+1) |
279 |
|
mnc_d_names(j)(1:MNC_MAX_CHAR) = mnc_blank_name(1:MNC_MAX_CHAR) |
280 |
|
ENDDO |
281 |
|
mnc_f_alld(ind,1) = 0 |
282 |
DO i = 1,3 |
DO i = 1,3 |
283 |
mnc_f_info(ind,i) = 0 |
mnc_f_info(ind,i) = 0 |
284 |
ENDDO |
ENDDO |
306 |
integer ILNBLNK |
integer ILNBLNK |
307 |
|
|
308 |
C Local Variables |
C Local Variables |
309 |
integer ind, fid, def, err |
integer ind, fid, def, err, n |
310 |
character*(MAX_LEN_MBUF) msgbuf |
character*(MAX_LEN_MBUF) msgbuf |
311 |
|
|
312 |
C Verify that the file is open |
C Verify that the file is open |
313 |
CALL MNC_GET_IND(myThid, MNC_MAX_ID, fname, mnc_f_names, ind) |
CALL MNC_GET_IND(myThid, MNC_MAX_ID, fname, mnc_f_names, ind) |
314 |
IF (ind .LT. 0) THEN |
IF (ind .LT. 0) THEN |
315 |
|
n = ILNBLNK(fname) |
316 |
write(msgbuf,'(3a)') 'MNC ERROR: file ''', |
write(msgbuf,'(3a)') 'MNC ERROR: file ''', |
317 |
& fname, ''' must be opened first' |
& fname(1:n), ''' must be opened first' |
318 |
CALL print_error( msgbuf, mythid ) |
CALL print_error( msgbuf, mythid ) |
319 |
stop 'ABNORMAL END: S/R MNC_FILE_REDEF' |
stop 'ABNORMAL END: S/R MNC_FILE_REDEF' |
320 |
ENDIF |
ENDIF |
351 |
integer ILNBLNK |
integer ILNBLNK |
352 |
|
|
353 |
C Local Variables |
C Local Variables |
354 |
integer ind, fid, def, err |
integer ind, fid, def, err, n |
355 |
character*(MAX_LEN_MBUF) msgbuf |
character*(MAX_LEN_MBUF) msgbuf |
356 |
|
|
357 |
C Verify that the file is open |
C Verify that the file is open |
358 |
CALL MNC_GET_IND(myThid, MNC_MAX_ID, fname, mnc_f_names, ind) |
CALL MNC_GET_IND(myThid, MNC_MAX_ID, fname, mnc_f_names, ind) |
359 |
IF (ind .LT. 0) THEN |
IF (ind .LT. 0) THEN |
360 |
|
n = ILNBLNK(fname) |
361 |
write(msgbuf,'(3a)') 'MNC ERROR: file ''', |
write(msgbuf,'(3a)') 'MNC ERROR: file ''', |
362 |
& fname, ''' must be opened first' |
& fname(1:n), ''' must be opened first' |
363 |
CALL print_error( msgbuf, mythid ) |
CALL print_error( msgbuf, mythid ) |
364 |
stop 'ABNORMAL END: S/R MNC_FILE_REDEF' |
stop 'ABNORMAL END: S/R MNC_FILE_REDEF' |
365 |
ENDIF |
ENDIF |