Skip to content

Commit

Permalink
fix #52, making modtimedepsv allocations consistent with modtimedep a…
Browse files Browse the repository at this point in the history
…nd removing redundant broadcast
  • Loading branch information
Fredrik Jansson committed Aug 20, 2020
1 parent 7f86be4 commit e6dd89a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/modtimedepsv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ module modtimedepsv
logical :: ltimedepsvz = .false. !< Switch for large scale forcings
logical :: ltimedepsvsurf = .true. !< Switch for surface fluxes

integer, parameter :: kflux = 100
integer, parameter :: kls = 100
integer :: kflux
integer :: kls
real, allocatable :: timesvsurf (:)
real, allocatable :: svst (:,:) !< Time dependent surface scalar concentration

Expand All @@ -56,8 +56,9 @@ module modtimedepsv
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine inittimedepsv
use mpi
use modmpi, only :myid,my_real,mpi_logical,mpierr,comm3d
use modglobal,only :cexpnr,kmax,k1,ifinput,runtime,nsv
use modmpi, only :myid,my_real,mpi_logical,mpierr,comm3d
use modglobal, only :cexpnr,kmax,k1,ifinput,runtime,nsv
use modtestbed, only :ltestbed,ntnudge,tb_time
implicit none

character (80):: chmess
Expand All @@ -69,6 +70,14 @@ subroutine inittimedepsv

if (nsv==0 .or. .not.ltimedepsv ) return

if (ltestbed) then
kflux = ntnudge
kls = ntnudge
else
kflux = 10000
kls = 10000
end if

allocate(height(k1))
allocate(timesvsurf (0:kflux))
allocate(svst (kflux,nsv))
Expand Down Expand Up @@ -150,7 +159,6 @@ subroutine inittimedepsv


call MPI_BCAST(timesvsurf(1:kflux),kflux,MY_REAL,0,comm3d,mpierr)
call MPI_BCAST(timesvz(1:kflux),kflux,MY_REAL,0,comm3d,mpierr)
call MPI_BCAST(svst ,kflux*nsv,MY_REAL,0,comm3d,mpierr)
call MPI_BCAST(timesvz(1:kls) ,kls,MY_REAL ,0,comm3d,mpierr)
call MPI_BCAST(ltimedepsvsurf ,1,MPI_LOGICAL,0,comm3d,mpierr)
Expand Down

0 comments on commit e6dd89a

Please sign in to comment.