Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertically-integrated frazil_3d diagnostic #291

Merged
merged 3 commits into from
Jun 28, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/mom5/ocean_tracers/ocean_frazil.F90
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ module ocean_frazil_mod
logical :: used
integer :: id_frazil_2d=-1
integer :: id_frazil_3d=-1
integer :: id_frazil_3d_int_z=-1
integer :: id_temp_freeze=-1
! for FAFMIP heat tracers
integer :: id_frazil_redist_2d=-1
Expand Down Expand Up @@ -478,6 +479,9 @@ subroutine ocean_frazil_init (Domain, Grid, Time, Time_steps, Ocean_options, &
id_frazil_3d = register_diag_field ('ocean_model', 'frazil_3d', Grd%tracer_axes(1:3), &
Time%model_time, 'ocn frazil heat flux over time step', 'W/m^2', &
missing_value=missing_value, range=(/-1.e10,1.e10/))
id_frazil_3d_int_z = register_diag_field ('ocean_model', 'frazil_3d_int_z', Grd%tracer_axes(1:2), &
Time%model_time, 'Vertical sum of ocn frazil heat flux over time step', 'W/m^2', &
missing_value=missing_value, range=(/-1.e10,1.e10/))

! for FAFMIP frazil diagnostic tracer
id_frazil_redist_2d = register_diag_field ('ocean_model','frazil_redist_2d',Grd%tracer_axes(1:2), &
Expand Down Expand Up @@ -542,7 +546,17 @@ subroutine compute_frazil_heating (Time, Thickness, Dens, T_prog, T_diag)
Time%model_time, rmask=Grd%tmask(:,:,:), &
is_in=isc, js_in=jsc, ks_in=1, ie_in=iec, je_in=jec, ke_in=nk)
endif


if (id_frazil_3d_int_z > 0) then
wrk1_2d(:,:) = 0.0
do k=1,nk
wrk1_2d(:,:) = wrk1_2d(:,:) + T_diag(index_frazil)%field(:,:,k)*dtimer
enddo
used = send_data(id_frazil_3d_int_z, wrk1_2d(:,:), &
Time%model_time, rmask=Grd%tmask(:,:,1), &
is_in=isc, js_in=jsc, ie_in=iec, je_in=jec)
endif

return
endif
#endif
Expand Down Expand Up @@ -694,6 +708,13 @@ subroutine compute_frazil_heating (Time, Thickness, Dens, T_prog, T_diag)
if (id_frazil_3d > 0) then
call diagnose_3d(Time, Grd, id_frazil_3d, T_diag(index_frazil)%field(:,:,:)*dtimer)
endif
if (id_frazil_3d_int_z > 0) then
wrk1_2d(:,:) = 0.0
do k=1,nk
wrk1_2d(:,:) = wrk1_2d(:,:) + T_diag(index_frazil)%field(:,:,k)*dtimer
enddo
call diagnose_2d(Time, Grd, id_frazil_3d_int_z, wrk1_2d(:,:))
endif

if(id_temp_freeze > 0) then
wrk1(:,:,:) =0.0
Expand Down