-
Notifications
You must be signed in to change notification settings - Fork 1
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
Visc_rem_[uv] multiplied momentum budget diagnostics #10
Changes from 9 commits
7a65026
2601b47
20b8bfc
4208525
f4d4839
b1357bc
be09de0
fbdac20
86741cd
a40a90f
f31e5e6
ca0fb89
a874d6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -290,6 +290,12 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, p_surf, & | |
if (CS%id_dv_dt>0) call post_data(CS%id_dv_dt, CS%dv_dt, CS%diag, alt_h = diag_pre_sync%h_state) | ||
|
||
if (CS%id_dh_dt>0) call post_data(CS%id_dh_dt, CS%dh_dt, CS%diag, alt_h = diag_pre_sync%h_state) | ||
do k=1,nz ; do j=js,je ; do I=is-1,ie | ||
ADp%du_dt(I,j,k) = CS%du_dt(I,j,k) | ||
enddo ; enddo ; enddo | ||
do k=1,nz ; do J=js-1,je ; do i=is,ie | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, it seems this should be deleted since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. I need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest allocating them in MOM_diagnostics_init. du_dt from diagnostics_CS is only allocated when id_du_dt > 0, see here. It also needs to be allocated when id_hf_du_dt > 0. Same for dv_dt. |
||
ADp%dv_dt(i,J,k) = CS%dv_dt(i,J,k) | ||
enddo ; enddo ; enddo | ||
|
||
!! Diagnostics for terms multiplied by fractional thicknesses | ||
|
||
|
@@ -2322,7 +2328,6 @@ subroutine set_dependent_diagnostics(MIS, ADp, CDp, G, GV, CS) | |
call safe_alloc_ptr(ADp%gradKEu,IsdB,IedB,jsd,jed,nz) | ||
call safe_alloc_ptr(ADp%gradKEv,isd,ied,JsdB,JedB,nz) | ||
endif | ||
|
||
if (associated(CS%KE_visc)) then | ||
call safe_alloc_ptr(ADp%du_dt_visc,IsdB,IedB,jsd,jed,nz) | ||
call safe_alloc_ptr(ADp%dv_dt_visc,isd,ied,JsdB,JedB,nz) | ||
|
@@ -2368,7 +2373,7 @@ subroutine MOM_diagnostics_end(CS, ADp) | |
if (associated(CS%vhGM_Rlay)) deallocate(CS%vhGM_Rlay) | ||
|
||
if (associated(ADp%gradKEu)) deallocate(ADp%gradKEu) | ||
if (associated(ADp%gradKEu)) deallocate(ADp%gradKEu) | ||
if (associated(ADp%gradKEv)) deallocate(ADp%gradKEv) | ||
if (associated(ADp%du_dt_visc)) deallocate(ADp%du_dt_visc) | ||
if (associated(ADp%dv_dt_visc)) deallocate(ADp%dv_dt_visc) | ||
if (associated(ADp%du_dt_dia)) deallocate(ADp%du_dt_dia) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you forgot to delete this loop?
If not, since you are modifying the ADp structure, its intent should be inout:
Also, this loop should only be exercised if CS%id_hf_du_dt_2d > 0. Otherwise, there will be a memory error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about the
inout
! I needADp%du_dt
for the computation ofdu_dt_visc_rem
, see here:https://github.com/NoraLoose/MOM6/blob/86741cd1d3b049303db325d61089263eda90979b/src/parameterizations/vertical/MOM_vert_friction.F90#L535-L536
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha! Then, you should also allocate
ADp%du_dt
whenCS%id_du_dt_visc_rem > 0
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean that I should add something like:
in
MOM_diagnostics_init
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That won't work. In MOM_diagnostics_init, CS is the diagnostics_CS type.