1 |
C $Header: /u/gcmpack/MITgcm/pkg/flt/flt_main.F,v 1.2 2008/12/03 01:35:42 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "FLT_OPTIONS.h" |
5 |
|
6 |
C ================================================================== |
7 |
C |
8 |
C Float Package for the MIT Model |
9 |
C |
10 |
C Main Routines: |
11 |
C |
12 |
C o flt_main - Integrates the floats forward and stores |
13 |
C positions and vertical profiles at specific |
14 |
C time intervals. |
15 |
C o flt_init - Initialise the floats |
16 |
C o flt_restart - Writes restart data to file (=> renamed: flt_write_pickup) |
17 |
C |
18 |
C Second Level Subroutines: |
19 |
C |
20 |
C o flt_runga2 - Second order Runga-Kutta inetgration (default) |
21 |
C o flt_exchg - Does a new distribution of floats over tiles |
22 |
C after every integration step. |
23 |
C o flt_up - moves float to the surface (if flag is set) |
24 |
C and stores profiles to file |
25 |
C o flt_down - moves float to its target depth (if flag is set) |
26 |
C o flt_traj - stores positions and data to file |
27 |
C o flt_bilinear - contains blinear interpolation scheme |
28 |
C o flt_functions - contains some functions |
29 |
C o flt_mdsreadvector - modified mdsreadvector to read files |
30 |
C |
31 |
C ToDo: |
32 |
C |
33 |
C o avoid exchanges when arrays empty |
34 |
C o 3D advection of floats |
35 |
C |
36 |
C ================================================================== |
37 |
C |
38 |
C Documentation: |
39 |
C |
40 |
C To be made.... |
41 |
C |
42 |
C |
43 |
C started: Arne Biastoch abiastoch@ucsd.edu 10-Jan-2000 |
44 |
C (adopted from version written by Detlef Stammer |
45 |
C for the old model code) |
46 |
C |
47 |
C changed: Arne Biastoch abiastoch@ucsd.edu 21-JUN-2001 |
48 |
C |
49 |
C ================================================================== |
50 |
|
51 |
|
52 |
SUBROUTINE FLT_MAIN ( |
53 |
I myTime, myIter, myThid ) |
54 |
|
55 |
C ================================================================== |
56 |
C SUBROUTINE FLT_MAIN |
57 |
C ================================================================== |
58 |
C |
59 |
C o This routine steps floats forward in time and samples the model |
60 |
C state at float position every flt_int_traj time steps. |
61 |
C Also moves the float up and down and samples vertical profiles. |
62 |
C |
63 |
C o Uses 2nd or fourth order runga-kutta |
64 |
C o Spatial interpolation is bilinear close to boundaries and otherwise |
65 |
C a polynomial interpolation. |
66 |
C o Particles are kept in grid space (with position of dp taken as |
67 |
C x(south), y(east) grid cell point) |
68 |
C o Calls profile every flt_int_prof time steps; in that event the |
69 |
C profile over the whole water column is written to file and the |
70 |
C float might be moved upwards to the surface (depending on its |
71 |
C configuration). |
72 |
Cc |
73 |
C ================================================================== |
74 |
C SUBROUTINE FLT_MAIN |
75 |
C ================================================================== |
76 |
|
77 |
#include "EEPARAMS.h" |
78 |
#include "SIZE.h" |
79 |
#include "FLT.h" |
80 |
|
81 |
C == routine arguments == |
82 |
|
83 |
C myThid - thread number for this instance of the routine. |
84 |
|
85 |
_RL myTime |
86 |
INTEGER myIter, myThid |
87 |
|
88 |
C integration of the float trajectories |
89 |
|
90 |
c WRITE(0,*) ' bf call flt_runga2', myIter |
91 |
CALL TIMER_START('FLOATS RUNGA2 [FLT LOOP]',myThid) |
92 |
CALL FLT_RUNGA2( myTime, myIter, myThid ) |
93 |
CALL TIMER_STOP ('FLOATS RUNGA2 [FLT LOOP]',myThid) |
94 |
c WRITE(0,*) ' af call flt_runga2', myIter |
95 |
|
96 |
C check if exchanges between tiles are necessary |
97 |
|
98 |
IF (Nx .NE. sNx .OR. Ny .NE. sNy) THEN |
99 |
CALL TIMER_START('FLOATS EXCHG [FLT LOOP]',myThid) |
100 |
CALL FLT_EXCHG( myTime, myIter, myThid ) |
101 |
CALL TIMER_STOP ('FLOATS EXCHG [FLT LOOP]',myThid) |
102 |
ENDIF |
103 |
|
104 |
C store profiles every flt_int_prof time steps: |
105 |
C and move floats up and down |
106 |
|
107 |
IF ( MOD(myTime,flt_int_prof).EQ.0. ) THEN |
108 |
CALL TIMER_START('FLOATS UP [FLT LOOP]',myThid) |
109 |
CALL FLT_UP( myTime, myIter, myThid ) |
110 |
CALL TIMER_STOP ('FLOATS UP [FLT LOOP]',myThid) |
111 |
ENDIF |
112 |
|
113 |
c WRITE(0,*) ' bf call flt_down', myIter |
114 |
CALL TIMER_START('FLOATS DOWN [FLT LOOP]',myThid) |
115 |
CALL FLT_DOWN( myTime, myIter, myThid ) |
116 |
CALL TIMER_STOP ('FLOATS DOWN [FLT LOOP]',myThid) |
117 |
c WRITE(0,*) ' af call flt_down', myIter |
118 |
|
119 |
C store particles every flt_int_traj timesteps: |
120 |
|
121 |
IF ( MOD(myTime,flt_int_traj).EQ.0. ) THEN |
122 |
c WRITE(0,*) ' bf call flt_traj', myIter |
123 |
CALL TIMER_START('FLOATS TRAJ [FLT LOOP]',myThid) |
124 |
CALL FLT_TRAJ( myTime, myIter, myThid ) |
125 |
CALL TIMER_STOP ('FLOATS TRAJ [FLT LOOP]',myThid) |
126 |
c WRITE(0,*) ' af call flt_traj', myIter |
127 |
ENDIF |
128 |
|
129 |
RETURN |
130 |
END |