/[MITgcm]/MITgcm/eesupp/src/mdsfindunit.F
ViewVC logotype

Contents of /MITgcm/eesupp/src/mdsfindunit.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Tue Aug 22 18:57:53 2006 UTC (18 years, 1 month ago) by ce107
Branch: MAIN
CVS Tags: checkpoint64a, mitgcm_mapl_00, checkpoint58u_post, checkpoint58w_post, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint58r_post, checkpoint58x_post, checkpoint58t_post, checkpoint58q_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint59, checkpoint58o_post, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.1: +2 -2 lines
Increased limit of open file descriptors to avoid unwarranted trouble

1 C $Header: /u/gcmpack/MITgcm/eesupp/src/mdsfindunit.F,v 1.1 2005/08/23 13:21:08 jmc Exp $
2 C $Name: $
3
4 #include "CPP_EEOPTIONS.h"
5
6 subroutine MDSFINDUNIT( iounit, mythid )
7 C OUT:
8 C iounit integer - unit number
9 C
10 C MDSFINDUNIT returns a valid, unused unit number for f77 I/O
11 C The routine stops the program is an error occurs in the process
12 C of searching the I/O channels.
13 C
14 C Created: 03/20/99 adcroft@mit.edu
15
16 implicit none
17
18 #include "EEPARAMS.h"
19
20 C Arguments
21 integer iounit
22 integer mythid
23 C Local
24 integer ii
25 logical op
26 integer ios
27 character*(max_len_mbuf) msgbuf
28 C ------------------------------------------------------------------
29
30 C Sweep through a valid range of unit numbers
31 iounit=-1
32 do ii=9,999
33 if (iounit.eq.-1) then
34 inquire(unit=ii,iostat=ios,opened=op)
35 if (ios.ne.0) then
36 write(msgbuf,'(a,i2.2)')
37 & ' MDSFINDUNIT: inquiring unit number = ',ii
38 call print_message( msgbuf, standardmessageunit,
39 & SQUEEZE_RIGHT , mythid)
40 write(msgbuf,'(a)')
41 & ' MDSFINDUNIT: inquire statement failed!'
42 call print_error( msgbuf, mythid )
43 stop 'ABNORMAL END: S/R MDSFINDUNIT'
44 endif
45 if (.NOT. op) then
46 iounit=ii
47 endif
48 endif
49 enddo
50
51 C Was there an available unit number
52 if (iounit.eq.-1) then
53 write(msgbuf,'(a)')
54 & ' MDSFINDUNIT: could not find an available unit number!'
55 call print_error( msgbuf, mythid )
56 stop 'ABNORMAL END: S/R MDSFINDUNIT'
57 endif
58
59 C ------------------------------------------------------------------
60 return
61 end

  ViewVC Help
Powered by ViewVC 1.1.22