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

modtimidepsv doublecasting and update #52

Closed
jchylik opened this issue Mar 27, 2020 · 2 comments
Closed

modtimidepsv doublecasting and update #52

jchylik opened this issue Mar 27, 2020 · 2 comments

Comments

@jchylik
Copy link

jchylik commented Mar 27, 2020

There are two issues in modtimedepsv. The first one is that it is casting the same variable twice, but with a seemingly different array length.

l.152, 154:

    call MPI_BCAST(timesvz(1:kflux),kflux,MY_REAL,0,comm3d,mpierr)
    call MPI_BCAST(svst             ,kflux*nsv,MY_REAL,0,comm3d,mpierr)
    call MPI_BCAST(timesvz(1:kls)    ,kls,MY_REAL  ,0,comm3d,mpierr)

The second line is indeed correct. Surprisingly, it does not crash.
This is due to the fact that kls and kflux are both currently parameters set to the length 100. While this approach was originally ok, this approach is not consistent with the current approach used in modtimedep

Proposed solution for modtimedepsv :

  1. make kflux and kls variables consistent with modtimedep:
    l.45-46
  integer    :: kflux
  integer    :: kls
  1. continue consistency by linking with modtestbed in inittimedepsv
    l.60 in:
    use modtestbed,        only : ltestbed,ntnudge,&
                                  tb_time

l.70 in:

    if (ltestbed) then
      kflux = ntnudge
      kls   = ntnudge
    else
      kflux = 10000
      kls   = 10000
    end if
  1. remove incorrect MPI command

l.152 delete:

 call MPI_BCAST(timesvz(1:kflux),kflux,MY_REAL,0,comm3d,mpierr)
@fjansson
Copy link
Contributor

Hi @jchylik , thanks for reporting this. I committed your proposed changes to the branch to4.3_Fredrik . Could you please test this version?

Also otherwise, we're preparing to release version 4.3, so testing of the prerelease version on your own cases would be most welcome (branch to4.3, to4.3_Fredrik is currently the same with only this fix added).

@jchylik
Copy link
Author

jchylik commented Aug 24, 2020

Thank you @fjansson , I will check it soon.

Speaking about test cases for 4.3, I am afraid we cannot send many cases, as most of them are optimised for full 3-phase microphysics.

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