Skip to content

Commit

Permalink
fix axes and init local array
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Dussin authored and Raphael Dussin committed Aug 27, 2021
1 parent e1c8f91 commit faaf6c7
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/parameterizations/lateral/MOM_internal_tides.F90
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ subroutine propagate_int_tide(h, tv, cn, TKE_itidal_input, vel_btTide, Nb, dt, &

! init local arrays
drag_scale(:,:) = 0.
Ub(:,:,:,:) = 0.

! Set the wave speeds for the modes, using cg(n) ~ cg(1)/n.**********************
! This is wrong, of course, but it works reasonably in some cases.
Expand Down Expand Up @@ -522,11 +523,10 @@ subroutine propagate_int_tide(h, tv, cn, TKE_itidal_input, vel_btTide, Nb, dt, &
call post_data(CS%id_En_mode(fr,m), tot_En, CS%diag)
endif ; enddo ; enddo

! ! this fails with DIAG_AS_CHKSUM with unknown axis
! ! Output 3-D (i,j,a) energy density for each freq and mode
! do m=1,CS%NMode ; do fr=1,CS%Nfreq ; if (CS%id_En_ang_mode(fr,m) > 0) then
! call post_data(CS%id_En_ang_mode(fr,m), CS%En(:,:,:,fr,m) , CS%diag)
! endif ; enddo ; enddo
! Output 3-D (i,j,a) energy density for each freq and mode
do m=1,CS%NMode ; do fr=1,CS%Nfreq ; if (CS%id_En_ang_mode(fr,m) > 0) then
call post_data(CS%id_En_ang_mode(fr,m), CS%En(:,:,:,fr,m) , CS%diag)
endif ; enddo ; enddo

! Output 2-D energy loss (summed over angles, freq, modes)
tot_leak_loss(:,:) = 0.0
Expand Down Expand Up @@ -580,12 +580,11 @@ subroutine propagate_int_tide(h, tv, cn, TKE_itidal_input, vel_btTide, Nb, dt, &
call post_data(CS%id_allprocesses_loss_mode(fr,m), allprocesses_loss_mode, CS%diag)
endif ; enddo ; enddo

! ! this fails with DIAG_AS_CHKSUM with unknown axis
! ! Output 3-D (i,j,a) energy loss for each freq and mode
! do m=1,CS%NMode ; do fr=1,CS%Nfreq ; if (CS%id_itidal_loss_ang_mode(fr,m) > 0) then
! call post_data(CS%id_itidal_loss_ang_mode(fr,m), CS%TKE_itidal_loss(:,:,:,fr,m) , CS%diag)
! endif ; enddo ; enddo
!
! Output 3-D (i,j,a) energy loss for each freq and mode
do m=1,CS%NMode ; do fr=1,CS%Nfreq ; if (CS%id_itidal_loss_ang_mode(fr,m) > 0) then
call post_data(CS%id_itidal_loss_ang_mode(fr,m), CS%TKE_itidal_loss(:,:,:,fr,m) , CS%diag)
endif ; enddo ; enddo

! Output 2-D period-averaged horizontal near-bottom mode velocity for each freq and mode
do m=1,CS%NMode ; do fr=1,CS%Nfreq ; if (CS%id_Ub_mode(fr,m) > 0) then
call post_data(CS%id_Ub_mode(fr,m), Ub(:,:,fr,m), CS%diag)
Expand Down Expand Up @@ -2522,8 +2521,8 @@ subroutine internal_tides_init(Time, G, GV, US, param_file, diag, CS)
do a=1,num_angle ; angles(a) = (real(a) - 1) * Angle_size ; enddo

id_ang = diag_axis_init("angle", angles, "Radians", "N", "Angular Orienation of Fluxes")
call define_axes_group(diag, (/ diag%axesT1%handles(1), diag%axesT1%handles(2), id_ang /), axes_ang)

call define_axes_group(diag, (/ diag%axesT1%handles(1), diag%axesT1%handles(2), id_ang /), &
axes_ang, is_h_point=.true.)
do fr=1,CS%nFreq ; write(freq_name(fr), '("freq",i1)') fr ; enddo
do m=1,CS%nMode ; do fr=1,CS%nFreq
! Register 2-D energy density (summed over angles) for each freq and mode
Expand Down

0 comments on commit faaf6c7

Please sign in to comment.