34 integer,
parameter :: rk=(kind(1.0d0))
39 integer :: i,counter,radius,nnz
40 integer,
parameter :: n = 426655238
41 integer,
allocatable,
dimension(:) :: row,col
42 real(kind=rk),
allocatable,
dimension(:) :: val
43 integer :: ne,iter,day,tag,mpi_err,days
44 integer :: mpi_status(mpi_status_size)
45 real(kind=rk),
dimension(state_dim) :: x
46 real(kind=rk) :: start_t,end_t
48 stop
'IS GENQ DESIGNED FOR THIS SPECIFIC MODEL??'
50 allocate(pf%mean(state_dim),row(n),col(n),val(n))
51 print*,
'Going to generate Q ~ the model error covariance matrix'
80 print*,
'and it took ',end_t-start_t,
' seconds'
88 print*,
'first recv...'
89 call mpi_recv(pf%psi(:,1), state_dim, mpi_double_precision, &
90 0, tag, cpl_mpi_comm,mpi_status, mpi_err)
91 print*,
'.............recvd'
100 call mpi_send(pf%psi(:,1), state_dim , mpi_double_precision, &
101 0, tag, cpl_mpi_comm, mpi_err)
102 print*,
'iter = ',iter
103 call mpi_recv(pf%psi(:,1), state_dim, mpi_double_precision, &
104 0, tag, cpl_mpi_comm,mpi_status, mpi_err)
107 print*,
'72 model runs on ',day,
' took ',end_t-start_t,
' seconds'
109 pf%mean = pf%mean + pf%psi(:,1)
114 start_t = mpi_wtime()
118 print*,
'finished genQ_order at the end of the day with ne = ',ne
120 print*,
'generating Q on ',day,
' took ',end_t-start_t,
' seconds.'
127 val = val/
real(days-1,rk)
131 pf%mean = pf%mean/
real(days,rk)
142 print*,
'MAXIMUM COVARIANCE VALUE = ',maxval(val)
143 print*,
'MIMINUM COVARIANCE VALUE = ',minval(val)
144 print*,
'MINIMUM ABSOLUTE C VALUE = ',minval(abs(val))
153 call mpi_send(pf%psi(:,1), state_dim , mpi_double_precision, &
154 0, tag, cpl_mpi_comm, mpi_err)
168 if(row(i) .eq. col(i) .or. abs(val(i)) .gt. 1.0d-13) nnz = nnz + 1
171 open(2,file=
'Qdata.dat',action=
'write',status=
'replace',form=
'unformatted')
176 if(row(i) .eq. col(i) .or. abs(val(i)) .gt. 1.0d-13)
write(2) val(i)
179 if(row(i) .eq. col(i) .or. abs(val(i)) .gt. 1.0d-13)
write(2) row(i)
182 if(row(i) .eq. col(i) .or. abs(val(i)) .gt. 1.0d-13)
write(2) col(i)
185 print*,
'finished generating Q'
187 deallocate(pf%mean,row,col,val)
Module containing EMPIRE coupling data.
Module that stores the dimension of observation and state spaces.
module pf_control holds all the information to control the the main program
subroutine genq
Subroutine to estimate Q from a long model run.