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

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

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


Revision 1.1 - (hide annotations) (download)
Tue Aug 23 13:21:08 2005 UTC (19 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint58e_post, checkpoint57s_post, checkpoint57y_post, checkpoint58n_post, checkpoint58h_post, checkpoint57y_pre, checkpoint57v_post, checkpoint58j_post, checkpoint57r_post, checkpoint58, checkpoint58f_post, checkpoint57x_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpint57u_post, checkpoint58a_post, checkpoint58i_post, checkpoint58g_post, checkpoint57z_post, checkpoint58k_post, checkpoint58b_post, checkpoint58m_post
move basic S/R (with no I/O, + used outside of pkg/mdsio) from pkg/mdsio
 to allow to compile the code without pkg/mdsio.

1 jmc 1.1 C $Header: /u/gcmpack/MITgcm/pkg/mdsio/mdsio_findunit.F,v 1.1 2001/03/06 15:28:53 adcroft 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,99
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