File indexing completed on 2018-03-02 18:37:37 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
7f58e89433 Jean*0001 #include "CPP_OPTIONS.h"
0002
8276725b84 Jean*0003
0004
0005
0006
0007 SUBROUTINE CPL_READ_PARAMS( msgUnit )
0008
0009
7f58e89433 Jean*0010
0011
8276725b84 Jean*0012
7f58e89433 Jean*0013
0014
8276725b84 Jean*0015
0016 IMPLICIT NONE
0017
7f58e89433 Jean*0018 #include "CPL_PARAMS.h"
0019
8276725b84 Jean*0020
0021
0022 INTEGER msgUnit
0023
0024
6502611145 Jean*0025 INTEGER ioUnit
0026 LOGICAL fileExist
8276725b84 Jean*0027
7f58e89433 Jean*0028
6502611145 Jean*0029 NAMELIST /COUPLER_PARAMS/
0030 & cpl_sequential,
0031 & cpl_exchange_RunOff,
0032 & cpl_exchange1W_sIce, cpl_exchange2W_sIce,
0033 & cpl_exchange_SaltPl, cpl_exchange_DIC,
0034 & runOffMapSize, runOffMapFile
7f58e89433 Jean*0035
6502611145 Jean*0036
0037 cpl_sequential = 0
0038
0039
0040 cpl_exchange_RunOff = 0
0041 cpl_exchange1W_sIce = 0
0042 cpl_exchange2W_sIce = 0
0043 cpl_exchange_SaltPl = 0
0044 cpl_exchange_DIC = 0
0045 runOffMapSize = 0
0046 runOffMapFile = ' '
0047
0048 cplErrorCount = 0
0049 fileExist = .FALSE.
0050
0051
0052 INQUIRE( FILE='data.cpl', EXIST=fileExist )
0053 IF ( fileExist ) THEN
0054 WRITE(msgUnit,'(2A)') 'CPL_READ_PARAMS: ',
0055 & 'Reading parameter file "data.cpl"'
0056 ioUnit = 88
0057 OPEN( ioUnit, FILE='data.cpl',STATUS='old')
0058 READ( ioUnit, COUPLER_PARAMS )
0059 CLOSE(ioUnit )
0060 ELSE
0061 cplErrorCount = 1
0062 WRITE(msgUnit,'(2A)') ' *** ERROR *** CPL_READ_PARAMS: ',
0063 & 'parameter file "data.cpl" not found'
0064 WRITE(msgUnit,'(2A,I4,A)') ' *** ERROR *** CPL_READ_PARAMS: ',
0065 & '==> set ErrorCount=', cplErrorCount, ' (Fatal)'
0066 ENDIF
0067
db74e45e6e Jean*0068
0069 IF ( cpl_exchange2W_sIce.EQ.3 .AND. cpl_sequential.EQ.0 ) THEN
0070 cplErrorCount = cplErrorCount + 1
0071 WRITE(msgUnit,'(2A)') ' *** ERROR *** CPL_READ_PARAMS: ',
0072 & 'needs "cpl_sequential=1" to use: cpl_exchange2W_sIce=3'
0073 WRITE(msgUnit,'(2A,I4,A)') ' *** ERROR *** CPL_READ_PARAMS: ',
0074 & '==> set ErrorCount=', cplErrorCount, ' (Fatal)'
0075 ENDIF
0076 IF ( cpl_exchange2W_sIce.EQ.1 .AND. cpl_sequential.EQ.1 ) THEN
0077 cplErrorCount = cplErrorCount + 1
0078 WRITE(msgUnit,'(2A)') ' *** ERROR *** CPL_READ_PARAMS: ',
0079 & 'needs "cpl_sequential=0" to use: cpl_exchange2W_sIce=1'
0080 WRITE(msgUnit,'(2A,I4,A)') ' *** ERROR *** CPL_READ_PARAMS: ',
0081 & '==> set ErrorCount=', cplErrorCount, ' (Fatal)'
0082 ENDIF
0083
6502611145 Jean*0084
0085 IF ( cplErrorCount.EQ.0 ) THEN
0086 WRITE(msgUnit,'(2A)') 'CPL_READ_PARAMS: ',
0087 & '------ Coupler parameter Summary: -----------------'
0088
0089
0090 WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
0091 & ' cpl_sequential = ', cpl_sequential
0092
0093
0094 WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
0095 & ' cpl_exchange_RunOff =', cpl_exchange_RunOff
0096 WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
0097 & ' cpl_exchange1W_sIce =', cpl_exchange1W_sIce
0098 WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
0099 & ' cpl_exchange2W_sIce =', cpl_exchange2W_sIce
0100 WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
0101 & ' cpl_exchange_SaltPl =', cpl_exchange_SaltPl
0102 WRITE(msgUnit,'(2A,I4)') 'CPL_READ_PARAMS: ',
0103 & ' cpl_exchange_DIC =', cpl_exchange_DIC
0104
0105
8276725b84 Jean*0106 WRITE(msgUnit,'(2A,I8)') 'CPL_READ_PARAMS: ',
6502611145 Jean*0107 & ' runOffMapSize=', runOffMapSize
8276725b84 Jean*0108 WRITE(msgUnit,'(3A)') 'CPL_READ_PARAMS: ',
6502611145 Jean*0109 & ' runOffMapFile=', runOffMapFile
0110
0111 WRITE(msgUnit,'(2A)') 'CPL_READ_PARAMS: ',
0112 & '------ End of Coupler parameter Summary ------------'
0113 ENDIF
7f58e89433 Jean*0114
0115 RETURN
0116 END