34 use comms, only : pf_ens_size,pf_ens_comm,pf_ens_rank,pf_member_rank
37 integer,
parameter :: rk = kind(1.0d0)
38 real(kind=rk),
dimension(state_dim),
intent(in) :: mean
40 real(kind=rk),
dimension(state_dim) :: sum_perts
41 real(kind=rk),
dimension(state_dim) :: variance
44 character(256) :: filename
49 sum_perts = sum_perts + (pf%psi(:,i) - mean)*(pf%psi(:,i) - mean)
53 call mpi_reduce(sum_perts,variance,state_dim,mpi_double_precision,mpi_sum&
54 &,pf_ens_size-1,pf_ens_comm,mpi_err)
57 variance = variance/(pf%nens-1)
59 if(pf_ens_rank .eq. pf_ens_size -1)
then
61 if(pf%timestep .eq. 0)
then
62 write(filename,
'(A,i0)')
'ensemble_variance_',pf_member_rank
63 open(unit_variance,file=trim(filename),iostat=ios,action=
'write',status=
'replace')
65 write(emp_e,*)
'PARTICLE FILTER DATA ERROR!!!!! Cannot open &
67 write(emp_e,*)
'Very strange that I couldnt open it. Im goin&
73 write(unit_variance,*) variance
75 if(tsdata%completed_timesteps .eq. tsdata%total_timesteps)
close(unit_variance)
Module containing EMPIRE coupling data.
Module that stores the information about the outputting from empire.
Module that stores the information about the timestepping process.
Module that stores the dimension of observation and state spaces.
subroutine output_variance(mean)
subroutine to output ensemble variance
module pf_control holds all the information to control the the main program