1 |
C $Header: /u/gcmpack/MITgcm/pkg/flt/flt_init.F,v 1.6 2009/01/08 19:40:41 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "FLT_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE FLT_INIT_FIXED( myThid ) |
7 |
|
8 |
C ================================================================== |
9 |
C SUBROUTINE FLT_INIT_FIXED |
10 |
C ================================================================== |
11 |
C |
12 |
C o This routine initializes the start/restart positions. |
13 |
C It does the following: |
14 |
C o First it checks for local files. These are supposed to be restarts |
15 |
C from a previous integration. The floats can therefore be read in |
16 |
C without any further check (because they exist on the specific tile). |
17 |
C o If no local files are available the routine assumes that this |
18 |
C is an initialization. In that case it reads a global file |
19 |
C (that has the same format as local files) and sorts those floats |
20 |
C that exist on the specific tile into the local array. |
21 |
C o At the end the float positions are written to the trajectory file |
22 |
C |
23 |
C ================================================================== |
24 |
C SUBROUTINE flt_init |
25 |
C ================================================================== |
26 |
|
27 |
#include "SIZE.h" |
28 |
#include "EEPARAMS.h" |
29 |
#include "PARAMS.h" |
30 |
#include "GRID.h" |
31 |
#include "FLT.h" |
32 |
|
33 |
C == routine arguments == |
34 |
|
35 |
C myThid - thread number for this instance of the routine. |
36 |
INTEGER myThid |
37 |
|
38 |
C == local variables == |
39 |
INTEGER bi, bj |
40 |
_RL xLo, xHi, yLo, yHi |
41 |
|
42 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
43 |
|
44 |
C == end of interface == |
45 |
|
46 |
C Set domain dependent constants: |
47 |
xLo = -xG( 1, 1,1,1) |
48 |
xHi = xG(sNx+1,1,1,1) |
49 |
yLo = -yG(1, 1, 1,1) |
50 |
yHi = yG(1,sNy+1,1,1) |
51 |
DO bj=myByLo(myThid),myByHi(myThid) |
52 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
53 |
xLo = MAX( xLo, -xG(1,1,bi,bj) ) |
54 |
xHi = MAX( xHi, xG(sNx+1,1,bi,bj) ) |
55 |
yLo = MAX( yLo, -yG(1,1,bi,bj) ) |
56 |
yHi = MAX( yHi, yG(1,sNy+1,bi,bj) ) |
57 |
ENDDO |
58 |
ENDDO |
59 |
_GLOBAL_MAX_R8( xLo, myThid ) |
60 |
_GLOBAL_MAX_R8( xHi, myThid ) |
61 |
_GLOBAL_MAX_R8( yLo, myThid ) |
62 |
_GLOBAL_MAX_R8( yHi, myThid ) |
63 |
|
64 |
_BEGIN_MASTER(myThid) |
65 |
flt_xLo = -xLo |
66 |
flt_xHi = xHi |
67 |
flt_yLo = -yLo |
68 |
flt_yHi = yHi |
69 |
WRITE(msgBuf,'(A,2F18.8)') |
70 |
& ' FLT_xLo,xHi=', xLo, xHi |
71 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
72 |
& SQUEEZE_RIGHT, myThid ) |
73 |
WRITE(msgBuf,'(A,2F18.8)') |
74 |
& ' FLT_yLo,yHi=', yLo, yHi |
75 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
76 |
& SQUEEZE_RIGHT, myThid ) |
77 |
_END_MASTER(myThid) |
78 |
|
79 |
RETURN |
80 |
END |