1 | subroutine eofdump(ngrid,nlayer,u,v,t,rho,ps) |
---|
2 | |
---|
3 | implicit none |
---|
4 | c |
---|
5 | c Dumps profiles for calculation of variability EOFs |
---|
6 | c Modified to include rho, FF 09/2004 |
---|
7 | c Corrected small bug in sampling rate/count, EM 11/2007 |
---|
8 | c |
---|
9 | #include "dimensions.h" |
---|
10 | #include "dimphys.h" |
---|
11 | #include "eofdump.h" |
---|
12 | c |
---|
13 | |
---|
14 | integer ngrid |
---|
15 | integer nlayer |
---|
16 | real*4 u(ngrid,nlayer) |
---|
17 | real*4 v(ngrid,nlayer) |
---|
18 | real*4 t(ngrid,nlayer) |
---|
19 | real*4 rho(ngrid,nlayer) |
---|
20 | real*4 ps(ngrid) |
---|
21 | integer count |
---|
22 | data count /0/ |
---|
23 | save count |
---|
24 | integer i,j,l, ig |
---|
25 | |
---|
26 | LOGICAL firstcall |
---|
27 | SAVE firstcall |
---|
28 | DATA firstcall/.true./ |
---|
29 | |
---|
30 | c------------------------------------------------------- |
---|
31 | c Initialization at first call: |
---|
32 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
33 | IF (firstcall) THEN |
---|
34 | write(*,*) 'CALL ineofdump' |
---|
35 | CALL ineofdump |
---|
36 | firstcall=.false. |
---|
37 | END IF |
---|
38 | |
---|
39 | c------------------------------------------------------- |
---|
40 | c Dumps every ieofs physics timesteps |
---|
41 | c |
---|
42 | ! write(*,*)'eofdump:count=',count,' ps(1)=',ps(1) |
---|
43 | ! if ((ieofs.gt.0).and.(mod(count,ieofs).eq.0)) then |
---|
44 | if (mod(count+1,ieofs).eq.0) then |
---|
45 | ! write(*,*)'eofdump: dump --> ps(1)=',ps(1) |
---|
46 | do i=1,iim,eofskip |
---|
47 | do j=1+eofskip/2,jjm+1,eofskip |
---|
48 | ig = 1+ (j-2)*iim +i |
---|
49 | write(uedata) (u(ig,l),l=1,nlayer) |
---|
50 | write(uedata) (v(ig,l),l=1,nlayer) |
---|
51 | write(uedata) (t(ig,l),l=1,nlayer) |
---|
52 | write(uedata) (rho(ig,l),l=1,nlayer) |
---|
53 | write(uedata) ps(ig) |
---|
54 | enddo |
---|
55 | enddo |
---|
56 | endif |
---|
57 | count=count+1 |
---|
58 | return |
---|
59 | end |
---|