Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
16 changes: 9 additions & 7 deletions src/6.3.02/io/history_start.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ Subroutine history_start ()

implicit none

integer :: maxarr,ngr
integer :: ngr
integer(kind=8) :: maxarr
integer :: ifm,icm

! Find maximum size of any array on history file. Allocate scratch array of
! this size.

maxarr=0
do ngr=1,ngridsh
maxarr=max(maxarr,mmxp(ngr)*mmyp(ngr)*mmzp(ngr) &
,mmxp(ngr)*mmyp(ngr)*nzg*npatch &
,mmxp(ngr)*mmyp(ngr)*nzs*npatch &
,mmxp(ngr)*mmyp(ngr)*mmzp(ngr)*nkr &
,mmxp(ngr)*mmyp(ngr)*nkppz)
maxarr=max(INT(maxarr,8),INT(mmxp(ngr),8)*INT(mmyp(ngr),8)*INT(mmzp(ngr),8) &
,INT(mmxp(ngr),8)*INT(mmyp(ngr),8)*INT(nzg,8)*INT(npatch,8) &
,INT(mmxp(ngr),8)*INT(mmyp(ngr),8)*INT(nzs,8)*INT(npatch,8) &
,INT(mmxp(ngr),8)*INT(mmyp(ngr),8)*INT(mmzp(ngr),8)*INT(nkr,8) &
,INT(mmxp(ngr),8)*INT(mmyp(ngr),8)*INT(nkppz,8))
enddo

! read stuff here
Expand Down Expand Up @@ -171,7 +172,8 @@ Subroutine hist_read (maxarr,hnamein)

implicit none

integer :: maxarr,checkhist
integer :: checkhist
integer(kind=8) :: maxarr
character(len=*) :: hnamein

integer :: ngr,npts,nc,nv,nvh,ndims,idims(4)
Expand Down
11 changes: 6 additions & 5 deletions src/6.3.02/io/inithis.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ Subroutine inithis (inithisflg)
implicit none

integer :: ngrids1,nzg1,nzs1,npatch1,nvegpat1,ierr,ng,nc &
,ie,maxarr1,maxarr2,ngr,maxx1,maxy1,maxz1,npts,nv,nvh,nzpg1 &
,ie,ngr,maxx1,maxy1,maxz1,npts,nv,nvh,nzpg1 &
,iyearh,imonthh,idateh,itimeh,ihtran1,checkhist,inithisflg,goahead
integer(kind=8):: maxarr1, maxarr2
integer, external :: cio_i,cio_f
integer,save :: iunhd=11
integer, allocatable, dimension(:) :: nnxp1,nnyp1,nnzp1
Expand Down Expand Up @@ -182,10 +183,10 @@ Subroutine inithis (inithisflg)
maxy1=maxval(nnyp1(1:ngrids1))
maxz1=maxval(nnzp1(1:ngrids1))
do ngr=1,ngrids1
maxarr1=max(maxarr1,nnxp1(ngr)*nnyp1(ngr)*nnzp1(ngr)*nkr &
,nnxp1(ngr)*nnyp1(ngr)*nzg1*npatch1 &
,nnxp1(ngr)*nnyp1(ngr)*nzs1*npatch1)
maxarr2=max(maxarr2,nnxp1(ngr)*nnyp1(ngr))
maxarr1=max(INT(maxarr1,8),INT(nnxp1(ngr),8)*INT(nnyp1(ngr),8)*INT(nnzp1(ngr)*nkr,8) &
,INT(nnxp1(ngr),8)*INT(nnyp1(ngr),8)*INT(nzg1,8)*INT(npatch1,8) &
,INT(nnxp1(ngr),8)*INT(nnyp1(ngr),8)*INT(nzs1,8)*INT(npatch1,8))
maxarr2=max(INT(maxarr2,8),INT(nnxp1(ngr),8)*INT(nnyp1(ngr),8))
enddo
allocate (scr(maxarr1),scr1(maxarr1))

Expand Down
7 changes: 4 additions & 3 deletions src/6.3.02/isan/asgen.f90
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,9 @@ Subroutine hvfiles (nnud,checkhist)
implicit none

integer :: nnud,ngrids1,nzg1,nzs1,npatch1,nvegpat1,ierr,ng,nc &
,ie,maxarr1,maxarr2,ngr,maxx1,maxy1,maxz1,npts,nv &
,ie,ngr,maxx1,maxy1,maxz1,npts,nv &
,ihtran1,nzpg1,checkhist,nvloopstart,dim_type
integer(kind=8) :: maxarr1, maxarr2
integer, external :: cio_i,cio_f
integer,save :: iunhd=11
integer, allocatable, dimension(:) :: nnxp1,nnyp1,nnzp1
Expand Down Expand Up @@ -648,8 +649,8 @@ Subroutine hvfiles (nnud,checkhist)
maxy1=maxval(nnyp1(1:ngrids1))
maxz1=maxval(nnzp1(1:ngrids1))
do ngr=1,ngrids1
maxarr1=max(maxarr1,nnxp1(ngr)*nnyp1(ngr)*nnzp1(ngr))
maxarr2=max(maxarr2,nnxp1(ngr)*nnyp1(ngr))
maxarr1=max(maxarr1,INT(nnxp1(ngr),8)*INT(nnyp1(ngr),8)*INT(nnzp1(ngr),8))
maxarr2=max(maxarr2,INT(nnxp1(ngr),8)*INT(nnyp1(ngr),8))
enddo
allocate (scr(maxarr1),scr1(maxarr1))

Expand Down
2 changes: 1 addition & 1 deletion src/6.3.02/memory/grid_dims.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Module grid_dims
,maxvars = 1000 & ! Max # of variables (3d + 2d + leaf)
,maxrec = 1000 & ! Max record length (lines) of namelists
,maxvalues = 300 & ! Max # of tokens to be read in from namelists
,maxmach = 2048 & ! Max # of parallel processors
,maxmach = 20480 & ! Max # of parallel processors
,maxlite = 99 & ! Max # of lite variables
,maxsstfiles = 2000 & ! Max # of SST total files
,maxndvifiles = 2000 & ! Max # of NDVI total files
Expand Down