File indexing completed on 2024-02-29 06:10:25 UTC
view on githubraw file Latest commit a4576c7c on 2024-02-28 22:55:11 UTC
2a09713997 Patr*0001 #include "GMREDI_OPTIONS.h"
f5509be190 Mart*0002 #ifdef ALLOW_CTRL
0003 # include "CTRL_OPTIONS.h"
0004 #endif
2a09713997 Patr*0005
f7ab21c55e Jean*0006
0007
0008
2a09713997 Patr*0009 SUBROUTINE GMREDI_READPARMS( myThid )
f7ab21c55e Jean*0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
2a09713997 Patr*0021 IMPLICIT NONE
0022
0023
0024 #include "SIZE.h"
0025 #include "EEPARAMS.h"
0026 #include "PARAMS.h"
0027 #include "GRID.h"
0028 #include "GMREDI.h"
0029
f7ab21c55e Jean*0030
2a09713997 Patr*0031
0032 INTEGER myThid
0033
0034 #ifdef ALLOW_GMREDI
f7ab21c55e Jean*0035
0036
f6de204bec Jean*0037
0038
94a8024bbe Jean*0039
0040
0041
f7ab21c55e Jean*0042 CHARACTER*(MAX_LEN_MBUF) msgBuf
0043 INTEGER iUnit
94a8024bbe Jean*0044 INTEGER nRetired
0045 CHARACTER*(MAX_LEN_FNAM) GM_isopycK3dFile
0046 CHARACTER*(MAX_LEN_FNAM) GM_background_K3dFile
f7ab21c55e Jean*0047
2a09713997 Patr*0048
0049
f6de204bec Jean*0050
9b8b001637 Jean*0051
2a09713997 Patr*0052 NAMELIST /GM_PARM01/
ed71a1a16f Jean*0053 & GM_AdvForm, GM_AdvSeparate,
43af9695da Gael*0054 & GM_InMomAsStress,
f42e64b3e7 Jean*0055 & GM_isopycK,
9b8b001637 Jean*0056 & GM_background_K,
f6de204bec Jean*0057 & GM_iso2dFile, GM_iso1dFile,
0058 & GM_bol2dFile, GM_bol1dFile,
94a8024bbe Jean*0059 & GM_K3dRediFile, GM_K3dGMFile,
0060 & GM_background_K3dFile, GM_isopycK3dFile,
2a09713997 Patr*0061 & GM_taper_scheme,
0062 & GM_maxSlope,
f42e64b3e7 Jean*0063 & GM_Kmin_horiz,
bd3f833a36 Jean*0064 & GM_Small_Number, GM_slopeSqCutoff,
05118ac017 Jean*0065 & GM_Scrit, GM_Sd,
f5509be190 Mart*0066 & GM_isoFac_calcK,
05118ac017 Jean*0067 & GM_facTrL2dz, GM_facTrL2ML, GM_maxTransLay,
0068 & GM_UseBVP, GM_BVP_cMin, GM_BVP_ModeNumber,
0069 & GM_useSubMeso, subMeso_Ceff, subMeso_invTau,
0070 & subMeso_LfMin, subMeso_Lmax,
a8da45f13c Jean*0071 & GM_Visbeck_alpha, GM_Visbeck_length,
2a09713997 Patr*0072 & GM_Visbeck_depth,
a8da45f13c Jean*0073 & GM_Visbeck_minDepth, GM_Visbeck_maxSlope,
0074 & GM_Visbeck_minVal_K, GM_Visbeck_maxVal_K,
05118ac017 Jean*0075 & GM_useBatesK3d, GM_Bates_smooth, GM_Bates_use_constK,
0076 & GM_Bates_beta_eq_0, GM_Bates_ThickSheet,
0077 & GM_Bates_surfK, GM_Bates_constRedi,
0078 & GM_Bates_gamma, GM_Bates_b1,
0079 & GM_Bates_EadyMinDepth, GM_Bates_EadyMaxDepth,
0080 & GM_Bates_Lambda, GM_Bates_smallK, GM_Bates_maxK,
0081 & GM_Bates_constK, GM_Bates_maxC,
0082 & GM_Bates_Rmax, GM_Bates_Rmin,
0083 & GM_Bates_minCori, GM_Bates_minN2,
0084 & GM_Bates_surfMinDepth, GM_Bates_vecFreq,
0085 & GM_Bates_minRenorm, GM_Bates_maxRenorm,
0086 & GM_useLeithQG,
a4576c7cde Juli*0087 & GM_useGEOM,
0088 & GEOM_lmbda, GEOM_alpha,
0089 & GEOM_ini_EKE, GEOM_diffKh_EKE,
0090 & GEOM_vert_struc,
0091 & GEOM_vert_struc_min, GEOM_vert_struc_max,
0092 & GEOM_minval_K, GEOM_maxval_K,
05118ac017 Jean*0093 & GM_MNC
2a09713997 Patr*0094
ae4c29e0db Jean*0095
0096
0097 IF ( .NOT.useGMRedi ) THEN
0098
0099 _BEGIN_MASTER(myThid)
0100
0101
0102 CALL PACKAGES_UNUSED_MSG( 'useGMRedi', ' ', ' ' )
0103 _END_MASTER(myThid)
0104 RETURN
0105 ENDIF
0106
9b8b001637 Jean*0107 _BEGIN_MASTER(myThid)
0108
2a09713997 Patr*0109
f42e64b3e7 Jean*0110 GM_AdvForm = .FALSE.
ed71a1a16f Jean*0111 GM_AdvSeparate = .FALSE.
43af9695da Gael*0112 GM_InMomAsStress = .FALSE.
f42e64b3e7 Jean*0113 GM_isopycK = -999.
f7ab21c55e Jean*0114 GM_background_K = 0. _d 0
a8da45f13c Jean*0115 GM_maxSlope = 1. _d -2
f7ab21c55e Jean*0116 GM_Kmin_horiz = 0. _d 0
37d7346fe2 Jean*0117 GM_Small_Number = 1. _d -20
e2d47178e0 Ed H*0118 GM_slopeSqCutoff = 1. _d +48
2a09713997 Patr*0119 GM_taper_scheme = ' '
86e2f7bc1f Jean*0120 GM_facTrL2dz = 1.
0121 GM_facTrL2ML = 5.
0122 GM_maxTransLay = 500.
f7ab21c55e Jean*0123 GM_Scrit = 0.004 _d 0
0124 GM_Sd = 0.001 _d 0
f5509be190 Mart*0125 GM_isoFac_calcK = 1. _d 0
e2d47178e0 Ed H*0126 GM_MNC = useMNC
f6de204bec Jean*0127 GM_iso2dFile = ' '
0128 GM_iso1dFile = ' '
0129 GM_bol2dFile = ' '
0130 GM_bol1dFile = ' '
94a8024bbe Jean*0131 GM_K3dRediFile = ' '
0132 GM_K3dGMFile = ' '
f59d76b0dd Ed D*0133 GM_useLeithQG = .FALSE.
9b8b001637 Jean*0134
2a09713997 Patr*0135
e2d47178e0 Ed H*0136
0137
2a09713997 Patr*0138
d0035fac68 Jean*0139
0140 GM_UseBVP = .FALSE.
0141 GM_BVP_ModeNumber = 1
0142 GM_BVP_cMin = 1. _d -1
0143
050b4366e6 Jean*0144
0145 GM_useSubMeso = .FALSE.
0146 subMeso_invTau = 2.0 _d -6
0147 subMeso_LfMin = 1.0 _d +3
0148 subMeso_Ceff = 7.0 _d -2
0149 subMeso_Lmax = 110. _d +3
d0035fac68 Jean*0150
05118ac017 Jean*0151
0152 GM_Visbeck_alpha = 0. _d 0
0153 GM_Visbeck_length = 200. _d 3
0154 GM_Visbeck_depth = 1000. _d 0
0155 GM_Visbeck_minDepth = 0. _d 0
0156 GM_Visbeck_maxSlope = UNSET_RL
0157 GM_Visbeck_minVal_K = 0. _d 0
0158 GM_Visbeck_maxVal_K = 2500. _d 0
0159
a4576c7cde Juli*0160
0161 GM_useGEOM = .FALSE.
0162 GEOM_lmbda = 2. _d -7
0163 GEOM_alpha = 0. _d 0
0164 GEOM_ini_EKE = 1. _d -3
0165 GEOM_diffKh_EKE = 1. _d +3
0166 GEOM_vert_struc = .FALSE.
0167 GEOM_vert_struc_min = 1. _d -1
0168 GEOM_vert_struc_max = 1. _d 0
0169 GEOM_minVal_K = 0. _d 0
0170 GEOM_maxVal_K = 2500. _d 0
0171
05118ac017 Jean*0172
0173 GM_useBatesK3d = .FALSE.
0174 GM_Bates_smooth = .TRUE.
0175 GM_Bates_use_constK= .FALSE.
0176 GM_Bates_beta_eq_0 = .TRUE.
0177 GM_Bates_ThickSheet= .FALSE.
0178 GM_Bates_surfK = .FALSE.
0179 GM_Bates_constRedi = .FALSE.
0180 GM_Bates_gamma = 1.0
0181 GM_Bates_b1 = 4.0
0182 GM_Bates_EadyMinDepth = 50.0
4578baf364 Jean*0183 GM_Bates_EadyMaxDepth = 1000.
05118ac017 Jean*0184 GM_Bates_Lambda = 1.0
4578baf364 Jean*0185 GM_Bates_smallK = 100.
0186 GM_Bates_maxK = 20. _d 3
0187 GM_Bates_constK = 1000.
0188 GM_Bates_maxC = 0.15 _d 0
0189 GM_Bates_Rmax = 75. _d 3
0190 GM_Bates_Rmin = 30. _d 3
05118ac017 Jean*0191 GM_Bates_minCori = zeroRL
4578baf364 Jean*0192 GM_Bates_minN2 = 1. _d -8
0193 GM_Bates_surfMinDepth = 100.
0194 GM_Bates_vecFreq = 2592000.
05118ac017 Jean*0195 GM_Bates_minRenorm = oneRL
4578baf364 Jean*0196 GM_Bates_maxRenorm = 20.
ae4c29e0db Jean*0197
94a8024bbe Jean*0198
0199 nRetired = 0
0200 GM_background_K3dFile = ' '
0201 GM_isopycK3dFile = ' '
0202
e2d47178e0 Ed H*0203 WRITE(msgBuf,'(A)') ' GM_READPARMS: opening data.gmredi'
0204 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0205 & SQUEEZE_RIGHT , 1)
0206 CALL OPEN_COPY_DATA_FILE(
0207 I 'data.gmredi', 'GM_READPARMS',
0208 O iUnit,
0209 I myThid )
2a09713997 Patr*0210
e2d47178e0 Ed H*0211
0212 READ(UNIT=iUnit,NML=GM_PARM01)
b8a35fd4d2 Jean*0213 WRITE(msgBuf,'(A)') ' GM_READPARMS: finished reading data.gmredi'
0214 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0215 & SQUEEZE_RIGHT , 1)
e2d47178e0 Ed H*0216
7a77863887 Mart*0217 #ifdef SINGLE_DISK_IO
b8a35fd4d2 Jean*0218 CLOSE(iUnit)
7a77863887 Mart*0219 #else
0220 CLOSE(iUnit,STATUS='DELETE')
0221 #endif /* SINGLE_DISK_IO */
b8a35fd4d2 Jean*0222
f42e64b3e7 Jean*0223
0224 IF (GM_isopycK.EQ.-999.) GM_isopycK = GM_background_K
0225
a8da45f13c Jean*0226
0227 IF ( GM_Visbeck_maxSlope .EQ. UNSET_RL )
0228 & GM_Visbeck_maxSlope = GM_maxSlope
0229
2a09713997 Patr*0230
f5509be190 Mart*0231 GM_rMaxSlope = 0. _d 0
0232 IF (GM_maxSlope.NE.zeroRL) GM_rMaxSlope = 1. _d 0 / GM_maxSlope
0233
0234
0235 IF ( GM_useLeithQG .AND. viscC2LeithQG.EQ.zeroRL ) THEN
0236 WRITE(msgBuf,'(2A,I3)') '** WARNING ** GMREDI_READPARMS: ',
0237 & 'switch OFF GM_useLeithQG since viscC2LeithQG = 0'
0238 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0239 & SQUEEZE_RIGHT, myThid )
0240 GM_useLeithQG = .FALSE.
0241 ENDIF
2a09713997 Patr*0242
f5509be190 Mart*0243 IF ( GM_AdvForm ) THEN
0244 GM_skewflx = 0. _d 0
0245 IF ( GM_K3dRediFile .NE. ' ' ) THEN
0246 GM_ExtraDiag = .TRUE.
0247 ELSE
0248 GM_ExtraDiag = GM_isopycK.NE.zeroRL
0249 ENDIF
0250 #ifdef ALLOW_KAPREDI_CONTROL
0251 IF ( useCTRL ) GM_ExtraDiag = .TRUE.
0252 #endif
f42e64b3e7 Jean*0253 ELSE
f5509be190 Mart*0254 GM_skewflx = 1. _d 0
0255 IF ( GM_K3dRediFile .NE. ' ' .OR.
0256 & GM_K3dGMFile .NE. ' ' ) THEN
0257 GM_ExtraDiag = GM_K3dRediFile .NE. GM_K3dGMFile
0258 ELSEIF ( GM_iso2dFile .NE. GM_bol2dFile .OR.
0259 & GM_iso1dFile .NE. GM_bol1dFile ) THEN
0260 GM_ExtraDiag = .TRUE.
0261 ELSE
0262 GM_ExtraDiag = GM_isopycK.NE.GM_background_K
0263 ENDIF
0264 #if (defined ALLOW_KAPREDI_CONTROL || defined ALLOW_KAPGM_CONTROL )
0265 IF ( useCTRL ) GM_ExtraDiag = .TRUE.
0266 #endif
a4576c7cde Juli*0267 GM_ExtraDiag = GM_ExtraDiag .OR. GM_useGEOM
f42e64b3e7 Jean*0268 ENDIF
f5509be190 Mart*0269 IF ( GM_isoFac_calcK .NE. GM_skewflx .AND.
0270 & ( GM_Visbeck_alpha.NE.zeroRL .OR.
0271 & GM_useBatesK3d .OR. GM_useLeithQG ) ) THEN
f6de204bec Jean*0272 GM_ExtraDiag = .TRUE.
0273 ENDIF
f42e64b3e7 Jean*0274
d0035fac68 Jean*0275 IF (GM_UseBVP) THEN
0276 GM_BVP_rModeNumber = 1. _d 0/DBLE(GM_BVP_ModeNumber)
0277 GM_BVP_cHat2Min = GM_BVP_cMin**2*rhoConst/gravity
0278 ENDIF
0279
e2d47178e0 Ed H*0280
0281 GM_MNC = GM_MNC .AND. useMNC
0282 #ifndef ALLOW_MNC
0283
0284 GM_MNC = .FALSE.
0285 #endif
0286 GM_MDSIO = (.NOT. GM_MNC) .OR. outputTypesInclusive
0287
94a8024bbe Jean*0288
0289 IF ( GM_background_K3dFile .NE. ' ' ) THEN
0290 nRetired = nRetired+1
0291 WRITE(msgBuf,'(2A)') 'S/R GMREDI_READPARMS: ',
0292 & '"GM_background_K3dFile" has been replaced by "GM_K3dGMFile"'
0293 CALL PRINT_ERROR( msgBuf, myThid )
0294 WRITE(msgBuf,'(2A)') 'S/R GMREDI_READPARMS: ',
0295 & 'and is no longer allowed in file "data.gmredi"'
0296 CALL PRINT_ERROR( msgBuf, myThid )
0297 ENDIF
0298 IF ( GM_isopycK3dFile .NE. ' ' ) THEN
0299 nRetired = nRetired+1
0300 WRITE(msgBuf,'(2A)') 'S/R GMREDI_READPARMS: ',
0301 & '"GM_isopycK3dFile" has been replaced by "GM_K3dRediFile"'
0302 CALL PRINT_ERROR( msgBuf, myThid )
0303 WRITE(msgBuf,'(2A)') 'S/R GMREDI_READPARMS: ',
0304 & 'and is no longer allowed in file "data.gmredi"'
0305 CALL PRINT_ERROR( msgBuf, myThid )
0306 ENDIF
0307
0308 IF ( nRetired .GT. 0 ) THEN
0309 WRITE(msgBuf,'(2A)') 'S/R GMREDI_READPARMS: ',
0310 & 'Error reading parameter file "data.gmredi":'
0311 CALL PRINT_ERROR( msgBuf, myThid )
0312 WRITE(msgBuf,'(I4,A)') nRetired,
0313 & ' out of date parameters were found in the namelist'
0314 CALL PRINT_ERROR( msgBuf, myThid )
0315 CALL ALL_PROC_DIE( 0 )
0316 STOP 'ABNORMAL END: S/R GMREDI_READPARMS'
0317 ENDIF
0318
2a09713997 Patr*0319 _END_MASTER(myThid)
0320
0321
0322 _BARRIER
0323
0324 #endif /* ALLOW_GMREDI */
0325
f42e64b3e7 Jean*0326 RETURN
0327 END