Skip to content

Commit

Permalink
Update code to fix Cray-related compiler issues
Browse files Browse the repository at this point in the history
* Use assumed shape / volatile arrays with ext libs
* Replace timestep multiple check with mod operator
  • Loading branch information
rcabell committed Oct 12, 2023
1 parent d58ae32 commit 7c589c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Land_models/NoahMP/IO_code/module_hrldas_netcdf_io.F
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ subroutine read_hrldas_hdrinfo(wrfinput_flnm, ix, jx, &
real, pointer, dimension(:,:) :: dum2d_ptr
#endif
integer, volatile :: ncid, dimid, varid, ierr
real, allocatable, dimension(:,:) :: dum2d
real, allocatable, dimension(:,:), volatile :: dum2d
character(len=256) :: units
integer :: i
integer :: rank
Expand Down Expand Up @@ -1320,7 +1320,7 @@ subroutine get_2d_netcdf(name, ncid, array, units, xstart, xend, ystart, yend, &
integer, intent(in) :: ncid
integer, intent(in) :: xstart, xend, ystart, yend
#ifdef MPP_LAND
real, dimension(xstart:xend,ystart:yend), intent(inout) :: array
real, dimension(:,:), intent(inout) :: array
#else
real, dimension(xstart:xend,ystart:yend), intent(out) :: array
#endif
Expand All @@ -1332,7 +1332,7 @@ subroutine get_2d_netcdf(name, ncid, array, units, xstart, xend, ystart, yend, &
logical, intent(in) :: fatal_if_error
integer, intent(out), volatile :: ierr
#ifdef MPP_LAND
real:: g_array(global_nx,global_ny)
real, volatile :: g_array(global_nx,global_ny)
#endif
ierr = 0
Expand Down
4 changes: 2 additions & 2 deletions src/OrchestratorLayer/config.f90
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,11 @@ subroutine init_namelist_rt_field(did)
print*, "reset DTRT_TER=nlst(did)%DT "
DTRT_TER=nlst(did)%DT
endif
if(nlst(did)%DT/DTRT_TER .ne. real(int(nlst(did)%DT) / int(DTRT_TER)) ) then
if (modulo(nlst(did)%DT, DTRT_TER) /= 0) then
print*, "nlst(did)%DT, DTRT_TER = ",nlst(did)%DT, DTRT_TER
call hydro_stop("module_namelist: DT not a multiple of DTRT_TER")
endif
if(nlst(did)%DT/DTRT_CH .ne. real(int(nlst(did)%DT) / int(DTRT_CH)) ) then
if (modulo(nlst(did)%DT, DTRT_CH) /= 0) then
print*, "nlst(did)%DT, DTRT_CH = ",nlst(did)%DT, DTRT_CH
call hydro_stop("module_namelist: DT not a multiple of DTRT_CH")
endif
Expand Down

0 comments on commit 7c589c9

Please sign in to comment.