26 REAL(KIND=8),
DIMENSION(:),
ALLOCATABLE,
PUBLIC ::
mean 27 REAL(KIND=8),
DIMENSION(:),
ALLOCATABLE,
PUBLIC ::
mean_full 28 REAL(KIND=8),
DIMENSION(:,:),
ALLOCATABLE,
PUBLIC ::
corr_i_full 30 REAL(KIND=8),
DIMENSION(:,:),
ALLOCATABLE,
PUBLIC ::
corr_i 31 REAL(KIND=8),
DIMENSION(:,:),
ALLOCATABLE,
PUBLIC ::
inv_corr_i 32 REAL(KIND=8),
DIMENSION(:,:),
ALLOCATABLE,
PUBLIC ::
corr_ij 33 REAL(KIND=8),
DIMENSION(:,:,:),
ALLOCATABLE ::
y2 34 REAL(KIND=8),
DIMENSION(:,:,:),
ALLOCATABLE ::
ya 35 REAL(KIND=8),
DIMENSION(:),
ALLOCATABLE ::
xa 46 INTEGER :: AllocStat,i,j,k,nf
47 REAL(KIND=8),
DIMENSION(5) :: dumb
55 INQUIRE(file=
'corrspline.def',exist=ex)
56 IF (.not.ex) stop
"*** File corrspline.def not found ! ***" 57 OPEN(20,file=
'corrspline.def',status=
'old')
59 IF (nf /=
n_unres) stop
"*** Dimension in files corrspline.def and sf.nml do not correspond ! ***" 61 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 74 INQUIRE(file=
'correxpo.def',exist=ex)
75 IF (.not.ex) stop
"*** File correxpo.def not found ! ***" 76 OPEN(20,file=
'correxpo.def',status=
'old')
78 IF (nf /=
n_unres) stop
"*** Dimension in files correxpo.def and sf.nml do not correspond ! ***" 80 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 88 stop
'*** LOAD_MODE variable not properly defined in corrmod.nml ***' 92 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 95 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 98 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 101 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 104 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 107 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 130 INQUIRE(file=
'mean.def',exist=ex)
132 OPEN(20,file=
'mean.def',status=
'old')
148 REAL(KIND=8),
INTENT(IN) :: s
154 corr_ij(10,10)=((7.66977252307669*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (1.0240906173830213*cos(&
155 &0.07283568782600224*s))/exp(0.017262015588746404*s) - (0.6434985372062336*sin(0.039597160512071454*s&
156 &))/exp(0.06567483898489704*s) + (0.6434985372062335*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
157 corr_ij(10,9)=((0.6434985372062321*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) - (0.6434985372062324*co&
158 &s(0.07283568782600224*s))/exp(0.017262015588746404*s) + (7.669772523076694*sin(0.039597160512071454*&
159 &s))/exp(0.06567483898489704*s) + (1.024090617383021*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
163 corr_ij(10,5)=((-2.236364132659011*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (6.952804148086198*cos&
164 &(0.07283568782600224*s))/exp(0.017262015588746404*s) - (1.4494534432272481*sin(0.039597160512071454*&
165 &s))/exp(0.06567483898489704*s) - (0.6818177416446283*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
166 corr_ij(10,4)=((1.4494534432272483*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (0.6818177416446293*co&
167 &s(0.07283568782600224*s))/exp(0.017262015588746404*s) - (2.2363641326590127*sin(0.039597160512071454&
168 &*s))/exp(0.06567483898489704*s) + (6.952804148086195*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
172 corr_ij(9,10)=((-0.6434985372062344*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (0.643498537206234*co&
173 &s(0.07283568782600224*s))/exp(0.017262015588746404*s) - (7.669772523076689*sin(0.039597160512071454*&
174 &s))/exp(0.06567483898489704*s) - (1.0240906173830204*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
175 corr_ij(9,9)=((7.66977252307669*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (1.0240906173830204*cos(&
176 &0.07283568782600224*s))/exp(0.017262015588746404*s) - (0.643498537206233*sin(0.039597160512071454*s)&
177 &)/exp(0.06567483898489704*s) + (0.6434985372062327*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
181 corr_ij(9,5)=((-1.4494534432272477*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) - (0.6818177416446249*c&
182 &os(0.07283568782600224*s))/exp(0.017262015588746404*s) + (2.2363641326590105*sin(0.03959716051207145&
183 &4*s))/exp(0.06567483898489704*s) - (6.952804148086195*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
184 corr_ij(9,4)=((-2.2363641326590127*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (6.952804148086194*co&
185 &s(0.07283568782600224*s))/exp(0.017262015588746404*s) - (1.4494534432272486*sin(0.039597160512071454&
186 &*s))/exp(0.06567483898489704*s) - (0.6818177416446249*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
193 corr_ij(8,8)=(9.135647293470983/exp(0.05076718239027029*s) + 2.2233889637758932/exp(0.016285467000648854*s))
198 corr_ij(8,3)=(-5.938566084855411/exp(0.05076718239027029*s) + 11.97129741027622/exp(0.016285467000648854*s))
205 corr_ij(7,7)=((11.518026982819887*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (0.05351107793747755*c&
206 &os(0.11425932545092894*s))/exp(0.019700737327669783*s) - (0.14054811601869432*sin(0.0293414097268719&
207 &26*s))/exp(0.04435489221745234*s) + (0.14054811601869702*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
208 corr_ij(7,6)=((0.14054811601869532*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) - (0.14054811601869702*&
209 &cos(0.11425932545092894*s))/exp(0.019700737327669783*s) + (11.518026982819887*sin(0.0293414097268719&
210 &26*s))/exp(0.04435489221745234*s) + (0.0535110779374777*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
214 corr_ij(7,2)=((-0.732907009016115*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (2.728845031386875*cos&
215 &(0.11425932545092894*s))/exp(0.019700737327669783*s) - (2.4717920234033532*sin(0.029341409726871926*&
216 &s))/exp(0.04435489221745234*s) - (0.24003801347124257*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
217 corr_ij(7,1)=((2.4717920234033532*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (0.2400380134712426*co&
218 &s(0.11425932545092894*s))/exp(0.019700737327669783*s) - (0.7329070090161153*sin(0.029341409726871926&
219 &*s))/exp(0.04435489221745234*s) + (2.728845031386876*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
224 corr_ij(6,7)=((-0.1405481160186977*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (0.14054811601869713*&
225 &cos(0.11425932545092894*s))/exp(0.019700737327669783*s) - (11.518026982819885*sin(0.0293414097268719&
226 &26*s))/exp(0.04435489221745234*s) - (0.05351107793747755*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
227 corr_ij(6,6)=((11.518026982819885*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (0.05351107793747768*c&
228 &os(0.11425932545092894*s))/exp(0.019700737327669783*s) - (0.14054811601869832*sin(0.0293414097268719&
229 &26*s))/exp(0.04435489221745234*s) + (0.14054811601869707*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
233 corr_ij(6,2)=((-2.471792023403353*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) - (0.2400380134712425*co&
234 &s(0.11425932545092894*s))/exp(0.019700737327669783*s) + (0.7329070090161155*sin(0.029341409726871926&
235 &*s))/exp(0.04435489221745234*s) - (2.7288450313868755*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
236 corr_ij(6,1)=((-0.7329070090161154*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (2.728845031386876*co&
237 &s(0.11425932545092894*s))/exp(0.019700737327669783*s) - (2.4717920234033524*sin(0.029341409726871926&
238 &*s))/exp(0.04435489221745234*s) - (0.24003801347124343*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
239 corr_ij(5,10)=((0.5794534449999711*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (4.136986570427212*cos&
240 &(0.07283568782600224*s))/exp(0.017262015588746404*s) - (1.0360597341248128*sin(0.039597160512071454*&
241 &s))/exp(0.06567483898489704*s) + (3.167330918996692*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
242 corr_ij(5,9)=((1.0360597341248134*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) - (3.1673309189966856*co&
243 &s(0.07283568782600224*s))/exp(0.017262015588746404*s) + (0.5794534449999746*sin(0.039597160512071454&
244 &*s))/exp(0.06567483898489704*s) + (4.1369865704272115*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
248 corr_ij(5,5)=((-0.37825091063447547*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (30.094690926061638*&
249 &cos(0.07283568782600224*s))/exp(0.017262015588746404*s) + (0.16085380971100194*sin(0.039597160512071&
250 &454*s))/exp(0.06567483898489704*s) - (0.1608538097109995*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
251 corr_ij(5,4)=((-0.16085380971100238*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (0.16085380971100127&
252 &*cos(0.07283568782600224*s))/exp(0.017262015588746404*s) - (0.37825091063447586*sin(0.03959716051207&
253 &1454*s))/exp(0.06567483898489704*s) + (30.09469092606163*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
257 corr_ij(4,10)=((-1.0360597341248106*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (3.167330918996689*co&
258 &s(0.07283568782600224*s))/exp(0.017262015588746404*s) - (0.5794534449999716*sin(0.039597160512071454&
259 &*s))/exp(0.06567483898489704*s) - (4.1369865704272115*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
260 corr_ij(4,9)=((0.5794534449999711*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (4.1369865704272115*co&
261 &s(0.07283568782600224*s))/exp(0.017262015588746404*s) - (1.0360597341248114*sin(0.039597160512071454&
262 &*s))/exp(0.06567483898489704*s) + (3.1673309189966843*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
266 corr_ij(4,5)=((0.16085380971100194*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) - (0.16085380971100371*&
267 &cos(0.07283568782600224*s))/exp(0.017262015588746404*s) + (0.37825091063447497*sin(0.039597160512071&
268 &454*s))/exp(0.06567483898489704*s) - (30.094690926061617*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
269 corr_ij(4,4)=((-0.37825091063447536*cos(0.039597160512071454*s))/exp(0.06567483898489704*s) + (30.094690926061617*&
270 &cos(0.07283568782600224*s))/exp(0.017262015588746404*s) + (0.16085380971100172*sin(0.039597160512071&
271 &454*s))/exp(0.06567483898489704*s) - (0.16085380971100616*sin(0.07283568782600224*s))/exp(0.017262015588746404*s))
278 corr_ij(3,8)=(0.24013456462471527/exp(0.05076718239027029*s) + 5.792596760796093/exp(0.016285467000648854*s))
283 corr_ij(3,3)=(-0.15609785880208227/exp(0.05076718239027029*s) + 31.18882918422289/exp(0.016285467000648854*s))
290 corr_ij(2,7)=((1.6172201305728584*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (0.37871789179790255*c&
291 &os(0.11425932545092894*s))/exp(0.019700737327669783*s) + (1.2889451151208258*sin(0.02934140972687192&
292 &6*s))/exp(0.04435489221745234*s) + (1.4228849217537705*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
293 corr_ij(2,6)=((-1.2889451151208255*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) - (1.4228849217537702*c&
294 &os(0.11425932545092894*s))/exp(0.019700737327669783*s) + (1.6172201305728586*sin(0.02934140972687192&
295 &6*s))/exp(0.04435489221745234*s) + (0.3787178917979035*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
299 corr_ij(2,2)=((0.1789135645266575*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (26.817024457844113*co&
300 &s(0.11425932545092894*s))/exp(0.019700737327669783*s) - (0.4268927977731004*sin(0.029341409726871926&
301 &*s))/exp(0.04435489221745234*s) + (0.4268927977730982*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
302 corr_ij(2,1)=((0.4268927977731007*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) - (0.42689279777309963*c&
303 &os(0.11425932545092894*s))/exp(0.019700737327669783*s) + (0.17891356452665746*sin(0.0293414097268719&
304 &26*s))/exp(0.04435489221745234*s) + (26.81702445784412*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
309 corr_ij(1,7)=((1.288945115120824*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (1.4228849217537711*cos&
310 &(0.11425932545092894*s))/exp(0.019700737327669783*s) - (1.617220130572856*sin(0.029341409726871926*s&
311 &))/exp(0.04435489221745234*s) - (0.3787178917979028*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
312 corr_ij(1,6)=((1.6172201305728564*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (0.37871789179790377*c&
313 &os(0.11425932545092894*s))/exp(0.019700737327669783*s) + (1.2889451151208242*sin(0.02934140972687192&
314 &6*s))/exp(0.04435489221745234*s) + (1.4228849217537711*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
318 corr_ij(1,2)=((-0.4268927977731002*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (0.4268927977730981*c&
319 &os(0.11425932545092894*s))/exp(0.019700737327669783*s) - (0.1789135645266573*sin(0.02934140972687192&
320 &6*s))/exp(0.04435489221745234*s) - (26.81702445784412*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
321 corr_ij(1,1)=((0.1789135645266574*cos(0.029341409726871926*s))/exp(0.04435489221745234*s) + (26.817024457844113*co&
322 &s(0.11425932545092894*s))/exp(0.019700737327669783*s) - (0.42689279777310024*sin(0.02934140972687192&
323 &6*s))/exp(0.04435489221745234*s) + (0.4268927977730997*sin(0.11425932545092894*s))/exp(0.019700737327669783*s))
333 REAL(KIND=8),
INTENT(IN) :: s
346 SUBROUTINE splint(xa,ya,y2a,n,x,y)
347 INTEGER,
INTENT(IN) :: n
348 REAL(KIND=8),
INTENT(IN),
DIMENSION(n) :: xa,y2a,ya
349 REAL(KIND=8),
INTENT(IN) :: x
350 REAL(KIND=8),
INTENT(OUT) :: y
352 REAL(KIND=8) :: a,b,h
353 if ((
khi-
klo.gt.1).or.(xa(
klo).gt.x).or.(xa(
khi).lt.x))
then 354 if ((
khi-
klo.eq.1).and.(xa(
klo).lt.x))
then 356 DO WHILE (xa(
khi).lt.x)
377 if (h.eq.0.) stop
'bad xa input in splint' 380 y=a*ya(
klo)+b*ya(
khi)+((a**3-a)*y2a(
klo)+(b**3-b)*y2a(
khi))*(h**2)/6.
388 REAL(KIND=8),
INTENT(IN) :: s
389 REAL(KIND=8),
DIMENSION(5),
INTENT(IN) :: p
391 fs=p(1)*exp(-s/p(2))*cos(p(3)*s+p(4))
399 REAL(KIND=8),
INTENT(IN) :: s
The stochastic models parameters module.
real(kind=8) q_au
Atmospheric unresolved component noise amplitude.
integer ndim
Number of variables (dimension of the model)
real(kind=8), dimension(:,:), allocatable, public corr_ij
Matrix holding the correlation matrix at a given time.
character(len=4) load_mode
Loading mode for the correlations.
real(kind=8), dimension(:,:), allocatable, public corr_i_full
Covariance matrix of the unresolved variables (full version)
real(kind=8), dimension(:,:,:), allocatable y2
Vector holding coefficient of the spline and exponential correlation representation.
real(kind=8) q_or
Oceanic resolved component noise amplitude.
real(kind=8), dimension(:), allocatable, public mean_full
Vector holding the mean of the unresolved dynamics (full version)
subroutine corrcomp_from_spline(s)
Subroutine to compute the correlation of the unresolved variables at time from the spline represent...
subroutine corrcomp_from_fit(s)
Subroutine to compute the correlation of the unresolved variables at time from the exponential repr...
subroutine, public init_corr
Subroutine to initialise the computation of the correlation.
real(kind=8), dimension(:), allocatable, public mean
Vector holding the mean of the unresolved dynamics (reduced version)
character(len=4) int_corr_mode
Correlation integration mode.
real(kind=8), dimension(:), allocatable xa
Vector holding coefficient of the spline and exponential correlation representation.
real(kind=8) q_ou
Oceanic unresolved component noise amplitude.
real(kind=8), dimension(:,:), allocatable, public inv_corr_i_full
Inverse of the covariance matrix of the unresolved variables (full version)
real(kind=8), dimension(:,:,:), allocatable ya
Vector holding coefficient of the spline and exponential correlation representation.
subroutine corrcomp_from_def(s)
Subroutine to compute the correlation of the unresolved variables at time from the definition given...
integer, public n_unres
Number of unresolved variables.
real(kind=8) function, dimension(size(a, 1), size(a, 2)), public invmat(A)
Module to initialize the correlation matrix of the unresolved variables.
real(kind=8), dimension(:,:), allocatable, public corr_i
Covariance matrix of the unresolved variables (reduced version)
integer, dimension(:), allocatable, public ind
procedure(corrcomp_from_spline), pointer, public corrcomp
Pointer to the correlation computation routine.
The model parameters module.
subroutine splint(xa, ya, y2a, n, x, y)
Routine to compute the spline representation parameters.
real(kind=8) maxint
Upper integration limit of the correlations.
integer nspl
Integers needed by the spline representation of the correlation.
Module to select the resolved-unresolved components.
real(kind=8), dimension(:,:), allocatable, public inv_corr_i
Inverse of the covariance matrix of the unresolved variables (reduced version)
real(kind=8) q_ar
Atmospheric resolved component noise amplitude.
real(kind=8) function fs(s, p)
Exponential fit function.