File indexing completed on 2025-12-15 06:14:27 UTC
view on githubraw file Latest commit ad59256d on 2025-12-15 00:05:36 UTC
ad59256d7d aver*0001 #include "CPP_EEOPTIONS.h"
0002
0003
0004
0005
0006
0007 SUBROUTINE OBSFIT_FINDUNIT( ioUnit, myThid )
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 IMPLICIT NONE
0018
0019 #include "EEPARAMS.h"
0020
0021
0022
0023
0024 INTEGER ioUnit
0025 INTEGER myThid
0026
0027
0028
0029 INTEGER ii
0030 LOGICAL op
0031 INTEGER ios
0032 CHARACTER*(MAX_LEN_MBUF) msgBuf
0033
0034
0035 ioUnit=-1
0036 DO ii = 2000, 9999
0037 IF ( ioUnit.EQ.-1 ) THEN
0038
0039 IF ( ii.NE.errorMessageUnit .AND.
0040 & ii.NE.standardMessageUnit .AND.
0041 & ii.NE.scrUnit1 .AND. ii.NE.scrUnit2 .AND.
0042 & ii.NE.eeDataUnit .AND. ii.NE.modelDataUnit ) THEN
0043 INQUIRE(unit=ii,iostat=ios,opened=op)
0044 IF ( ios.NE.0 ) THEN
0045 WRITE(msgBuf,'(A,I4)')
0046 & ' OBSFIT_FINDUNIT: inquiring unit number =', ii
0047 CALL PRINT_MESSAGE( msgBuf,
0048 & standardMessageUnit, SQUEEZE_RIGHT, myThid )
0049 WRITE(msgBuf,'(A)')
0050 & ' OBSFIT_FINDUNIT: inquire statement failed!'
0051 CALL PRINT_ERROR( msgBuf, myThid )
0052 CALL ALL_PROC_DIE( myThid )
0053 STOP 'ABNORMAL END: S/R OBSFIT_FINDUNIT'
0054 ENDIF
0055
0056 IF ( .NOT.op ) THEN
0057 ioUnit=ii
0058 ENDIF
0059 ENDIF
0060 ENDIF
0061 ENDDO
0062
0063
0064 IF ( ioUnit.EQ.-1 ) THEN
0065 WRITE(msgBuf,'(A)')
0066 & ' OBSFIT_FINDUNIT: no available unit number!'
0067 CALL PRINT_ERROR( msgBuf, myThid )
0068 CALL ALL_PROC_DIE( myThid )
0069 STOP 'ABNORMAL END: S/R OBSFIT_FINDUNIT'
0070 ENDIF
0071
0072 RETURN
0073 END
0074
0075