File indexing completed on 2018-03-02 18:37:23 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
d676f916b2 Jean*0001 #include "AIM_OPTIONS.h"
0002
0003
0004
0005
0006 SUBROUTINE AIM_WRITE_LOCAL(
545bd614f1 Jean*0007 I pref, suff, nNr, field,
0008 I bi, bj, iRec, myIter, myThid )
d676f916b2 Jean*0009
0010
0011
0012
0013
0014
0015
0016 IMPLICIT NONE
0017
0018
0019 #include "AIM_SIZE.h"
0020
0021 #include "EEPARAMS.h"
0022
0023
0024
0025
545bd614f1 Jean*0026
0027
0028
0029
0030
0031
0032
0033
d676f916b2 Jean*0034 CHARACTER*(*) pref,suff
0035 INTEGER nNr
0036 _RL field(sNx,sNy,nNr)
0037 INTEGER bi, bj, iRec, myIter, myThid
0038
0039 #ifdef ALLOW_AIM
0040
545bd614f1 Jean*0041
0042 INTEGER ILNBLNK
0043 EXTERNAL ILNBLNK
0044
d676f916b2 Jean*0045
0046 CHARACTER*(MAX_LEN_MBUF) msgBuf
0047 _RL tmpFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
545bd614f1 Jean*0048 INTEGER iL
0049 INTEGER i, j, k, Katm
d676f916b2 Jean*0050
0051
0052
0053
545bd614f1 Jean*0054
0055 IF ( nNr.LT.1 .OR. nNr.GT.Nr ) THEN
0056 iL = ILNBLNK( pref )
0057 WRITE(msgBuf,'(A,I10,A,2I5,A,I4,2A)')
0058 & 'AIM_WRITE_LOCAL (it=', myIter, ' bi,bj=', bi,bj,
0059 & ' iRec=', iRec, ' ): try to write: ', pref(1:iL)
0060 CALL PRINT_ERROR( msgBuf, myThid )
0061 WRITE(msgBuf,'(A,I4,A,I4)')
0062 & 'AIM_WRITE_LOCAL: 3rd dim.(field)=',nNr,' has to be <',Nr
0063 CALL PRINT_ERROR( msgBuf , myThid)
0064 STOP 'ABNORMAL END: S/R AIM_WRITE_LOCAL'
0065 ENDIF
0066
d676f916b2 Jean*0067
0068 IF (nNr.EQ.Nr) THEN
0069
0070 DO k=1,Nr
0071 Katm = _KD2KA( k )
0072 DO j=1,sNy
0073 DO i=1,sNx
0074 tmpFld(i,j,k) = field(i,j,Katm)
0075 ENDDO
0076 ENDDO
0077 ENDDO
545bd614f1 Jean*0078 ELSE
0079
d676f916b2 Jean*0080 DO k=1,nNr
0081 DO j=1,sNy
0082 DO i=1,sNx
0083 tmpFld(i,j,k) = field(i,j,k)
0084 ENDDO
0085 ENDDO
0086 ENDDO
0087 ENDIF
0088
0089
545bd614f1 Jean*0090 CALL WRITE_LOCAL_RL( pref, suff, nNr, tmpFld,
0091 & bi, bj, iRec, myIter, myThid )
d676f916b2 Jean*0092
0093 #endif /* ALLOW_AIM */
0094 RETURN
0095 END