File indexing completed on 2022-03-25 05:10:13 UTC
view on githubraw file Latest commit 7e00d7e8 on 2022-03-24 16:33:13 UTC
d6f06800ae Patr*0001 #include "THSICE_OPTIONS.h"
6b47d550f4 Mart*0002 #ifdef ALLOW_AUTODIFF
0003 # include "AUTODIFF_OPTIONS.h"
0004 #endif
d6f06800ae Patr*0005
215b2b0f80 Jean*0006
0007
0008
0009
605828d389 Jean*0010 SUBROUTINE THSICE_CHECK( myThid )
d6f06800ae Patr*0011
215b2b0f80 Jean*0012
0013
0014
0015
0016
0017
d6f06800ae Patr*0018
215b2b0f80 Jean*0019
0020 IMPLICIT NONE
d6f06800ae Patr*0021
215b2b0f80 Jean*0022
d6f06800ae Patr*0023 #include "SIZE.h"
e40ff4922c Jean*0024 #include "EEPARAMS.h"
0025 #include "PARAMS.h"
d6f06800ae Patr*0026 #include "THSICE_SIZE.h"
0027 #include "THSICE_PARAMS.h"
0028
215b2b0f80 Jean*0029
0030
605828d389 Jean*0031 INTEGER myThid
d6f06800ae Patr*0032
215b2b0f80 Jean*0033
0034
d6f06800ae Patr*0035 CHARACTER*(MAX_LEN_MBUF) msgBuf
60273f92b0 Jean*0036 INTEGER errCount
215b2b0f80 Jean*0037
d6f06800ae Patr*0038
0039 _BEGIN_MASTER(myThid)
60273f92b0 Jean*0040 errCount = 0
d6f06800ae Patr*0041
0042 WRITE(msgBuf,'(A)') 'THSICE_CHECK: #define THSICE'
0043 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
215b2b0f80 Jean*0044 & SQUEEZE_RIGHT, myThid )
d6f06800ae Patr*0045
e40ff4922c Jean*0046
6831979b17 Jean*0047 IF ( .NOT.( thSIce_skipThermo .OR. useBulkForce .OR. useEXF
0048 & .OR. useAIM .OR. useCheapAML .OR. useATM2d ) ) THEN
215b2b0f80 Jean*0049
0050 WRITE(msgBuf,'(2A)')
0051 & 'THSICE_CHECK: needs some PKG (EXF,Bulk-Force,AIM,CheapAML)'
0052 CALL PRINT_ERROR( msgBuf, myThid )
0053 WRITE(msgBuf,'(2A)')
0054 & 'THSICE_CHECK: to provide Air-Ice surface fluxes for THSICE'
0055 CALL PRINT_ERROR( msgBuf, myThid )
60273f92b0 Jean*0056 errCount = errCount + 1
215b2b0f80 Jean*0057 ENDIF
e40ff4922c Jean*0058 IF ( thSIceAdvScheme.EQ.0 .AND. thSIce_diffK.NE.0. ) THEN
0059 WRITE(msgBuf,'(2A)')
0060 & 'THSICE_CHECK: to use thSIce_diffK, needs to select',
0061 & ' one advection scheme (thSIceAdvScheme<>0)'
215b2b0f80 Jean*0062 CALL PRINT_ERROR( msgBuf, myThid )
60273f92b0 Jean*0063 errCount = errCount + 1
e40ff4922c Jean*0064 ENDIF
0065 #ifndef ALLOW_GENERIC_ADVDIFF
0066 IF ( thSIceAdvScheme.NE.0 ) THEN
0067 WRITE(msgBuf,'(2A)') 'THSICE_CHECK: Need to compile ',
0068 & '"generic_advdiff" pkg in order to use thSIceAdvScheme'
215b2b0f80 Jean*0069 CALL PRINT_ERROR( msgBuf, myThid )
60273f92b0 Jean*0070 errCount = errCount + 1
e40ff4922c Jean*0071 ENDIF
0072 #endif /* ndef ALLOW_GENERIC_ADVDIFF */
0073
0074 IF ( thSIceBalanceAtmFW.NE.0 ) THEN
0075 #ifndef ALLOW_BALANCE_FLUXES
1d92d68d9a Jean*0076 WRITE(msgBuf,'(2A)') 'THSICE_CHECK: needs to have ',
0077 & 'ALLOW_BALANCE_FLUXES defined to use thSIceBalanceAtmFW'
215b2b0f80 Jean*0078 CALL PRINT_ERROR( msgBuf, myThid )
60273f92b0 Jean*0079 errCount = errCount + 1
e40ff4922c Jean*0080 #endif
7e00d7e8f9 Jean*0081 IF ( selectBalanceEmPmR.GE.1 ) THEN
e40ff4922c Jean*0082 WRITE(msgBuf,'(2A)') 'THSICE_CHECK: cannot use',
7e00d7e8f9 Jean*0083 & ' both selectBalanceEmPmR and thSIceBalanceAtmFW'
215b2b0f80 Jean*0084 CALL PRINT_ERROR( msgBuf, myThid )
60273f92b0 Jean*0085 errCount = errCount + 1
e40ff4922c Jean*0086 ENDIF
0087 ENDIF
0088
6b47d550f4 Mart*0089 #ifdef ALLOW_AUTODIFF_TAMC
d6f06800ae Patr*0090 IF ( nitMaxTsf .GT. MaxTsf ) THEN
e40ff4922c Jean*0091 WRITE(msgBuf,'(2A)')
0092 & 'THSICE_CHECK: Need to set MaxTsf >= nitMaxTsf for TAF'
215b2b0f80 Jean*0093 CALL PRINT_ERROR( msgBuf, myThid )
60273f92b0 Jean*0094 errCount = errCount + 1
d6f06800ae Patr*0095 ENDIF
6b47d550f4 Mart*0096 #endif /* ALLOW_AUTODIFF_TAMC */
0097 #ifdef ALLOW_AUTODIFF
00fefbf37d Jean*0098 # ifdef ALLOW_DBUG_THSICE
0099 WRITE(msgBuf,'(2A)')
0100 & 'THSICE_CHECK: cannot compile AD-code with ALLOW_DBUG_THSICE'
215b2b0f80 Jean*0101 CALL PRINT_ERROR( msgBuf, myThid )
60273f92b0 Jean*0102 errCount = errCount + 1
00fefbf37d Jean*0103 # endif
0104 #endif /* ALLOW_AUTODIFF */
d6f06800ae Patr*0105
60273f92b0 Jean*0106 IF ( useAIM .AND. .NOT.( stepFwd_oceMxL .OR. useCoupler )
0107 & .AND. tauRelax_MxL.NE. -1. _d 0 ) THEN
0108
0109
0110
0111 WRITE(msgBuf,'(2A)') '** WARNING ** THSICE_CHECK: ',
0112 & 'SST are not stepped forward (stepFwd_oceMx=F)'
0113 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0114 & SQUEEZE_RIGHT, myThid )
0115 WRITE(msgBuf,'(2A)') '** WARNING ** THSICE_CHECK: ',
0116 & 'nor set (from files) by pkg/aim (tauRelax_MxL<>-1)'
0117
0118 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0119 & SQUEEZE_RIGHT, myThid )
0120 ENDIF
0121
0122 IF ( errCount.GE.1 ) THEN
0123 WRITE(msgBuf,'(A,I3,A)')
0124 & 'THSICE_CHECK: detected', errCount,' fatal error(s)'
0125 CALL PRINT_ERROR( msgBuf, myThid )
0126 CALL ALL_PROC_DIE( 0 )
0127 STOP 'ABNORMAL END: S/R THSICE_CHECK'
0128 ENDIF
0129
5c2d72bcf2 Patr*0130 _END_MASTER(myThid)
0131
605828d389 Jean*0132 RETURN
0133 END