Skip to content

Fix return type on wrf_dm_max_int (should be an integer)#1339

Merged
davegill merged 1 commit intowrf-model:release-v4.2.2from
davegill:int_wrf_dm_max
Jan 7, 2021
Merged

Fix return type on wrf_dm_max_int (should be an integer)#1339
davegill merged 1 commit intowrf-model:release-v4.2.2from
davegill:int_wrf_dm_max

Conversation

@davegill
Copy link
Copy Markdown
Contributor

@davegill davegill commented Dec 15, 2020

TYPE: bug fix

KEYWORDS, real, int, integer, wrf_dm_max_int

SOURCE: internal

DESCRIPTION OF CHANGES:
While looking to see if WRF had a function to return the maximum integer from among the
max values of integers on each of the MPI ranks, it was noticed that the return value for the
existing function was REAL. It should be an INTEGER.

There is only a single use of this function in the entire model, in the file share/module_trajectory.F.

glb_traj_proc(trj) = wrf_dm_max_int( traj_proc(trj) )

In that file, the input to the function, traj_proc, and the return value, glb_traj_proc, are both declared as integers. Therefore, there is no reason for a function to be given a list of integers, and when finding the max value to actually return that value as a real.

   integer :: traj_proc(traj_max), glb_traj_proc(traj_max)

LIST OF MODIFIED FILES:
M external/RSL_LITE/module_dm.F

TESTS CONDUCTED:

  1. Jenkins tests OK.
  2. A small set of trajectories works as expected.
    Screen Shot 2021-01-06 at 6 01 44 PM

TYPE: bug fix

KEYWORDS, real, int, integer, wrf_dm_max_int

SOURCE: internal

DESCRIPTION OF CHANGES:
While looking to see if WRF had a function to return the maximum integer from among the
max values of integers on each of the MPI ranks, it was noticed that the return value for the
existing function was REAL. It should be an INTEGER.

There is only a single use of this function in the entire model, in the file
`share/module_trajectory.F`.
```
glb_traj_proc(trj) = wrf_dm_max_int( traj_proc(trj) )
```
In that file, the input to the function, `traj_proc`, and the return value, `glb_traj_proc`,
are both declared as integers.
```
   integer :: traj_proc(traj_max), glb_traj_proc(traj_max)
```

LIST OF MODIFIED FILES:
M	external/RSL_LITE/module_dm.F

TESTS CONDUCTED:
1. Maybe I can figure out how to do a trajectory test, maybe.
@davegill
Copy link
Copy Markdown
Contributor Author

davegill commented Jan 7, 2021

@smileMchen
Ming,
With your help I was able to get the simple trajectories to work. Would you please review this PR?

@smileMchen
Copy link
Copy Markdown
Collaborator

@davegill
Dave, I agree that the return value should be integer. I will approve this PR.

@davegill davegill merged commit ce5b0cb into wrf-model:release-v4.2.2 Jan 7, 2021
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: bug fix

KEYWORDS, real, int, integer, wrf_dm_max_int

SOURCE: internal

DESCRIPTION OF CHANGES:
While looking to see if WRF had a function to return the maximum integer from among the
max values of integers on each of the MPI ranks, it was noticed that the return value for the
existing function was REAL. It should be an INTEGER.

There is only a single use of this function in the entire model, in the file `share/module_trajectory.F`.
```
glb_traj_proc(trj) = wrf_dm_max_int( traj_proc(trj) )
```
In that file, the input to the function, `traj_proc`, and the return value, `glb_traj_proc`, are both declared as integers. Therefore, there is no reason for a function to be given a list of integers, and when finding the max value to actually return that value as a real.
```
   integer :: traj_proc(traj_max), glb_traj_proc(traj_max)
```

LIST OF MODIFIED FILES:
M	external/RSL_LITE/module_dm.F

TESTS CONDUCTED:
1. Jenkins tests OK.
2. A small set of trajectories works as expected.
![Screen Shot 2021-01-06 at 6 01 44 PM](https://user-images.githubusercontent.com/12666234/103838081-5f802380-5049-11eb-87ed-648860b7d203.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants