Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/dynamics/none/dyn_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ subroutine model_grid_init()
use pio, only: PIO_BCAST_ERROR, pio_seterrorhandling
use pio, only: pio_get_var, pio_freedecomp
use pio, only: pio_read_darray
use pio, only: pio_inq_vartype, PIO_NOERR
use spmd_utils, only: npes, iam
use cam_pio_utils, only: cam_pio_handle_error, cam_pio_find_var
use cam_pio_utils, only: cam_pio_var_info, pio_subsystem
Expand Down Expand Up @@ -107,6 +108,7 @@ subroutine model_grid_init()
character(len=8) :: lat_dim_name
character(len=8) :: lon_dim_name
character(len=128) :: errormsg
integer :: xtype

character(len=*), parameter :: subname = 'model_grid_init'

Expand Down Expand Up @@ -225,6 +227,22 @@ subroutine model_grid_init()
'eastward_wind' /), &
fieldname, vardesc, var_found)
if (var_found) then
! Check that snapshot file has 64-bit floats (ndens=1).
! Running with 32-bit (FLOAT32) snapshots will definitely cause
! answer differences between CAM-SIMA and the CAM snapshot
! leading to wasted debugging time, so disallow this configuration:
iret = pio_inq_vartype(fh_ini, vardesc, xtype)
if (iret /= PIO_NOERR) then
call endrun(subname//': Unable to inquire variable type for '// &
trim(fieldname))
end if
if (xtype /= PIO_DOUBLE) then
call endrun(subname//': Snapshot file has non-FLOAT64 data '// &
'(variable '//trim(fieldname)//'). '// &
'This will cause answer differences! '// &
'Please rerun CAM with ndens = 1 to write 64-bit float '// &
'snapshots for use with CAM-SIMA.')
end if
! Find the variable dimension info
dimnames = ''
dimids = -1
Expand Down
Loading