File indexing completed on 2018-03-02 18:42:56 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
4caf2dc194 Gael*0001 #include "CPP_EEOPTIONS.h"
0002
0003 SUBROUTINE PROFILES_FINDUNIT( ioUnit, myThid )
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 IMPLICIT NONE
0014
0015 #include "EEPARAMS.h"
0016
0017
0018 INTEGER ioUnit
0019 INTEGER myThid
0020
0021 INTEGER ii
0022 LOGICAL op
0023 INTEGER ios
0024 CHARACTER*(MAX_LEN_MBUF) msgBuf
0025
0026
0027
0028 ioUnit=-1
0029 DO ii=2000,9999
0030 IF ( ioUnit.EQ.-1 ) THEN
0031
0032 IF ( ii.NE.errorMessageUnit
0033 & .AND. ii.NE.standardMessageUnit
0034 & .AND. ii.NE.scrUnit1 .AND. ii.NE.scrUnit2
0035 & .AND. ii.NE.eeDataUnit .AND. ii.NE.modelDataUnit
0036 & ) THEN
0037 INQUIRE(unit=ii,iostat=ios,opened=op)
0038 IF ( ios.NE.0 ) THEN
0039 WRITE(msgBuf,'(A,I4)')
0040 & ' PROFILES_FINDUNIT: inquiring unit number =', ii
0041 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0042 & SQUEEZE_RIGHT, myThid )
0043 WRITE(msgBuf,'(A)')
0044 & ' PROFILES_FINDUNIT: inquire statement failed!'
0045 CALL PRINT_ERROR( msgBuf, myThid )
b00d6c1700 Gael*0046 CALL ALL_PROC_DIE( myThid )
4caf2dc194 Gael*0047 STOP 'ABNORMAL END: S/R PROFILES_FINDUNIT'
0048 ENDIF
0049 IF ( .NOT.op ) THEN
0050 ioUnit=ii
0051 ENDIF
0052 ENDIF
0053 ENDIF
0054 ENDDO
0055
0056
0057 IF ( ioUnit.EQ.-1 ) THEN
0058 WRITE(msgBuf,'(A)')
0059 & ' PROFILES_FINDUNIT: could not find an available unit number!'
0060 CALL PRINT_ERROR( msgBuf, myThid )
b00d6c1700 Gael*0061 CALL ALL_PROC_DIE( myThid )
4caf2dc194 Gael*0062 STOP 'ABNORMAL END: S/R PROFILES_FINDUNIT'
0063 ENDIF
0064
0065 RETURN
0066 END