File indexing completed on 2018-03-28 05:09:32 UTC
view on githubraw file Latest commit cbf501ab on 2018-03-24 21:23:32 UTC
5da8ce63fa Dimi*0001 #include "ICEFRONT_OPTIONS.h"
e3eaf00330 Jean*0002 #ifdef ALLOW_EXF
0003 # include "EXF_OPTIONS.h"
0004 #endif /* ALLOW_EXF */
d28329b3d8 Jean*0005 #undef ALLOW_ICEFRONT_DEBUG
5da8ce63fa Dimi*0006
0007 SUBROUTINE ICEFRONT_INIT_FIXED( myThid )
0008
0009
0010
0011
0012
0013
0014 IMPLICIT NONE
0015
0016
0017 #include "SIZE.h"
0018 #include "EEPARAMS.h"
0019 #include "PARAMS.h"
8126484198 Dimi*0020 #include "GRID.h"
0021 #include "ICEFRONT.h"
e3eaf00330 Jean*0022 #ifdef ALLOW_EXF
0023 # include "EXF_PARAM.h"
0024 #endif /* ALLOW_EXF */
5da8ce63fa Dimi*0025
0026
dd27fc9274 Jean*0027
5da8ce63fa Dimi*0028 INTEGER myThid
0029
0030 #ifdef ALLOW_ICEFRONT
0031
dd27fc9274 Jean*0032
0033
8126484198 Dimi*0034 INTEGER I, J, K, bi, bj
d28329b3d8 Jean*0035 #ifdef ALLOW_ICEFRONT_DEBUG
8126484198 Dimi*0036 INTEGER ISinterface
d28329b3d8 Jean*0037 #endif
0161ec1c34 Mart*0038 #ifdef ALLOW_EXF
cbf501ab81 Jean*0039 INTEGER errCount
0161ec1c34 Mart*0040 CHARACTER*(MAX_LEN_MBUF) msgBuf
0041 #endif /* ALLOW_EXF */
8126484198 Dimi*0042
e3eaf00330 Jean*0043 #ifdef ALLOW_EXF
dd27fc9274 Jean*0044 IF ( useEXF .AND. SGRunOffFile .NE. ' ' ) THEN
e3eaf00330 Jean*0045 _BEGIN_MASTER( myThid )
dd27fc9274 Jean*0046 errCount = 0
e3eaf00330 Jean*0047 # ifdef ALLOW_DEBUG
0048 IF (debugMode) CALL DEBUG_CALL('GETFIELD_START SGRunOff',myThid)
0049 # endif
dd27fc9274 Jean*0050 CALL EXF_GETFFIELD_START( useExfYearlyFields,
0051 I 'icefront', 'SGRunOff', SGRunOffperiod,
0052 I SGRunOffstartdate1, SGRunOffstartdate2,
0053 U SGRunOffStartTime, errCount,
0054 I myThid )
0055 IF ( errCount.GE.1 ) THEN
0056 WRITE(msgBuf,'(A,I3,A)')
0057 & 'ICEFRONT_INIT_FIXED: detected', errCount,' fatal error(s)'
0058 CALL PRINT_ERROR( msgBuf, myThid )
0059 CALL ALL_PROC_DIE( 0 )
0060 STOP 'ABNORMAL END: S/R ICEFRONT_INIT_FIXED'
0061 ENDIF
e3eaf00330 Jean*0062 _END_MASTER( myThid )
0063 _BARRIER
0064 ENDIF
0065 #endif /* ALLOW_EXF */
0066
8126484198 Dimi*0067 IF ( ICEFRONTlengthFile .NE. ' ' ) THEN
0068 CALL READ_FLD_XY_RS( ICEFRONTlengthFile, ' ',
0069 & icefrontlength, 0, myThid )
0070 _EXCH_XY_RS( icefrontlength, myThid )
0071 ENDIF
0072
0073 IF ( ICEFRONTdepthFile .NE. ' ' ) THEN
0074 CALL READ_FLD_XY_RS( ICEFRONTdepthFile, ' ',
0075 & R_icefront, 0, myThid )
0076 _EXCH_XY_RS( R_icefront, myThid )
0077 ENDIF
0078
363f5481fe Yun *0079
0080 DO bj = myByLo(myThid), myByHi(myThid)
0081 DO bi = myBxLo(myThid), myBxHi(myThid)
0082 DO J = 1-OLy, sNy+OLy
0083 DO I = 1-OLx, sNx+OLx
0084 R_icefront(I,J,bi,bj) = ABS(R_icefront(I,J,bi,bj))
0085 ENDDO
0086 ENDDO
0087 ENDDO
0088 ENDDO
0089
8126484198 Dimi*0090 DO bj = myByLo(myThid), myByHi(myThid)
0091 DO bi = myBxLo(myThid), myBxHi(myThid)
0092 DO J = 1-OLy, sNy+OLy
0093 DO I = 1-OLx, sNx+OLx
0094 K_icefront(i,j,bi,bj) = 0
0095 DO K = 1 , Nr
363f5481fe Yun *0096 IF ( R_icefront(I,J,bi,bj) .GT. ABS(rF(K)))
8126484198 Dimi*0097 & K_icefront(I,J,bi,bj) = K
0098 ENDDO
0099 ENDDO
0100 ENDDO
0101 ENDDO
0102 ENDDO
0103
0104 #ifdef ALLOW_ICEFRONT_DEBUG
0105 DO bj = myByLo(myThid), myByHi(myThid)
0106 DO bi = myBxLo(myThid), myBxHi(myThid)
0107 DO J = 1, sNy
0108 DO I = 1, sNx
0109
0110 IF (ICEFRONTlength(I,J,bi,bj) .GT. 0. _d 0) THEN
0111
e3eaf00330 Jean*0112 IsInterface=Isinterface + K_icefront(I,J,bi,bj)
8126484198 Dimi*0113 ENDIF
0114 ENDDO
0115 ENDDO
0116 ENDDO
0117 ENDDO
0118 print*, 'Interface # =', IsInterface
0119 #endif /* ALLOW_ICEFRONT_DEBUG */
5da8ce63fa Dimi*0120
0121 #ifdef ALLOW_DIAGNOSTICS
0122 IF ( useDiagnostics ) THEN
16ee41eab1 Jean*0123 CALL ICEFRONT_DIAGNOSTICS_INIT( myThid )
5da8ce63fa Dimi*0124 ENDIF
0125 #endif /* ALLOW_DIAGNOSTICS */
dd27fc9274 Jean*0126
5da8ce63fa Dimi*0127 #endif /* ALLOW_ICEFRONT */
0128
0129 RETURN
0130 END