@@ -130,7 +130,7 @@ module MOM_lateral_mixing_coeffs
130
130
real , allocatable :: kdgl90_struct(:,:,:) ! < Vertical structure function used in GL90 diffusivity [nondim]
131
131
real :: BS_EBT_power ! < Power to raise EBT vertical structure to. Default 0.0.
132
132
real :: sqg_expo ! < Exponent for SQG vertical structure [nondim]. Default 0.0
133
- logical :: BS_use_sqg ! < If true, use sqg_stuct for backscatter vertical structure.
133
+ logical :: BS_use_sqg_struct ! < If true, use sqg_stuct for backscatter vertical structure.
134
134
135
135
136
136
real ALLOCABLE_, dimension (NIMEMB_PTR_,NJMEM_) :: &
@@ -282,31 +282,23 @@ subroutine calc_resoln_function(h, tv, G, GV, US, CS, MEKE, dt)
282
282
call create_group_pass(CS% pass_cg1, CS% cg1, G% Domain)
283
283
call do_group_pass(CS% pass_cg1, G% Domain)
284
284
endif
285
- if (CS% BS_use_sqg .or. CS% khth_use_sqg_struct .or. CS% khtr_use_sqg_struct &
285
+ if (CS% BS_use_sqg_struct .or. CS% khth_use_sqg_struct .or. CS% khtr_use_sqg_struct &
286
286
.or. CS% kdgl90_use_sqg_struct .or. CS% id_sqg_struct> 0 ) then
287
287
call calc_sqg_struct(h, tv, G, GV, US, CS, dt, MEKE)
288
288
call pass_var(CS% sqg_struct, G% Domain)
289
289
endif
290
290
291
- if (CS% BS_EBT_power> 0 . .and. CS% BS_use_sqg) then
292
- call MOM_error(FATAL, &
293
- " calc_resoln_function: BS_EBT_POWER>0. &
294
- and BS_USE_SQG=True cannot be set together" )
295
- elseif (CS% BS_EBT_power> 0 .) then
291
+ if (CS% BS_EBT_power> 0 .) then
296
292
do k= 1 ,nz ; do j= G% jsd,G% jed ; do i= G% isd,G% ied
297
293
CS% BS_struct(i,j,k) = CS% ebt_struct(i,j,k)** CS% BS_EBT_power
298
294
enddo ; enddo ; enddo
299
- elseif (CS% BS_use_sqg ) then
295
+ elseif (CS% BS_use_sqg_struct ) then
300
296
do k= 1 ,nz ; do j= G% jsd,G% jed ; do i= G% isd,G% ied
301
297
CS% BS_struct(i,j,k) = CS% sqg_struct(i,j,k)
302
298
enddo ; enddo ; enddo
303
299
endif
304
300
305
- if (CS% khth_use_ebt_struct .and. CS% khth_use_sqg_struct) then
306
- call MOM_error(FATAL, &
307
- " calc_resoln_function: Only one of KHTH_USE_EBT_STRUCT &
308
- and KHTH_USE_SQG_STRUCT can be true" )
309
- elseif (CS% khth_use_ebt_struct) then
301
+ if (CS% khth_use_ebt_struct) then
310
302
do k= 1 ,nz ; do j= G% jsd,G% jed ; do i= G% isd,G% ied
311
303
CS% khth_struct(i,j,k) = CS% ebt_struct(i,j,k)
312
304
enddo ; enddo ; enddo
@@ -316,11 +308,7 @@ subroutine calc_resoln_function(h, tv, G, GV, US, CS, MEKE, dt)
316
308
enddo ; enddo ; enddo
317
309
endif
318
310
319
- if (CS% khtr_use_ebt_struct .and. CS% khtr_use_sqg_struct) then
320
- call MOM_error(FATAL, &
321
- " calc_resoln_function: Only one of KHTR_USE_EBT_STRUCT &
322
- and KHTR_USE_SQG_STRUCT can be true" )
323
- elseif (CS% khtr_use_ebt_struct) then
311
+ if (CS% khtr_use_ebt_struct) then
324
312
do k= 1 ,nz ; do j= G% jsd,G% jed ; do i= G% isd,G% ied
325
313
CS% khtr_struct(i,j,k) = CS% ebt_struct(i,j,k)
326
314
enddo ; enddo ; enddo
@@ -330,11 +318,7 @@ subroutine calc_resoln_function(h, tv, G, GV, US, CS, MEKE, dt)
330
318
enddo ; enddo ; enddo
331
319
endif
332
320
333
- if (CS% kdgl90_use_ebt_struct .and. CS% kdgl90_use_sqg_struct) then
334
- call MOM_error(FATAL, &
335
- " calc_resoln_function: Only one of KD_GL90_USE_EBT_STRUCT &
336
- and KD_GL90_USE_SQG_STRUCT can be true" )
337
- elseif (CS% kdgl90_use_ebt_struct) then
321
+ if (CS% kdgl90_use_ebt_struct) then
338
322
do k= 1 ,nz ; do j= G% jsd,G% jed ; do i= G% isd,G% ied
339
323
CS% kdgl90_struct(i,j,k) = CS% ebt_struct(i,j,k)
340
324
enddo ; enddo ; enddo
@@ -1409,7 +1393,7 @@ subroutine VarMix_init(Time, G, GV, US, param_file, diag, CS)
1409
1393
call get_param(param_file, mdl, " BACKSCAT_EBT_POWER" , CS% BS_EBT_power, &
1410
1394
" Power to raise EBT vertical structure to when backscatter " // &
1411
1395
" has vertical structure." , units= " nondim" , default= 0.0 )
1412
- call get_param(param_file, mdl, " BS_USE_SQG " , CS% BS_use_sqg , &
1396
+ call get_param(param_file, mdl, " BS_USE_SQG_STRUCT " , CS% BS_use_sqg_struct , &
1413
1397
" If true, the SQG vertical structure is used for backscatter " // &
1414
1398
" on the condition that BS_EBT_power=0" , &
1415
1399
default= .false. )
@@ -1494,8 +1478,33 @@ subroutine VarMix_init(Time, G, GV, US, param_file, diag, CS)
1494
1478
endif
1495
1479
1496
1480
1497
- allocate (CS% BS_struct(isd:ied,jsd:jed,GV% ke), source= 0.0 )
1498
- CS% BS_struct(:,:,:) = 1.0
1481
+ if (CS% BS_EBT_power> 0 . .and. CS% BS_use_sqg_struct) then
1482
+ call MOM_error(FATAL, &
1483
+ " calc_resoln_function: BS_EBT_POWER>0. &
1484
+ and BS_USE_SQG=True cannot be set together" )
1485
+ endif
1486
+
1487
+ if (CS% khth_use_ebt_struct .and. CS% khth_use_sqg_struct) then
1488
+ call MOM_error(FATAL, &
1489
+ " calc_resoln_function: Only one of KHTH_USE_EBT_STRUCT &
1490
+ and KHTH_USE_SQG_STRUCT can be true" )
1491
+ endif
1492
+
1493
+ if (CS% khtr_use_ebt_struct .and. CS% khtr_use_sqg_struct) then
1494
+ call MOM_error(FATAL, &
1495
+ " calc_resoln_function: Only one of KHTR_USE_EBT_STRUCT &
1496
+ and KHTR_USE_SQG_STRUCT can be true" )
1497
+ endif
1498
+
1499
+ if (CS% kdgl90_use_ebt_struct .and. CS% kdgl90_use_sqg_struct) then
1500
+ call MOM_error(FATAL, &
1501
+ " calc_resoln_function: Only one of KD_GL90_USE_EBT_STRUCT &
1502
+ and KD_GL90_USE_SQG_STRUCT can be true" )
1503
+ endif
1504
+
1505
+ if (CS% BS_EBT_power> 0 . .or. CS% BS_use_sqg_struct) then
1506
+ allocate (CS% BS_struct(isd:ied,jsd:jed,GV% ke), source= 0.0 )
1507
+ endif
1499
1508
1500
1509
if (CS% khth_use_ebt_struct .or. CS% khth_use_sqg_struct) then
1501
1510
allocate (CS% khth_struct(isd:ied, jsd:jed, gv% ke), source= 0.0 )
@@ -1606,13 +1615,15 @@ subroutine VarMix_init(Time, G, GV, US, param_file, diag, CS)
1606
1615
1607
1616
CS% id_sqg_struct = register_diag_field(' ocean_model' , ' sqg_struct' , diag% axesTl, Time, &
1608
1617
' Vertical structure of SQG mode' , ' nondim' )
1609
- if (CS% BS_use_sqg .or. CS% khth_use_sqg_struct .or. CS% khtr_use_sqg_struct &
1618
+ if (CS% BS_use_sqg_struct .or. CS% khth_use_sqg_struct .or. CS% khtr_use_sqg_struct &
1610
1619
.or. CS% kdgl90_use_sqg_struct .or. CS% id_sqg_struct> 0 ) then
1611
1620
allocate (CS% sqg_struct(isd:ied,jsd:jed,GV% ke), source= 0.0 )
1612
1621
endif
1613
1622
1614
- CS% id_BS_struct = register_diag_field(' ocean_model' , ' BS_struct' , diag% axesTl, Time, &
1615
- ' Vertical structure of backscatter' , ' nondim' )
1623
+ if (CS% BS_EBT_power> 0 . .or. CS% BS_use_sqg_struct) then
1624
+ CS% id_BS_struct = register_diag_field(' ocean_model' , ' BS_struct' , diag% axesTl, Time, &
1625
+ ' Vertical structure of backscatter' , ' nondim' )
1626
+ endif
1616
1627
if (CS% khth_use_ebt_struct .or. CS% khth_use_sqg_struct) then
1617
1628
CS% id_khth_struct = register_diag_field(' ocean_model' , ' khth_struct' , diag% axesTl, Time, &
1618
1629
' Vertical structure of thickness diffusivity' , ' nondim' )
0 commit comments