You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Snapshot writing of integer type (dtype_i4) pbuf fields are incorrect.
cam_snapshot_common.F90::cam_pbuf_snapshot_all_outfld reads all pbuf fields into a real(r8) array but if the data is in dtype_i4 the data read into the arrays will not be correct:
subroutinecam_pbuf_snapshot_all_outfld(lchnk, file_num, pbuf)
use physics_buffer, only: pbuf_is_used
integer, intent(in) :: lchnk
integer, intent(in) :: file_num
type(physics_buffer_desc), pointer, intent(in) :: pbuf(:)
integer:: i, pbuf_idx, ndims
real(r8), pointer, dimension(:,:) :: tmpptr2d
real(r8), pointer, dimension(:,:,:) :: tmpptr3d
real(r8), pointer, dimension(:,:,:,:) :: tmpptr4d
real(r8), pointer, dimension(:,:,:,:,:) :: tmpptr5d
do i=1, npbuf_var
pbuf_idx= pbuf_get_index(pbuf_snapshot(i)%ddt_string)
...
! Retrieve the pbuf data (dependent on the number of dimensions)
ndims =count(pbuf_snapshot(i)%dim_name(:) /='')
select case (ndims) ! Note that dimension5 and 6do not work with pbuf_get_field, so these are not used here
case (1)
call pbuf_get_field(pbuf, pbuf_idx, tmpptr2d)
call outfld(pbuf_snapshot(i)%standard_name, tmpptr2d, pcols, lchnk)
...
What are the steps to reproduce the bug?
Observe saved snapshot files for pbuf fields that have dtype_i4, e.g.
! wg top level index of deep cumulus convection.
call pbuf_add_field('ZM_JT', 'physpkg', dtype_i4, (/pcols/), zm_jt_idx)
! wg gathered values of maxi.
call pbuf_add_field('ZM_MAXG', 'physpkg', dtype_i4, (/pcols/), zm_maxg_idx)
! map gathered points to chunk index
call pbuf_add_field('ZM_IDEEP', 'physpkg', dtype_i4, (/pcols/), zm_ideep_idx)
instead of actual values, the data is written incorrectly:
What happened?
Snapshot writing of integer type (
dtype_i4
) pbuf fields are incorrect.cam_snapshot_common.F90::cam_pbuf_snapshot_all_outfld
reads all pbuf fields into areal(r8)
array but if the data is indtype_i4
the data read into the arrays will not be correct:What are the steps to reproduce the bug?
Observe saved snapshot files for pbuf fields that have
dtype_i4
, e.g.instead of actual values, the data is written incorrectly:
What CAM tag were you using?
cam6_4_047
What machine were you running CAM on?
CISL machine (e.g. cheyenne)
What compiler were you using?
Intel
Path to a case directory, if applicable
No response
Will you be addressing this bug yourself?
Any CAM SE can do this
Extra info
No response
The text was updated successfully, but these errors were encountered: