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

biodensity_feedback: initial commit #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

knutaros
Copy link
Contributor

supports feedback from a FABM aggregated standard variable "density_correction" to rho, buoy and NN.

@bolding
Copy link
Collaborator

bolding commented Aug 26, 2020

I'll suggest:
biodensity_feedback --> density_feedback - as the correction does not need to come from bio.

The Travis CI fails - https://travis-ci.org/github/gotm-model/code/builds/721153138 - (can you see the link) - because we have not settled on if CVMix shall be included or not.

@bolding
Copy link
Collaborator

bolding commented Aug 26, 2020

What about:

   
   r2b = -gravity / rho_0
   rho(nlev) = rho(nlev) + rho_corr(nlev)
   bu=rho_corr(nlev)*r2b
   buoy(nlev) = buoy(nlev) + bu
   do i=nlev-1,1,-1
      rho(i) = rho(i) + rho_corr(i)
      bl = rho_corr(i) * r2b
      buoy(i) = buoy(i) + bl 
      dz = _HALF_ * ( h(i) + h(i+1) )
      NN(i) = NN(i) + ( bu - bl ) / dz
      bu = bl
   end do

only one do loop - and no automatic array needed

@bolding
Copy link
Collaborator

bolding commented Aug 26, 2020

but can't be vectorized

@knutaros
Copy link
Contributor Author

knutaros commented Aug 26, 2020 via email

@bolding
Copy link
Collaborator

bolding commented Aug 26, 2020

but if you want to emphasize FABM - then call it fabmdensity_feedback - FABM contains non-bio stuff as well.

@knutaros
Copy link
Contributor Author

knutaros commented Aug 26, 2020 via email

@knutaros
Copy link
Contributor Author

knutaros commented Aug 26, 2020 via email

@bolding
Copy link
Collaborator

bolding commented Aug 26, 2020

On 8/26/20 9:43 AM, Karsten Bolding wrote: but can't be vectorized
is there any lost in performance by the repeated copy bu=bl?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#9 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2RV6RASDG2C26NH5BK3QTSCS4IVANCNFSM4QLEBRHQ.

Not compared to allocate a new vector and do two loops

@knutaros
Copy link
Contributor Author

knutaros commented Aug 26, 2020 via email

@knutaros
Copy link
Contributor Author

knutaros commented Aug 26, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants