Skip to content

Commit 1324656

Browse files
authored
Add weighted d[uv]_dt_str diagnostics (#1539)
This adds four new diagnostics building on the wind stress acceleration diagnostics du_dt_str, dv_dt_str (from #1437) - their thickness-weighted versions: h_du_dt_str, h_dv_dt_str (completing the set of diags from 3D thickness x momentum diagnostics #1398) - their viscous remnant fraction: du_dt_str_visc_rem, dv_dt_str_visc_rem (completing the set of diags from Visc_rem_[uv] multiplied momentum budget diagnostics ocean-eddy-cpt#10) Nora did some quick tests with the CPT NeverWorld2 setup, which confirm that online and offline multiplication by 1) h or 2) visc_rem_[uv] coincide (up to 1) interpolation error and 2) numerical noise, respectively), and illustrated this beautifully with some figures that accompanied the first of the three commits that were squashed into one.
1 parent aad1e89 commit 1324656

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

src/parameterizations/vertical/MOM_vert_friction.F90

+76
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ module MOM_vert_friction
128128
! integer :: id_hf_du_dt_visc = -1, id_hf_dv_dt_visc = -1
129129
integer :: id_h_du_dt_visc = -1, id_h_dv_dt_visc = -1
130130
integer :: id_hf_du_dt_visc_2d = -1, id_hf_dv_dt_visc_2d = -1
131+
integer :: id_h_du_dt_str = -1, id_h_dv_dt_str = -1
132+
integer :: id_du_dt_str_visc_rem = -1, id_dv_dt_str_visc_rem = -1
131133
!>@}
132134

133135
type(PointAccel_CS), pointer :: PointAccel_CSp => NULL() !< A pointer to the control structure
@@ -219,6 +221,10 @@ subroutine vertvisc(u, v, h, forces, visc, dt, OBC, ADp, CDp, G, GV, US, CS, &
219221

220222
real, allocatable, dimension(:,:,:) :: h_du_dt_visc ! h x du_dt_visc [H L T-2 ~> m2 s-2]
221223
real, allocatable, dimension(:,:,:) :: h_dv_dt_visc ! h x dv_dt_visc [H L T-2 ~> m2 s-2]
224+
real, allocatable, dimension(:,:,:) :: h_du_dt_str ! h x du_dt_str [H L T-2 ~> m2 s-2]
225+
real, allocatable, dimension(:,:,:) :: h_dv_dt_str ! h x dv_dt_str [H L T-2 ~> m2 s-2]
226+
real, allocatable, dimension(:,:,:) :: du_dt_str_visc_rem ! du_dt_str x visc_rem_u [L T-2 ~> m s-2]
227+
real, allocatable, dimension(:,:,:) :: dv_dt_str_visc_rem ! dv_dt_str x visc_rem_v [L T-2 ~> m s-2]
222228

223229
logical :: do_i(SZIB_(G))
224230
logical :: DoStokesMixing
@@ -565,6 +571,44 @@ subroutine vertvisc(u, v, h, forces, visc, dt, OBC, ADp, CDp, G, GV, US, CS, &
565571
deallocate(h_dv_dt_visc)
566572
endif
567573

574+
if (CS%id_h_du_dt_str > 0) then
575+
allocate(h_du_dt_str(G%IsdB:G%IedB,G%jsd:G%jed,GV%ke))
576+
h_du_dt_str(:,:,:) = 0.0
577+
do k=1,nz ; do j=js,je ; do I=Isq,Ieq
578+
h_du_dt_str(I,j,k) = ADp%du_dt_str(I,j,k) * ADp%diag_hu(I,j,k)
579+
enddo ; enddo ; enddo
580+
call post_data(CS%id_h_du_dt_str, h_du_dt_str, CS%diag)
581+
deallocate(h_du_dt_str)
582+
endif
583+
if (CS%id_h_dv_dt_str > 0) then
584+
allocate(h_dv_dt_str(G%isd:G%ied,G%JsdB:G%JedB,GV%ke))
585+
h_dv_dt_str(:,:,:) = 0.0
586+
do k=1,nz ; do J=Jsq,Jeq ; do i=is,ie
587+
h_dv_dt_str(i,J,k) = ADp%dv_dt_str(i,J,k) * ADp%diag_hv(i,J,k)
588+
enddo ; enddo ; enddo
589+
call post_data(CS%id_h_dv_dt_str, h_dv_dt_str, CS%diag)
590+
deallocate(h_dv_dt_str)
591+
endif
592+
593+
if (CS%id_du_dt_str_visc_rem > 0) then
594+
allocate(du_dt_str_visc_rem(G%IsdB:G%IedB,G%jsd:G%jed,GV%ke))
595+
du_dt_str_visc_rem(:,:,:) = 0.0
596+
do k=1,nz ; do j=js,je ; do I=Isq,Ieq
597+
du_dt_str_visc_rem(I,j,k) = ADp%du_dt_str(I,j,k) * ADp%visc_rem_u(I,j,k)
598+
enddo ; enddo ; enddo
599+
call post_data(CS%id_du_dt_str_visc_rem, du_dt_str_visc_rem, CS%diag)
600+
deallocate(du_dt_str_visc_rem)
601+
endif
602+
if (CS%id_dv_dt_str_visc_rem > 0) then
603+
allocate(dv_dt_str_visc_rem(G%isd:G%ied,G%JsdB:G%JedB,GV%ke))
604+
dv_dt_str_visc_rem(:,:,:) = 0.0
605+
do k=1,nz ; do J=Jsq,Jeq ; do i=is,ie
606+
dv_dt_str_visc_rem(i,J,k) = ADp%dv_dt_str(i,J,k) * ADp%visc_rem_v(i,J,k)
607+
enddo ; enddo ; enddo
608+
call post_data(CS%id_dv_dt_str_visc_rem, dv_dt_str_visc_rem, CS%diag)
609+
deallocate(dv_dt_str_visc_rem)
610+
endif
611+
568612
end subroutine vertvisc
569613

570614
!> Calculate the fraction of momentum originally in a layer that remains in the water column
@@ -1914,6 +1958,38 @@ subroutine vertvisc_init(MIS, Time, G, GV, US, param_file, diag, ADp, dirs, &
19141958
call safe_alloc_ptr(ADp%diag_hv,isd,ied,JsdB,JedB,nz)
19151959
endif
19161960

1961+
CS%id_h_du_dt_str = register_diag_field('ocean_model', 'h_du_dt_str', diag%axesCuL, Time, &
1962+
'Thickness Multiplied Zonal Acceleration from Surface Wind Stresses', 'm2 s-2', &
1963+
conversion=GV%H_to_m*US%L_T2_to_m_s2)
1964+
if (CS%id_h_du_dt_str > 0) then
1965+
call safe_alloc_ptr(ADp%du_dt_str,IsdB,IedB,jsd,jed,nz)
1966+
call safe_alloc_ptr(ADp%diag_hu,IsdB,IedB,jsd,jed,nz)
1967+
endif
1968+
1969+
CS%id_h_dv_dt_str = register_diag_field('ocean_model', 'h_dv_dt_str', diag%axesCvL, Time, &
1970+
'Thickness Multiplied Meridional Acceleration from Surface Wind Stresses', 'm2 s-2', &
1971+
conversion=GV%H_to_m*US%L_T2_to_m_s2)
1972+
if (CS%id_h_dv_dt_str > 0) then
1973+
call safe_alloc_ptr(ADp%dv_dt_str,isd,ied,JsdB,JedB,nz)
1974+
call safe_alloc_ptr(ADp%diag_hv,isd,ied,JsdB,JedB,nz)
1975+
endif
1976+
1977+
CS%id_du_dt_str_visc_rem = register_diag_field('ocean_model', 'du_dt_str_visc_rem', diag%axesCuL, Time, &
1978+
'Zonal Acceleration from Surface Wind Stresses multiplied by viscous remnant', 'm s-2', &
1979+
conversion=US%L_T2_to_m_s2)
1980+
if (CS%id_du_dt_str_visc_rem > 0) then
1981+
call safe_alloc_ptr(ADp%du_dt_str,IsdB,IedB,jsd,jed,nz)
1982+
call safe_alloc_ptr(ADp%visc_rem_u,IsdB,IedB,jsd,jed,nz)
1983+
endif
1984+
1985+
CS%id_dv_dt_str_visc_rem = register_diag_field('ocean_model', 'dv_dt_str_visc_rem', diag%axesCvL, Time, &
1986+
'Meridional Acceleration from Surface Wind Stresses multiplied by viscous remnant', 'm s-2', &
1987+
conversion=US%L_T2_to_m_s2)
1988+
if (CS%id_dv_dt_str_visc_rem > 0) then
1989+
call safe_alloc_ptr(ADp%dv_dt_str,isd,ied,JsdB,JedB,nz)
1990+
call safe_alloc_ptr(ADp%visc_rem_v,isd,ied,JsdB,JedB,nz)
1991+
endif
1992+
19171993
if ((len_trim(CS%u_trunc_file) > 0) .or. (len_trim(CS%v_trunc_file) > 0)) &
19181994
call PointAccel_init(MIS, Time, G, param_file, diag, dirs, CS%PointAccel_CSp)
19191995

0 commit comments

Comments
 (0)