** Warning **
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle dbname=MITgcm at /usr/local/share/lxr/lib/LXR/Common.pm line 1224.
Last-Modified: Tue, 9 Sep 2024 05:11:32 GMT
Content-Type: text/html; charset=utf-8
MITgcm/MITgcm/pkg/shelfice/shelfice_check.F
File indexing completed on 2024-01-13 06:10:44 UTC
view on github raw file Latest commit 005af54e on 2024-01-12 20:10:27 UTC
ffe464dc7d Mart* 0001 #include "SHELFICE_OPTIONS.h "
0002
0003 SUBROUTINE SHELFICE_CHECK ( myThid )
61e8fddf13 Jean* 0004
ffe464dc7d Mart* 0005
0006
0007
61e8fddf13 Jean* 0008
ffe464dc7d Mart* 0009 IMPLICIT NONE
0010
0011
0012 #include "SIZE.h "
0013 #include "EEPARAMS.h "
0014 #include "PARAMS.h "
71125c711d Mart* 0015 #include "SHELFICE.h "
ffe464dc7d Mart* 0016
0017
61e8fddf13 Jean* 0018
ffe464dc7d Mart* 0019 INTEGER myThid
0020
0021 #ifdef ALLOW_SHELFICE
0022
0023
61e8fddf13 Jean* 0024
ffe464dc7d Mart* 0025 CHARACTER *(MAX_LEN_MBUF ) msgBuf
9c84481760 Jean* 0026 INTEGER errCount
ffe464dc7d Mart* 0027
a93eea6699 Jean* 0028 _BEGIN_MASTER (myThid )
9c84481760 Jean* 0029 errCount = 0
a93eea6699 Jean* 0030
ffe464dc7d Mart* 0031 WRITE (msgBuf ,'(A)' ) 'SHELFICE_CHECK: #define ALLOW_SHELFICE'
0032 CALL PRINT_MESSAGE ( msgBuf , standardMessageUnit ,
a93eea6699 Jean* 0033 & SQUEEZE_RIGHT , myThid )
ffe464dc7d Mart* 0034
cbbed5656a Mart* 0035
0036 WRITE (msgBuf ,'(A)' ) ' '
0037 CALL PRINT_MESSAGE ( msgBuf , standardMessageUnit ,
0038 & SQUEEZE_RIGHT , myThid )
918d8a2ea2 Jean* 0039 WRITE (msgBuf ,'(A)' )
cbbed5656a Mart* 0040 & 'SHELFICE_CHECK: start of SHELFICE config. summary'
0041 CALL PRINT_MESSAGE ( msgBuf , standardMessageUnit ,
0042 & SQUEEZE_RIGHT , myThid )
918d8a2ea2 Jean* 0043
cbbed5656a Mart* 0044 CALL WRITE_0D_L ( SHELFICEisOn , INDEX_NONE ,
0045 & 'SHELFICEisOn =' , ' /* package is turned on */' )
918d8a2ea2 Jean* 0046
cbbed5656a Mart* 0047 CALL WRITE_0D_L ( useISOMIPTD , INDEX_NONE ,
0048 & 'useISOMIPTD =' , ' /* use simple isomip thermodynamics */' )
0049 CALL WRITE_0D_L ( SHELFICEconserve , INDEX_NONE ,
918d8a2ea2 Jean* 0050 & 'SHELFICEconserve =' ,
cbbed5656a Mart* 0051 & ' /* use a conservative form of boundary conditions */' )
0052 CALL WRITE_0D_L ( SHELFICEboundaryLayer , INDEX_NONE ,
0053 & 'SHELFICEboundaryLayer =' ,
0054 & ' /* use simple boundary layer scheme to suppress noise */' )
9952f046d7 dngo* 0055 IF ( SHELFICEboundaryLayer ) THEN
0056 CALL WRITE_0D_L ( SHI_withBL_realFWflux , INDEX_NONE ,
0057 & 'SHI_withBL_realFWflux =' ,
0058 & ' /* use real FW Flux in boundary layer scheme */' )
0059 ENDIF
cbbed5656a Mart* 0060 CALL WRITE_0D_L ( SHELFICEadvDiffHeatFlux , INDEX_NONE ,
918d8a2ea2 Jean* 0061 & 'SHELFICEadvDiffHeatFlux =' ,
cbbed5656a Mart* 0062 & ' /* use adv.-diff. instead of just diff. heat flux into' //
0063 & ' the ice shelf */' )
0064 CALL WRITE_0D_L ( SHELFICEMassStepping , INDEX_NONE ,
0065 & 'SHELFICEMassStepping =' ,
0066 & ' /* step forward ice shelf mass/thickness */' )
005af54e38 Jean* 0067 CALL WRITE_0D_L ( SHI_update_kTopC , INDEX_NONE ,
0068 & 'SHI_update_kTopC =' ,
0069 & ' /* update "kTopC" as ice shelf expand or retreat */' )
cbbed5656a Mart* 0070 CALL WRITE_0D_L ( no_slip_shelfice , INDEX_NONE ,
0071 & 'no_slip_shelfice =' , ' /* use no slip boundary conditions */' )
0072 CALL WRITE_0D_RL ( SHELFICEdragLinear , INDEX_NONE ,
0073 & 'SHELFICEdragLinear =' , ' /* linear drag coefficient */' )
0074 CALL WRITE_0D_RL ( SHELFICEdragQuadratic , INDEX_NONE ,
0075 & 'SHELFICEdragQuadratic =' , ' /* quadratic drag coefficient */' )
918d8a2ea2 Jean* 0076 CALL WRITE_0D_I ( SHELFICEselectDragQuadr , INDEX_NONE ,
0077 & 'SHELFICEselectDragQuadr =' ,
0078 & ' /* select quadratic drag option */' )
cbbed5656a Mart* 0079 CALL WRITE_0D_RL ( SHELFICElatentHeat , INDEX_NONE ,
0080 & 'SHELFICElatentHeat =' , ' /* latent heat of ice */' )
0081 CALL WRITE_0D_RL ( SHELFICEheatCapacity_Cp , INDEX_NONE ,
0082 & 'SHELFICEheatCapacity_Cp =' , ' /* heat capacity of ice shelf */' )
0083 CALL WRITE_0D_RL ( rhoShelfice , INDEX_NONE ,
0084 & 'rhoShelfice =' , ' /* density of ice shelf */' )
0085 CALL WRITE_0D_RL ( SHELFICEkappa , INDEX_NONE ,
0086 & 'SHELFICEkappa =' , ' /* thermal conductivity of ice shelf */' )
0087 CALL WRITE_0D_RL ( SHELFICEthetaSurface , INDEX_NONE ,
0088 & 'SHELFICEthetaSurface =' ,' /* surface temperature above i.s. */' )
0089 CALL WRITE_0D_RL ( SHELFICEheatTransCoeff , INDEX_NONE ,
0090 & 'SHELFICEheatTransCoeff =' , ' /* heat transfer coefficient */' )
0091 CALL WRITE_0D_RL ( SHELFICEsaltTransCoeff , INDEX_NONE ,
0092 & 'SHELFICEsaltTransCoeff =' , ' /* salt transfer coefficient */' )
918d8a2ea2 Jean* 0093
cbbed5656a Mart* 0094 CALL WRITE_0D_L ( SHELFICEuseGammaFrict , INDEX_NONE ,
918d8a2ea2 Jean* 0095 & 'SHELFICEuseGammaFrict =' ,
cbbed5656a Mart* 0096 & ' /* use velocity dependent exchange coefficients */' )
0097 IF ( SHELFICEuseGammaFrict ) THEN
9952f046d7 dngo* 0098 IF ( SHELFICEboundaryLayer ) THEN
0099 CALL WRITE_0D_L ( SHI_withBL_uStarTopDz , INDEX_NONE ,
0100 & 'SHI_withBL_uStarTopDz =' ,
0101 & ' /* compute uStar from top Dz averaged uVel,vVel */' )
0102 ELSE
0103 CALL WRITE_0D_L ( SHELFICE_oldCalcUStar , INDEX_NONE ,
b06dffee6b Jean* 0104 & 'SHELFICE_oldCalcUStar =' , ' /* use old uStar expression */' )
9952f046d7 dngo* 0105 ENDIF
cbbed5656a Mart* 0106 CALL WRITE_0D_RL ( shiCdrag , INDEX_NONE ,
0107 & 'shiCdrag =' , ' /* quadr. drag coefficient for uStar */' )
0108 CALL WRITE_0D_RL ( shiZetaN , INDEX_NONE ,
0109 & 'shiZetaN =' , ' /* parameter for gammaTurb */' )
0110 CALL WRITE_0D_RL ( shiRc , INDEX_NONE ,
0111 & 'shiRc =' , ' /* parameter for gammaTurb (not used) */' )
0112 CALL WRITE_0D_RL ( shiPrandtl , INDEX_NONE ,
0113 & 'shiPrandtl =' , ' /* const. Prandtl No. for gammaTurb */' )
0114 CALL WRITE_0D_RL ( shiSchmidt , INDEX_NONE ,
0115 & 'shiSchmidt =' , ' /* const. Schmidt No. for gammaTurb */' )
0116 CALL WRITE_0D_RL ( shiKinVisc , INDEX_NONE ,
0117 & 'shiKinVisc =' , ' /* const. kin. viscosity for gammaTurb */' )
0118 ENDIF
918d8a2ea2 Jean* 0119
9952f046d7 dngo* 0120 CALL WRITE_0D_RL ( SHELFICEremeshFrequency , INDEX_NONE ,
0121 & 'SHELFICEremeshFrequency =' ,
0122 & ' /* Frequency (in s) of Remeshing */' )
0123 IF ( SHELFICEremeshFrequency .GT. zeroRL ) THEN
0124 CALL WRITE_0D_RL ( SHELFICEsplitThreshold , INDEX_NONE ,
0125 & 'SHELFICEsplitThreshold =' ,
0126 & ' /* hFac remesh threshold above which cell splits */' )
0127 CALL WRITE_0D_RL ( SHELFICEmergeThreshold , INDEX_NONE ,
0128 & 'SHELFICEmergeThreshold =' ,
0129 & ' /* hFac remesh threshold below which cell merges */' )
0130 ENDIF
0131
918d8a2ea2 Jean* 0132 CALL WRITE_0D_C ( SHELFICEloadAnomalyFile , -1, INDEX_NONE ,
cbbed5656a Mart* 0133 & 'SHELFICEloadAnomalyFile =' ,
0134 & ' /* file name of loaded loadAnomaly field */' )
918d8a2ea2 Jean* 0135 CALL WRITE_0D_C ( SHELFICEmassFile , -1, INDEX_NONE ,
cbbed5656a Mart* 0136 & 'SHELFICEmassFile =' , ' /* file name of loaded mass field */' )
918d8a2ea2 Jean* 0137 CALL WRITE_0D_C ( SHELFICEtopoFile , -1, INDEX_NONE ,
cbbed5656a Mart* 0138 & 'SHELFICEtopoFile =' ,
0139 & ' /* file name of loaded under-ice topography */' )
918d8a2ea2 Jean* 0140 CALL WRITE_0D_C ( SHELFICEMassDynTendFile , -1, INDEX_NONE ,
cbbed5656a Mart* 0141 & 'SHELFICEMassDynTendFile =' ,
0142 & ' /* file name of loaded dynamic mass tendency field */' )
918d8a2ea2 Jean* 0143
0144 CALL WRITE_0D_L ( SHELFICEwriteState , INDEX_NONE ,
0145 & 'SHELFICEwriteState =' , ' /* do simple standard output */' )
0146 CALL WRITE_0D_L ( SHELFICE_dump_mdsio , INDEX_NONE ,
0147 & 'SHELFICE_dump_mdsio =' , ' /* use mdsio for snapshots */' )
0148 CALL WRITE_0D_L ( SHELFICE_tave_mdsio , INDEX_NONE ,
0149 & 'SHELFICE_tave_mdsio =' , ' /* use mdsio for time averages */' )
0150 CALL WRITE_0D_L ( SHELFICE_dump_mnc , INDEX_NONE ,
0151 & 'SHELFICE_dump_mnc =' , ' /* use netcdf for snapshots */' )
0152 CALL WRITE_0D_L ( SHELFICE_tave_mnc , INDEX_NONE ,
0153 & 'SHELFICE_tave_mnc =' , ' /* use netcdf for time averages */' )
0154 CALL WRITE_0D_RL ( SHELFICE_dumpFreq , INDEX_NONE ,
0155 & 'SHELFICE_dumpFreq =' , ' /* analoguous to dumpFreq */' )
0156 CALL WRITE_0D_RL ( SHELFICE_taveFreq , INDEX_NONE ,
0157 & 'SHELFICE_taveFreq =' , ' /* analoguous to taveFreq */' )
0158
0159 WRITE (msgBuf ,'(A)' )
cbbed5656a Mart* 0160 & 'SHELFICE_CHECK: end of SHELFICE config. summary'
0161 CALL PRINT_MESSAGE ( msgBuf , standardMessageUnit ,
0162 & SQUEEZE_RIGHT , myThid )
0163
9952f046d7 dngo* 0164
0165 #ifndef ALLOW_ISOMIP_TD
0166 IF ( useISOMIPTD ) THEN
0167 WRITE (msgBuf ,'(A,A,A)' )
0168 & 'Run-time control flag useISOMIPTD was used'
0169 CALL PRINT_ERROR ( msgBuf , myThid )
0170 WRITE (msgBuf ,'(A,A,A)' )
0171 & 'when CPP flag ALLOW_ISOMIP_TD was unset'
0172 CALL PRINT_ERROR ( msgBuf , myThid )
0173 errCount = errCount + 1
0174 ENDIF
0175 #else
0176 IF ( useISOMIPTD ) THEN
0177 IF ( SHELFICEconserve ) THEN
0178 WRITE (msgBuf ,'(A,A,A)' )
0179 & 'Run-time control flag SHELFICEconserve=.TRUE. was used'
0180 CALL PRINT_ERROR ( msgBuf , myThid )
0181 WRITE (msgBuf ,'(A,A,A)' )
0182 & 'when useISOMIPTD=.TRUE.; this does not work!'
0183 CALL PRINT_ERROR ( msgBuf , myThid )
0184 errCount = errCount + 1
0185 ENDIF
0186 ENDIF
0187 #endif /* ALLOW_ISOMIP_TD */
0188
0189 #ifndef SHI_ALLOW_GAMMAFRICT
0190 IF ( SHELFICEuseGammaFrict ) THEN
0191 WRITE (msgBuf ,'(A,A,A)' )
0192 & 'Run-time control flag SHELFICEuseGammaFrict was used'
0193 CALL PRINT_ERROR ( msgBuf , myThid )
0194 WRITE (msgBuf ,'(A,A,A)' )
0195 & 'when CPP flag SHI_ALLOW_GAMMAFRICT was unset'
0196 CALL PRINT_ERROR ( msgBuf , myThid )
0197 errCount = errCount + 1
0198 ENDIF
0199 #endif /* SHI_ALLOW_GAMMAFRICT */
0200
0201 #ifndef ALLOW_SHELFICE_REMESHING
005af54e38 Jean* 0202 IF ( SHI_update_kTopC ) THEN
0203 WRITE (msgBuf ,'(2A)' ) 'SHELFICE_CHECK: ' ,
0204 & 'SHI_update_kTopC only available with'
0205 CALL PRINT_ERROR ( msgBuf , myThid )
0206 WRITE (msgBuf ,'(2A)' ) 'SHELFICE_CHECK: ' ,
0207 & 'CPP option ALLOW_SHELFICE_REMESHING defined'
0208 CALL PRINT_ERROR ( msgBuf , myThid )
0209 errCount = errCount + 1
0210 ENDIF
9952f046d7 dngo* 0211 IF ( SHELFICEremeshFrequency .GT. zeroRL ) THEN
0212 WRITE (msgBuf ,'(A,A,A)' )
0213 & 'Run-time SHELFICEremeshFrequency was set ( > 0 )'
0214 CALL PRINT_ERROR ( msgBuf , myThid )
0215 WRITE (msgBuf ,'(A,A,A)' )
0216 & 'when CPP flag ALLOW_SHELFICE_REMESHING is unset'
0217 CALL PRINT_ERROR ( msgBuf , myThid )
0218 errCount = errCount + 1
0219 ENDIF
0220 #endif /* ALLOW_SHELFICE_REMESHING */
0221
9c84481760 Jean* 0222
9952f046d7 dngo* 0223
9c84481760 Jean* 0224 IF ( SHELFICEmassFile .NE. ' ' .AND. SHELFICEloadAnomalyFile .NE. ' '
0225 & ) THEN
0226 WRITE (msgBuf ,'(2A)' ) 'SHELFICE_CHECK: cannot specify both' ,
0227 & ' SHELFICEmassFile and SHELFICEloadAnomalyFile'
0228 CALL PRINT_ERROR ( msgBuf , myThid )
0229 errCount = errCount + 1
0230 ENDIF
005af54e38 Jean* 0231 IF ( SHELFICEMassStepping .AND. SHELFICEmassFile .EQ. ' '
0232 & .AND. SHELFICEloadAnomalyFile .NE. ' ' ) THEN
0233 WRITE (msgBuf ,'(2A)' ) '** Warning ** SHELFICE_CHECK: ' ,
0234 & 'safer to set initial Mass when using SHELFICEMassStepping'
0235 CALL PRINT_MESSAGE ( msgBuf , errorMessageUnit ,
0236 & SQUEEZE_RIGHT , myThid )
0237 ENDIF
9c84481760 Jean* 0238
ffe464dc7d Mart* 0239
0240 IF ( buoyancyRelation .NE. 'OCEANIC' ) THEN
0241 WRITE (msgBuf ,'(A)' )
0242 & 'SHELFICE works only with buoyancyRelation = ' 'OCEANIC' ''
a93eea6699 Jean* 0243 CALL PRINT_ERROR ( msgBuf , myThid )
9c84481760 Jean* 0244 errCount = errCount + 1
ffe464dc7d Mart* 0245 ENDIF
0246
61e8fddf13 Jean* 0247 IF ( selectNHfreeSurf .NE. 0 ) THEN
0248
0249
0250
0251
0252
0253
0254
0255 WRITE (msgBuf ,'(2A,I3,A)' ) 'Current nonHydrostatic' ,
0256 & ' Free-Surf option (selectNHfreeSurf=' ,selectNHfreeSurf ,' )'
0257 CALL PRINT_ERROR ( msgBuf , myThid )
0258 WRITE (msgBuf ,'(A)' ) ' not compatible with SHELFICE code'
0259 CALL PRINT_ERROR ( msgBuf , myThid )
9c84481760 Jean* 0260 errCount = errCount + 1
61e8fddf13 Jean* 0261 ENDIF
6247293a5a Mart* 0262
9952f046d7 dngo* 0263 IF ( SHELFICEremeshFrequency .GT. zeroRL ) THEN
0264 IF ( nonlinFreeSurf .LE. 0 ) THEN
0265 WRITE (msgBuf ,'(A,A,A)' )
0266 & 'remeshing requires Non-Lin Free-Surf (nonlinFreeSurf > 0)'
0267 CALL PRINT_ERROR ( msgBuf , myThid )
0268 errCount = errCount + 1
0269 ELSEIF ( select_rStar .GT. 0 ) THEN
0270 WRITE (msgBuf ,'(A,A,A)' )
0271 & 'remeshing not implemented for r-Star coordinate ' ,
0272 & '(select_rStar > 0)'
0273 CALL PRINT_ERROR ( msgBuf , myThid )
0274 errCount = errCount + 1
0275 ENDIF
0276 ENDIF
005af54e38 Jean* 0277 IF ( SHI_update_kTopC .AND. nonlinFreeSurf .LE. 0 ) THEN
0278 WRITE (msgBuf ,'(2A)' ) '** WARNING ** SHELFICE_CHECK: ' ,
0279 & 'linear Free-Surf not consistent with SHI_update_kTopC'
0280 CALL PRINT_MESSAGE ( msgBuf , errorMessageUnit ,
0281 & SQUEEZE_RIGHT , myThid )
0282 ENDIF
9952f046d7 dngo* 0283
61e8fddf13 Jean* 0284
b98ed2a71d Mart* 0285
0286
61e8fddf13 Jean* 0287
b98ed2a71d Mart* 0288
ffe464dc7d Mart* 0289
0290
0291
0292
9c84481760 Jean* 0293
ffe464dc7d Mart* 0294
b940763644 Patr* 0295
005af54e38 Jean* 0296 IF ( SHI_update_kTopC .AND. useSEAICE ) THEN
0297 WRITE (msgBuf ,'(2A)' ) 'SHELFICE_CHECK: ' ,
c96d63ff5a Jean* 0298 & 'pkg/seaice IGNORES Ice-Shelf retreat/advance'
005af54e38 Jean* 0299 CALL PRINT_ERROR ( msgBuf , myThid )
0300 WRITE (msgBuf ,'(2A)' ) 'SHELFICE_CHECK: ' ,
0301 & ' and does not work with SHI_update_kTopC=T'
0302 CALL PRINT_ERROR ( msgBuf , myThid )
0303 errCount = errCount + 1
c96d63ff5a Jean* 0304 ENDIF
0305
3bafcf6020 Timo* 0306
0307
0308 #ifdef ALLOW_OPENAD
0309 IF (SHELFICEMassStepping ) THEN
0310 WRITE (msgBuf ,'(2A)' )
0311 & 'SHELFICEMassStepping does not currently work' ,
0312 & ' with #define ALLOW_OPENAD'
0313 CALL PRINT_ERROR ( msgBuf , myThid )
0314 errCount = errCount + 1
0315 ENDIF
0316 #endif
9c84481760 Jean* 0317 IF ( errCount .GE. 1 ) THEN
0318 WRITE (msgBuf ,'(A,I3,A)' )
0319 & 'SHELFICE_CHECK: detected' , errCount ,' fatal error(s)'
0320 CALL PRINT_ERROR ( msgBuf , myThid )
0321 CALL ALL_PROC_DIE ( 0 )
0322 STOP 'ABNORMAL END: S/R SHELFICE_CHECK'
0323 ENDIF
0324
a93eea6699 Jean* 0325 _END_MASTER (myThid )
0326
ffe464dc7d Mart* 0327 #endif /* ALLOW_SHELFICE */
0328
a93eea6699 Jean* 0329 RETURN
0330 END