Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Problem on WSM62D to WSM61D

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

Hao Lyu

New member
Hi all,
I am trying to rewrite subroutine WSM62D(in mp_module_wsm6.F) into a "WSM61D" subruotine by putting i outside the subroutine and change the dimension of the variables in WSM62D. I am trying to do this to see if it can better accelerate WSM6 in GPU(using OPENACC), and some further research reasons.
I have rewritten it and it has been successfully compiled. However, when I am checking whether I rewrote it correctly, I found that my subroutine has about 0.001 errors in the variable Temperature, in one dt. I have been checking on this subroutine for times,but still unable to see any obvious error. (my fortran file are attacged below)

Here are my questions:
1. Why are schemes like wsm,wdm, written in a "2D" subroutine meanwhile some schemes like lin et al are written in a "fully", "single-coloum" subroutine? Is it because that it can accelerate the caculation in cpu?
2. Is 0.001 degree mismatch acceptable for the mp scheme?
3. What causes this dismatch in 1d subroutine and 2d subroutine? Is it because that there are some "globlal" variables in 2D subtroutine(which means it does not change in a 2d subroutine), or it is simple because that I made a mistake?



  • module_mp_wsm6_new.F
    103.5 KB · Views: 48
  • module_mp_wsm6.F
    109.8 KB · Views: 37
If you look at the code module_mp_wsm6.F, you will find that the essential scheme is still running on 1-D column, i.e.,
in subroutine wsm62D, all input and output variables are 1-D arrays. All calculations are done in single vertical column.

I don't know much of GPU. In our standard test between serial, MPI and openMP runs, we require the results to be identical. We usually turn off optimization in these tests, because optimization may cause small differences. In your case, however, I am not sure whether lower optimization levels can help or not.