subroutine exitdriver
use modglobal, only : idriver,lstoreplane,ltempeq,lmoist,nsv,lsdriver
if (idriver==1) then
if (lstoreplane ) then
deallocate(storetdriver,storeu0driver,storev0driver,storew0driver)!,storee120driver)
if (ltempeq ) then
deallocate(storethl0driver)
end if
if (lmoist ) then
deallocate(storeqt0driver)
end if
if (nsv>0 ) then
deallocate(storesv0driver)
end if
end if
else if (idriver == 2) then
deallocate(storetdriver, storeu0driver,storev0driver,storew0driver,u0driver,v0driver,w0driver) !,e120driver,storee120driver)
if (ltempeq ) then
deallocate(storethl0driver,thl0driver)
end if
if (lmoist ) then
deallocate(storeqt0driver,qt0driver)
end if
if (nsv>0 .and. lsdriver) then
deallocate(storesv0driver,sv0driver)
end if
end if
end subroutine exitdriver