35 character(30) :: prefix
41 integer :: output_type
64 character(30) :: prefix
66 logical :: analysis=.false.
67 logical :: frequency=.false.
68 integer :: output_type=0
69 logical :: file_exists
71 namelist/mat_pf/k,analysis,frequency,prefix,output_type
73 inquire(file=
'pf_parameters.dat',exist=file_exists)
75 open(unit_nml,file=
'pf_parameters.dat',iostat=ios,action=
'read'&
78 write(emp_e,*)
'Cannot open pf_parameters.dat'
82 inquire(file=
'empire.nml',exist=file_exists)
84 open(unit_nml,file=
'empire.nml',iostat=ios,action=
'read'&
87 write(emp_e,*)
'Cannot open empire.nml'
91 write(emp_e,*)
'ERROR: cannot find pf_parameters.dat or empire.nml'
96 read(unit_nml,nml=mat_pf,iostat=ios)
100 print*,
'mat_pf not found in namelist file.'
101 print*,
'no matrix_pf information will be computed'
104 matpf%prefix=trim(prefix)
105 matpf%analysis = analysis
106 matpf%frequency= frequency
107 matpf%output_type=output_type
112 write(emp_e,*)
'ERROR: k in matrix_pf_data read in less than 1'
113 write(emp_e,*)
'ERROR: k should be a natural number'
114 write(emp_e,*)
'STOPPING'
119 print*,
'matpf=',matpf
127 integer,
parameter :: rk = kind(1.0d0)
128 integer,
intent(in) :: root
129 integer,
intent(in) :: comm
131 integer,
intent(in) :: n
132 integer,
intent(in) :: m
133 real(kind=rk),
dimension(n,m) :: x
134 integer,
intent(in) :: time
135 logical,
intent(in) :: is_analysis
137 character(40) :: filename
138 logical :: actually_output=.false.
139 real(kind=rk),
dimension(n*(n+1)/2) :: pf
140 integer :: rank,mpi_err
142 actually_output = .false.
145 if(matpf%analysis .and. is_analysis) actually_output = .true.
147 if(matpf%frequency .and. mod(time,matpf%k) .eq. 0) actually_output=.true.
149 if(matpf%k .gt. 0) print*,
'hello: mod(time,matpf%k) = ',mod(time,matpf%k)
151 if(actually_output)
then
153 write(filename,
'(A,i10.10)') trim(matpf%prefix),time
157 call mpi_comm_rank(comm,rank,mpi_err)
158 if(rank .eq. root) call
output_mat_tri(n,pf,filename,matpf%output_type)
module to deal with generating and outputting pf matrix
Module that stores the information about the outputting from empire.
subroutine read_matrix_pf_information
subroutine to read namelist to control this output
subroutine matrix_pf_output(root, comm, n, m, x, time, is_analysis)
subroutine to generate and output matrix Pf
subroutine output_mat_tri(n, A, filename, output_type)
subroutine to output triangluar matrix various formats
subroutine generate_pf(stateDim, cnt, comm, x, pf)
subroutine to generate Pf matrix given ensemble members on a communicator
subroutine k(y, x)
Subroutine to apply to a vector y in observation space where .