Skip to content

Commit

Permalink
Removed trailing space
Browse files Browse the repository at this point in the history
  • Loading branch information
Wendazhang33 committed Oct 17, 2024
1 parent 2b195b7 commit 0bfeff5
Showing 1 changed file with 40 additions and 29 deletions.
69 changes: 40 additions & 29 deletions src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module MOM_lateral_mixing_coeffs
real, allocatable :: kdgl90_struct(:,:,:) !< Vertical structure function used in GL90 diffusivity [nondim]
real :: BS_EBT_power !< Power to raise EBT vertical structure to. Default 0.0.
real :: sqg_expo !< Exponent for SQG vertical structure [nondim]. Default 0.0
logical :: BS_use_sqg !< If true, use sqg_stuct for backscatter vertical structure.
logical :: BS_use_sqg_struct !< If true, use sqg_stuct for backscatter vertical structure.


real ALLOCABLE_, dimension(NIMEMB_PTR_,NJMEM_) :: &
Expand Down Expand Up @@ -282,31 +282,23 @@ subroutine calc_resoln_function(h, tv, G, GV, US, CS, MEKE, dt)
call create_group_pass(CS%pass_cg1, CS%cg1, G%Domain)
call do_group_pass(CS%pass_cg1, G%Domain)
endif
if (CS%BS_use_sqg .or. CS%khth_use_sqg_struct .or. CS%khtr_use_sqg_struct &
if (CS%BS_use_sqg_struct .or. CS%khth_use_sqg_struct .or. CS%khtr_use_sqg_struct &
.or. CS%kdgl90_use_sqg_struct .or. CS%id_sqg_struct>0) then
call calc_sqg_struct(h, tv, G, GV, US, CS, dt, MEKE)
call pass_var(CS%sqg_struct, G%Domain)
endif

if (CS%BS_EBT_power>0. .and. CS%BS_use_sqg) then
call MOM_error(FATAL, &
"calc_resoln_function: BS_EBT_POWER>0. &
and BS_USE_SQG=True cannot be set together")
elseif (CS%BS_EBT_power>0.) then
if (CS%BS_EBT_power>0.) then
do k=1,nz ; do j=G%jsd,G%jed ; do i=G%isd,G%ied
CS%BS_struct(i,j,k) = CS%ebt_struct(i,j,k)**CS%BS_EBT_power
enddo ; enddo ; enddo
elseif (CS%BS_use_sqg) then
elseif (CS%BS_use_sqg_struct) then
do k=1,nz ; do j=G%jsd,G%jed ; do i=G%isd,G%ied
CS%BS_struct(i,j,k) = CS%sqg_struct(i,j,k)
enddo ; enddo ; enddo
endif

if (CS%khth_use_ebt_struct .and. CS%khth_use_sqg_struct) then
call MOM_error(FATAL, &
"calc_resoln_function: Only one of KHTH_USE_EBT_STRUCT &
and KHTH_USE_SQG_STRUCT can be true")
elseif (CS%khth_use_ebt_struct) then
if (CS%khth_use_ebt_struct) then
do k=1,nz ; do j=G%jsd,G%jed ; do i=G%isd,G%ied
CS%khth_struct(i,j,k) = CS%ebt_struct(i,j,k)
enddo ; enddo ; enddo
Expand All @@ -316,11 +308,7 @@ subroutine calc_resoln_function(h, tv, G, GV, US, CS, MEKE, dt)
enddo ; enddo ; enddo
endif

if (CS%khtr_use_ebt_struct .and. CS%khtr_use_sqg_struct) then
call MOM_error(FATAL, &
"calc_resoln_function: Only one of KHTR_USE_EBT_STRUCT &
and KHTR_USE_SQG_STRUCT can be true")
elseif (CS%khtr_use_ebt_struct) then
if (CS%khtr_use_ebt_struct) then
do k=1,nz ; do j=G%jsd,G%jed ; do i=G%isd,G%ied
CS%khtr_struct(i,j,k) = CS%ebt_struct(i,j,k)
enddo ; enddo ; enddo
Expand All @@ -330,11 +318,7 @@ subroutine calc_resoln_function(h, tv, G, GV, US, CS, MEKE, dt)
enddo ; enddo ; enddo
endif

if (CS%kdgl90_use_ebt_struct .and. CS%kdgl90_use_sqg_struct) then
call MOM_error(FATAL, &
"calc_resoln_function: Only one of KD_GL90_USE_EBT_STRUCT &
and KD_GL90_USE_SQG_STRUCT can be true")
elseif (CS%kdgl90_use_ebt_struct) then
if (CS%kdgl90_use_ebt_struct) then
do k=1,nz ; do j=G%jsd,G%jed ; do i=G%isd,G%ied
CS%kdgl90_struct(i,j,k) = CS%ebt_struct(i,j,k)
enddo ; enddo ; enddo
Expand Down Expand Up @@ -1409,7 +1393,7 @@ subroutine VarMix_init(Time, G, GV, US, param_file, diag, CS)
call get_param(param_file, mdl, "BACKSCAT_EBT_POWER", CS%BS_EBT_power, &
"Power to raise EBT vertical structure to when backscatter "// &
"has vertical structure.", units="nondim", default=0.0)
call get_param(param_file, mdl, "BS_USE_SQG", CS%BS_use_sqg, &
call get_param(param_file, mdl, "BS_USE_SQG_STRUCT", CS%BS_use_sqg_struct, &
"If true, the SQG vertical structure is used for backscatter "//&
"on the condition that BS_EBT_power=0", &
default=.false.)
Expand Down Expand Up @@ -1494,8 +1478,33 @@ subroutine VarMix_init(Time, G, GV, US, param_file, diag, CS)
endif


allocate(CS%BS_struct(isd:ied,jsd:jed,GV%ke), source=0.0)
CS%BS_struct(:,:,:) = 1.0
if (CS%BS_EBT_power>0. .and. CS%BS_use_sqg_struct) then
call MOM_error(FATAL, &
"calc_resoln_function: BS_EBT_POWER>0. &
and BS_USE_SQG=True cannot be set together")
endif

if (CS%khth_use_ebt_struct .and. CS%khth_use_sqg_struct) then
call MOM_error(FATAL, &
"calc_resoln_function: Only one of KHTH_USE_EBT_STRUCT &
and KHTH_USE_SQG_STRUCT can be true")
endif

if (CS%khtr_use_ebt_struct .and. CS%khtr_use_sqg_struct) then
call MOM_error(FATAL, &
"calc_resoln_function: Only one of KHTR_USE_EBT_STRUCT &
and KHTR_USE_SQG_STRUCT can be true")
endif

if (CS%kdgl90_use_ebt_struct .and. CS%kdgl90_use_sqg_struct) then
call MOM_error(FATAL, &
"calc_resoln_function: Only one of KD_GL90_USE_EBT_STRUCT &
and KD_GL90_USE_SQG_STRUCT can be true")
endif

if (CS%BS_EBT_power>0. .or. CS%BS_use_sqg_struct) then
allocate(CS%BS_struct(isd:ied,jsd:jed,GV%ke), source=0.0)
endif

if (CS%khth_use_ebt_struct .or. CS%khth_use_sqg_struct) then
allocate(CS%khth_struct(isd:ied, jsd:jed, gv%ke), source=0.0)
Expand Down Expand Up @@ -1606,13 +1615,15 @@ subroutine VarMix_init(Time, G, GV, US, param_file, diag, CS)

CS%id_sqg_struct = register_diag_field('ocean_model', 'sqg_struct', diag%axesTl, Time, &
'Vertical structure of SQG mode', 'nondim')
if (CS%BS_use_sqg .or. CS%khth_use_sqg_struct .or. CS%khtr_use_sqg_struct &
if (CS%BS_use_sqg_struct .or. CS%khth_use_sqg_struct .or. CS%khtr_use_sqg_struct &
.or. CS%kdgl90_use_sqg_struct .or. CS%id_sqg_struct>0) then
allocate(CS%sqg_struct(isd:ied,jsd:jed,GV%ke), source=0.0)
endif

CS%id_BS_struct = register_diag_field('ocean_model', 'BS_struct', diag%axesTl, Time, &
'Vertical structure of backscatter', 'nondim')
if (CS%BS_EBT_power>0. .or. CS%BS_use_sqg_struct) then
CS%id_BS_struct = register_diag_field('ocean_model', 'BS_struct', diag%axesTl, Time, &
'Vertical structure of backscatter', 'nondim')
endif
if (CS%khth_use_ebt_struct .or. CS%khth_use_sqg_struct) then
CS%id_khth_struct = register_diag_field('ocean_model', 'khth_struct', diag%axesTl, Time, &
'Vertical structure of thickness diffusivity', 'nondim')
Expand Down

0 comments on commit 0bfeff5

Please sign in to comment.