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

Add Lscale variable as an intent(out) to advance_clubb_core #16

Open
adamrher opened this issue Aug 9, 2024 · 3 comments
Open

Add Lscale variable as an intent(out) to advance_clubb_core #16

adamrher opened this issue Aug 9, 2024 · 3 comments

Comments

@adamrher
Copy link

adamrher commented Aug 9, 2024

Requesting the Lscale variable be added as an intent(out) argument to advance_clubb_core, and its api (called from clubb_intr.F90 in CAM). The purpose is for modifying the khzm diffusion coefficient computed in clubb with additional kinetic energy terms stemming from the CLUBB+MF CPT. In CAM, khzm is used outside of clubb to transport aerosols.

I also had trouble accessing the c_K variable used for computing khzm. In advance_clubb_core:

    !----------------------------------------------------------------
    ! Eddy diffusivity coefficient
    !----------------------------------------------------------------
    ! c_K is 0.548 usually (Duynkerke and Driedonks 1987)
    ! CLUBB uses a smaller value to better fit empirical data.

    ! Calculate CLUBB's eddy diffusivity as
    !   CLUBB's length scale times a velocity scale.
    c_K = clubb_params(ic_K)

    !$acc parallel loop gang vector collapse(2) default(present)
    do k = 1, nz
      do i = 1, ngrdcol
        Kh_zt(i,k) = c_K * Lscale(i,k) * sqrt_em_zt(i,k)
      end do
    end do

If this could also be made available in the clubb_intr.F90 interface that would be preferable to what I'm currently doing (duplicating and hard coding this value).

@vlarson
Copy link
Contributor

vlarson commented Aug 13, 2024

Requesting the Lscale variable be added as an intent(out) argument to advance_clubb_core, and its api (called from clubb_intr.F90 in CAM). The purpose is for modifying the khzm diffusion coefficient computed in clubb with additional kinetic energy terms stemming from the CLUBB+MF CPT. In CAM, khzm is used outside of clubb to transport aerosols.

OK, this sounds doable.

I also had trouble accessing the c_K variable used for computing khzm. In advance_clubb_core:
If this could also be made available in the clubb_intr.F90 interface that would be preferable to what I'm currently doing (duplicating and hard coding this value).

In clubb_intr, c_K should be brought into clubb_params_single_col and later into clubb_params. Hence c_K should be accessible in clubb_intr by a line like c_K = clubb_params(i,ic_K). Is this good enough for c_K?

@adamrher
Copy link
Author

Yes, I was able to access c_K by invoking clubb_params(ic_K). That's good to know, thanks. And so I'm just requesting the Lscale from the api.

@vlarson
Copy link
Contributor

vlarson commented Oct 16, 2024

Lscale was introduced as an output variable in the argument list of advance_clubb_core_api in this commit. @adamrher, please let me know if you need any further updates.

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

No branches or pull requests

2 participants