subroutine initdriver use modglobal, only : ih,ib,ie,jh,jb,je,kb,ke,kh,jhc,khc,idriver,lchunkread,chunkread_size,iplane,xf,lstoreplane,nstore,Uinf,ltempeq,lmoist,pi,zf,zh,driverstore,tdriverstart,tdriverdump,timeleft,dtdriver,nsv,timee,lhdriver,lqdriver,lsdriver,ibrank,iplanerank,driverid,cdriverid use modfields, only : um use modmpi, only : myid,nprocs,myidy,nprocy use decomp_2d, only : zstart, zend implicit none real :: pfi, epsi integer :: k if (idriver==1) then ! if (tdriverstart < timee) then ! write(0, *) 'ERROR: tdriverstart must be greater than the elapsed time at the start of the simulation' ! stop 1 ! end if tdriverdump = tdriverstart if ((iplane >= zstart(1)) .and. (iplane <= zend(1))) then iplanerank = .true. irecydriver = iplane-zstart(1)+1 end if endif driverid = mod(myidy, nprocy) write(cdriverid,'(i3.3)') driverid if (idriver==1 .and. iplanerank) then allocate(storetdriver(1:driverstore)) allocate(storeu0driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storeumdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storev0driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storevmdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storew0driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storewmdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) !allocate(storee120driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) !allocate(storee12mdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) if (ltempeq ) then allocate(storethl0driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storethlmdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) end if if (lmoist ) then allocate(storeqt0driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storeqtmdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) end if if (nsv>0 ) then allocate(storesv0driver(jb-jhc:je+jhc,kb-khc:ke+khc,1:nsv,1:driverstore)) allocate(storesvmdriver(jb-jhc:je+jhc,kb-khc:ke+khc,1:nsv,1:driverstore)) end if else if (idriver == 2 .and. ibrank) then allocate(storetdriver(1:driverstore)) if (.not.(lchunkread)) then allocate(storeu0driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storeumdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storev0driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storevmdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storew0driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storewmdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) !allocate(storee120driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) !allocate(storee12mdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(u0driver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(v0driver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(u0driverrot(jb-jh:je+jh,kb-kh:ke+kh)) allocate(v0driverrot(jb-jh:je+jh,kb-kh:ke+kh)) allocate(w0driver(jb-jh:je+jh,kb-kh:ke+kh)) !allocate(e120driver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(umdriver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(vmdriver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(wmdriver(jb-jh:je+jh,kb-kh:ke+kh)) !allocate(e12mdriver(jb-jh:je+jh,kb-kh:ke+kh)) if (ltempeq .and. lhdriver) then allocate(storethl0driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storethlmdriver(jb-jh:je+kh,kb-kh:ke+kh,1:driverstore)) allocate(thl0driver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(thlmdriver(jb-jh:je+jh,kb-kh:ke+kh)) end if if (lmoist .and. lqdriver) then allocate(storeqt0driver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(storeqtmdriver(jb-jh:je+jh,kb-kh:ke+kh,1:driverstore)) allocate(qt0driver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(qtmdriver(jb-jh:je+jh,kb-kh:ke+kh)) end if if (nsv>0 .and. lsdriver) then allocate(storesv0driver(jb-jhc:je+jhc,kb-khc:ke+khc,1:nsv,1:driverstore)) allocate(storesvmdriver(jb-jhc:je+jhc,kb-khc:ke+khc,1:nsv,1:driverstore)) allocate(sv0driver(jb-jhc:je+jhc,kb-khc:ke+khc,1:nsv)) allocate(svmdriver(jb-jhc:je+jhc,kb-khc:ke+khc,1:nsv)) end if else ! if(lchunkread) allocate(storeu0driver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) allocate(storeumdriver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) allocate(storev0driver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) allocate(storevmdriver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) allocate(storew0driver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) allocate(storewmdriver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) !allocate(storee120driver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) !allocate(storee12mdriver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) allocate(u0driver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(v0driver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(u0driverrot(jb-jh:je+jh,kb-kh:ke+kh)) allocate(v0driverrot(jb-jh:je+jh,kb-kh:ke+kh)) allocate(w0driver(jb-jh:je+jh,kb-kh:ke+kh)) !allocate(e120driver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(umdriver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(vmdriver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(wmdriver(jb-jh:je+jh,kb-kh:ke+kh)) !allocate(e12mdriver(jb-jh:je+jh,kb-kh:ke+kh)) if (ltempeq .and. lhdriver) then allocate(storethl0driver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) allocate(storethlmdriver(jb-jh:je+kh,kb-kh:ke+kh,0:chunkread_size)) allocate(thl0driver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(thlmdriver(jb-jh:je+jh,kb-kh:ke+kh)) end if if (lmoist .and. lqdriver) then allocate(storeqt0driver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) allocate(storeqtmdriver(jb-jh:je+jh,kb-kh:ke+kh,0:chunkread_size)) allocate(qt0driver(jb-jh:je+jh,kb-kh:ke+kh)) allocate(qtmdriver(jb-jh:je+jh,kb-kh:ke+kh)) end if if (nsv>0 .and. lsdriver) then allocate(storesv0driver(jb-jhc:je+jhc,kb-khc:ke+khc,1:nsv,0:chunkread_size)) allocate(storesvmdriver(jb-jhc:je+jhc,kb-khc:ke+khc,1:nsv,0:chunkread_size)) allocate(sv0driver(jb-jhc:je+jhc,kb-khc:ke+khc,1:nsv)) allocate(svmdriver(jb-jhc:je+jhc,kb-khc:ke+khc,1:nsv)) end if end if else return end if end subroutine initdriver