1 |
C $Header: /u/gcmpack/MITgcm/pkg/flt/flt_restart.F,v 1.3 2008/12/29 03:40:07 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "FLT_OPTIONS.h" |
5 |
|
6 |
|
7 |
subroutine flt_restart ( |
8 |
I myTime, |
9 |
I myIter, |
10 |
I myThid ) |
11 |
|
12 |
c ================================================================== |
13 |
c SUBROUTINE flt_restart |
14 |
c ================================================================== |
15 |
c |
16 |
c o This routine writes the actual float positions to a local files |
17 |
c that can used as restarts |
18 |
c |
19 |
c ================================================================== |
20 |
c SUBROUTINE flt_restart |
21 |
c ================================================================== |
22 |
|
23 |
c == global variables == |
24 |
|
25 |
#include "EEPARAMS.h" |
26 |
#include "SIZE.h" |
27 |
#include "PARAMS.h" |
28 |
#include "FLT.h" |
29 |
|
30 |
c == routine arguments == |
31 |
_RL myTime |
32 |
INTEGER myIter, myThid |
33 |
|
34 |
c == local variables == |
35 |
INTEGER bi, bj, imax |
36 |
parameter(imax=9) |
37 |
integer ip |
38 |
_RL tmp(imax) |
39 |
_RL npart_dist |
40 |
|
41 |
c == end of interface == |
42 |
|
43 |
npart_dist = 0. |
44 |
|
45 |
DO bj=myByLo(myThid),myByHi(myThid) |
46 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
47 |
|
48 |
c |
49 |
c the standard routine mdswritevector can be used here |
50 |
c (1) write actual number floats and time into file |
51 |
c |
52 |
tmp(1) = npart_tile(bi,bj) |
53 |
tmp(2) = myIter |
54 |
tmp(3) = myTime |
55 |
tmp(4) = 0. |
56 |
tmp(5) = 0. |
57 |
tmp(6) = max_npart |
58 |
tmp(7) = 0. |
59 |
tmp(8) = 0. |
60 |
tmp(9) = 0. |
61 |
call mdswritevector( flt_file,64,.false.,'RL',imax,tmp, |
62 |
* bi,bj,1,myIter,myThid ) |
63 |
|
64 |
do ip=1,npart_tile(bi,bj) |
65 |
|
66 |
tmp(1) = npart(ip,bi,bj) |
67 |
tmp(2) = tstart(ip,bi,bj) |
68 |
tmp(3) = xpart(ip,bi,bj) |
69 |
tmp(4) = ypart(ip,bi,bj) |
70 |
tmp(5) = kpart(ip,bi,bj) |
71 |
tmp(6) = kfloat(ip,bi,bj) |
72 |
tmp(7) = iup(ip,bi,bj) |
73 |
tmp(8) = itop(ip,bi,bj) |
74 |
tmp(9) = tend(ip,bi,bj) |
75 |
|
76 |
c |
77 |
c the standard routine mdswritevector can be used here |
78 |
c (2) write float positions into file |
79 |
|
80 |
call mdswritevector( flt_file,64,.false.,'RL',imax,tmp, |
81 |
& bi,bj,ip+1,myIter,myThid ) |
82 |
|
83 |
enddo |
84 |
|
85 |
npart_dist = npart_dist + DBLE(npart_tile(bi,bj)) |
86 |
|
87 |
ENDDO |
88 |
ENDDO |
89 |
|
90 |
_GLOBAL_SUM_R8( npart_dist, myThid ) |
91 |
_BEGIN_MASTER( myThid ) |
92 |
write(errorMessageUnit,*) npart_dist,' floats written' |
93 |
_END_MASTER( myThid ) |
94 |
|
95 |
return |
96 |
end |