From 0f736c1850d8fdded003a2c773df1ebe6f508b0a Mon Sep 17 00:00:00 2001 From: Sean William Freeman Date: Tue, 29 Nov 2022 12:19:03 -0800 Subject: [PATCH] updates to maxmachs and for large domains --- src/6.3.02/io/history_start.f90 | 16 +++++++++------- src/6.3.02/io/inithis.f90 | 11 ++++++----- src/6.3.02/isan/asgen.f90 | 7 ++++--- src/6.3.02/memory/grid_dims.f90 | 2 +- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/6.3.02/io/history_start.f90 b/src/6.3.02/io/history_start.f90 index dc46538..2ac42d1 100644 --- a/src/6.3.02/io/history_start.f90 +++ b/src/6.3.02/io/history_start.f90 @@ -12,7 +12,8 @@ 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 @@ -20,11 +21,11 @@ Subroutine history_start () 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 @@ -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) diff --git a/src/6.3.02/io/inithis.f90 b/src/6.3.02/io/inithis.f90 index 4732c9f..41eb998 100644 --- a/src/6.3.02/io/inithis.f90 +++ b/src/6.3.02/io/inithis.f90 @@ -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 @@ -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)) diff --git a/src/6.3.02/isan/asgen.f90 b/src/6.3.02/isan/asgen.f90 index bfb6cf5..03c4a08 100644 --- a/src/6.3.02/isan/asgen.f90 +++ b/src/6.3.02/isan/asgen.f90 @@ -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 @@ -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)) diff --git a/src/6.3.02/memory/grid_dims.f90 b/src/6.3.02/memory/grid_dims.f90 index 71cd64f..433e08c 100644 --- a/src/6.3.02/memory/grid_dims.f90 +++ b/src/6.3.02/memory/grid_dims.f90 @@ -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