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

Dev gpu fix #103

Merged
merged 5 commits into from
Jun 26, 2024
Merged

Dev gpu fix #103

merged 5 commits into from
Jun 26, 2024

Conversation

fjansson
Copy link
Contributor

Fixes after merging the Ruisdael and RRTMGP branches.

The 2024.05 nv-fortran gave an error for those data statements.
calcmoment had an assumed-shape argument. But this loses the starting index of the array.
Fix by hardcoding the input array shape to 2-ih:i1+ih,2-jh:j1+jh,1,k1.
Because nvfortran (at least 2024.05 version) is very picky with
max(a,b) etc having same type on both arguments.
This commit fixes most of these cases by making both arguments of type
field_r. In some cases, mostly modbulkmicro3, I convert to double
instead, to keep the changes manageable. This compiles with
gfortran and nvfortran in SP mode.
@lsoucasse
Copy link
Collaborator

Hi @fjansson, just checkout your branch, waiting for snellius to test it...

@lsoucasse
Copy link
Collaborator

lsoucasse commented Jun 25, 2024

Hi @fjansson, Currently the botany case crashes with this commit because of tracers being not read properly (though I modified the nameoption file and scalar.inp file with Caspar). Weirdly this reading problem only appear on the GPU and not on the CPU. I will try to add your moment calculation change into my old radiation branch to see if it fixes the issue of having Nan values in stat fields.

@fjansson
Copy link
Contributor Author

@lsoucasse I got Botany working with this branch:
add this to namoptions. Capitaliztion of the scalar names is important:

&NAMTRACERS                                                                                                                 
ltracers = .true.                                                                                                           
tracernames = 'nr', 'qr'                                                                                                    
/ 

edit scalar.inp.001, change the second line to

#height               nr          qr        

here there should be three words separated by white space, and capitalization might matter again. (There's a tolower call somewhere in the initialization but not everywhere).

@lsoucasse
Copy link
Collaborator

@lsoucasse I got Botany working with this branch: add this to namoptions. Capitaliztion of the scalar names is important:

&NAMTRACERS                                                                                                                 
ltracers = .true.                                                                                                           
tracernames = 'nr', 'qr'                                                                                                    
/ 

edit scalar.inp.001, change the second line to

#height               nr          qr        

here there should be three words separated by white space, and capitalization might matter again. (There's a tolower call somewhere in the initialization but not everywhere).

Hi @fjansson, I can read the tracers in the botany case, but still have the issue with my other column test cases while following the same procedure, formatting issue I suppose.

So I ran a couple of iterations of the botany case on the gpu interactive node that worked fine! But then running on a regular node gives me again a netcdf error when writing statistics, I am curious to know if you experience it or not.

@fjansson fjansson merged commit 326a123 into dev Jun 26, 2024
50 checks passed
@fjansson fjansson deleted the dev-gpu-fix branch June 26, 2024 13:16
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

Successfully merging this pull request may close these issues.

3 participants