41 real(dp),
allocatable :: G1(:,:),G2(:,:),G3(:,:),&
42 Cm1(:,:),Cm2(:,:),Cm3(:,:),&
43 Cd1(:,:),Cd2(:,:),Cd3(:,:),&
44 mprior(:),dobs(:),mtrue(:)
45 real(dp),
allocatable :: U1(:,:),U2(:,:),U3(:,:),&
46 iUCm1(:,:),iUCm2(:,:),iUCm3(:,:),&
47 iUCmGtiCd1(:,:),iUCmGtiCd2(:,:),iUCmGtiCd3(:,:),&
49 character(len=1024) :: inpfile,outfile
50 integer :: nm,nd,nm1,nm2,nm3,nd1,nd2,nd3
51 real(dp),
allocatable :: postm(:),postcov(:,:),postcov_diag(:,:)
52 real(dp),
allocatable :: bandpostC(:,:)
53 integer :: i1,i2,j1,j2, lowdiag, updiag
54 real(dp) :: start,finish
57 character(len=256) :: simname
63 call get_command_argument(iar, simname)
65 inpfile = trim(simname)//
'.h5' 66 outfile = trim(simname)//
'_output.h5' 68 print*,
"inpfile:",trim(inpfile)
69 print*,
"outfile:",trim(outfile)
74 print*,
'reading input arrays' 114 print*,
"M:",nm1,nm2,nm3,nm
115 print*,
"D:",nd1,nd2,nd3,nd
119 print*,
'Allocating working arrays' 120 allocate(u1(nm1,nm1),u2(nm2,nm2),u3(nm3,nm3))
121 allocate(invlambda(nm))
122 allocate(iucm1(nm1,nm1),iucm2(nm2,nm2),iucm3(nm3,nm3))
123 allocate(iucmgticd1(nm1,nd1),iucmgticd2(nm2,nd2),iucmgticd3(nm3,nd3))
126 print*,
'Computing the factors for post mean and covariance' 127 call calcfactors(g1,g2,g3,cm1,cm2,cm3,cd1,cd2,cd3,&
128 u1,u2,u3,invlambda,iucm1,iucm2,iucm3,&
129 iucmgticd1,iucmgticd2,iucmgticd3 )
151 print*,
'Computing post mean' 152 call posteriormean(u1,u2,u3, invlambda, iucmgticd1,iucmgticd2,iucmgticd3,&
153 g1,g2,g3,mprior,dobs, postm )
154 call cpu_time(finish)
155 print*,
'postm time:',finish-start
subroutine writereal1darrh5(outfile, dsetname, arr)
Module to read and write HDF5 files.
subroutine, public calcfactors(G1, G2, G3, Cm1, Cm2, Cm3, Cd1, Cd2, Cd3, U1, U2, U3, diaginvlambda, iUCm1, iUCm2, iUCm3, iUCmGtiCd1, iUCmGtiCd2, iUCmGtiCd3)
Computes the factors necessary to solve the inverse problem.
subroutine readreal2darrh5(inpfile, dsetname, arr)
program test
Test program for KronLinInv.
subroutine writereal2darrh5(outfile, dsetname, arr)
subroutine, public posteriormean(U1, U2, U3, diaginvlambda, Z1, Z2, Z3, G1, G2, G3, mprior, dobs, postm)
Computes the posterior mean
This file contains the parallel OpenMPI (distributed memory) version of KronLinInv. OpenMPI and LAPACK libraries are required to be installed in the system.
Procedures to perform linear inversion under gaussian assumptions using the Kronecker-product approac...
subroutine readreal1darrh5(inpfile, dsetname, arr)