File indexing completed on 2018-03-02 18:37:40 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
b2ea1d2979 Jean*0001 #include "ATM_PHYS_OPTIONS.h"
0002
0003
0004
0005
0006
0007
0008 SUBROUTINE ATM_PHYS_READ_PICKUP( myIter, myThid )
0009
0010
0011
0012
0013
0014 IMPLICIT NONE
0015 #include "SIZE.h"
0016 #include "EEPARAMS.h"
0017 #include "PARAMS.h"
0018 #include "ATM_PHYS_PARAMS.h"
0019 #include "ATM_PHYS_VARS.h"
0020
0021
0022
0023
0024 INTEGER myIter
0025 INTEGER myThid
0026
0027 #ifdef ALLOW_ATM_PHYS
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 INTEGER fp
0042 INTEGER filePrec, nbFields
0043 INTEGER missFldDim, nMissing
0044 INTEGER j, nj, ioUnit
0045 PARAMETER( missFldDim = 12 )
ab33782b56 Jean*0046 CHARACTER*(10) suff
b2ea1d2979 Jean*0047 CHARACTER*(MAX_LEN_FNAM) fn
0048 CHARACTER*(8) missFldList(missFldDim)
0049 CHARACTER*(MAX_LEN_MBUF) msgBuf
0050
0051
0052
0053
b5f066e9ce Jean*0054
0055 IF ( .NOT.atmPhys_stepSST ) RETURN
0056
b2ea1d2979 Jean*0057 IF ( pickupSuff.EQ.' ' ) THEN
ab33782b56 Jean*0058 IF ( rwSuffixType.EQ.0 ) THEN
0059 WRITE(fn,'(A,I10.10)') 'pickup_atmPhys.', myIter
0060 ELSE
0061 CALL RW_GET_SUFFIX( suff, startTime, myIter, myThid )
0062 WRITE(fn,'(A,A)') 'pickup_atmPhys.', suff
0063 ENDIF
b2ea1d2979 Jean*0064 ELSE
ab33782b56 Jean*0065 WRITE(fn,'(A,A10)') 'pickup_atmPhys.', pickupSuff
b2ea1d2979 Jean*0066 ENDIF
0067 fp = precFloat64
0068
0069 CALL READ_MFLDS_SET(
0070 I fn,
0071 O nbFields, filePrec,
0072 I Nr, myIter, myThid )
0073 _BEGIN_MASTER( myThid )
0074
0075 IF ( nbFields.GE.0 .AND. filePrec.NE.fp ) THEN
0076 WRITE(msgBuf,'(2A,I4)') 'ATM_PHYS_READ_PICKUP: ',
0077 & 'pickup-file binary precision do not match !'
0078 CALL PRINT_ERROR( msgBuf, myThid )
0079 WRITE(msgBuf,'(A,2(A,I4))') 'ATM_PHYS_READ_PICKUP: ',
0080 & 'file prec.=', filePrec, ' but expecting prec.=', fp
0081 CALL PRINT_ERROR( msgBuf, myThid )
0082 CALL ALL_PROC_DIE( 0 )
0083 STOP 'ABNORMAL END: S/R ATM_PHYS_READ_PICKUP (data-prec Pb)'
0084 ENDIF
0085 _END_MASTER( myThid )
0086
0087 IF ( nbFields.LE.0 ) THEN
0088
0089 ioUnit = errorMessageUnit
0090 IF ( pickupStrictlyMatch ) THEN
0091 WRITE(msgBuf,'(4A)') 'ATM_PHYS_READ_PICKUP: ',
0092 & 'no field-list found in meta-file',
0093 & ' => cannot check for strick-matching'
0094 CALL PRINT_ERROR( msgBuf, myThid )
0095 WRITE(msgBuf,'(4A)') 'ATM_PHYS_READ_PICKUP: ',
0096 & 'try with " pickupStrictlyMatch=.FALSE.,"',
0097 & ' in file: "data", NameList: "PARM03"'
0098 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
0099 CALL ALL_PROC_DIE( myThid )
0100 STOP 'ABNORMAL END: S/R ATM_PHYS_READ_PICKUP'
0101 ELSE
0102 WRITE(msgBuf,'(4A)') 'WARNING >> ATM_PHYS_READ_PICKUP: ',
0103 & ' no field-list found'
0104 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
0105 IF ( nbFields.EQ.-1 ) THEN
0106
0107 WRITE(msgBuf,'(4A)') 'WARNING >> ',
0108 & ' try to read pickup as currently written'
0109 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
0110 ELSE
0111
0112
0113
0114
0115
0116
0117
0118 WRITE(msgBuf,'(4A)') 'ATM_PHYS_READ_PICKUP: ',
0119 & 'no field-list found in meta-file'
0120 CALL PRINT_ERROR( msgBuf, myThid )
0121 CALL ALL_PROC_DIE( myThid )
0122 STOP 'ABNORMAL END: S/R ATM_PHYS_READ_PICKUP'
0123 ENDIF
0124 ENDIF
0125 ENDIF
0126
0127
0128
0129 IF ( nbFields.EQ.0 ) THEN
0130
0131
0132 ELSE
0133
0134 nj = 0
0135
0136
0137 nj = nj*Nr
0138
0139 CALL READ_MFLDS_3D_RL( 'AtPh_SST', atmPhys_SST,
0140 & nj, fp, 1 , myIter, myThid )
0141
0142
0143 ENDIF
0144
0145
0146 nMissing = missFldDim
0147 CALL READ_MFLDS_CHECK(
0148 O missFldList,
0149 U nMissing,
0150 I myIter, myThid )
0151 IF ( nMissing.GT.missFldDim ) THEN
0152 WRITE(msgBuf,'(2A,I4)') 'ATM_PHYS_READ_PICKUP: ',
0153 & 'missing fields list has been truncated to', missFldDim
0154 CALL PRINT_ERROR( msgBuf, myThid )
0155 CALL ALL_PROC_DIE( myThid )
0156 STOP 'ABNORMAL END: S/R ATM_PHYS_READ_PICKUP (list-size Pb)'
0157 ENDIF
0158 IF ( nMissing.GE.1 ) THEN
0159 ioUnit = errorMessageUnit
0160 DO j=1,nMissing
0161 WRITE(msgBuf,'(4A)') 'ATM_PHYS_READ_PICKUP: ',
0162 & 'cannot restart without field "',missFldList(nj),'"'
0163 CALL PRINT_ERROR( msgBuf, myThid )
0164 ENDDO
0165 CALL ALL_PROC_DIE( myThid )
0166 STOP 'ABNORMAL END: S/R ATM_PHYS_READ_PICKUP'
0167 ENDIF
0168
0169
b5f066e9ce Jean*0170 CALL EXCH_XY_RL( atmPhys_SST, myThid )
b2ea1d2979 Jean*0171
0172 #endif /* ALLOW_ATM_PHYS */
0173
0174 RETURN
0175 END