1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "FLT_CPPOPTIONS.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. |
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 myCurrentIter, |
54 |
I myCurrentTime, |
55 |
I myThid |
56 |
& ) |
57 |
|
58 |
c ================================================================== |
59 |
c SUBROUTINE flt_main |
60 |
c ================================================================== |
61 |
c |
62 |
c o This routine steps floats forward in time and samples the model |
63 |
c state at float position every flt_int_traj time steps. |
64 |
c Also moves the float up and down and samples vertical profiles. |
65 |
c |
66 |
c o Uses 2nd or fourth order runga-kutta |
67 |
c o Spatial interpolation is bilinear close to boundaries and otherwise |
68 |
c a polynomial interpolation. |
69 |
c o Particles are kept in grid space (with position of dp taken as |
70 |
c x(south), y(east) grid cell point) |
71 |
c o Calls profile every flt_int_prof time steps; in that event the |
72 |
c profile over the whole water column is written to file and the |
73 |
c float might be moved upwards to the surface (depending on its |
74 |
c configuration). |
75 |
cc |
76 |
c ================================================================== |
77 |
c SUBROUTINE flt_main |
78 |
c ================================================================== |
79 |
|
80 |
#include "EEPARAMS.h" |
81 |
#include "SIZE.h" |
82 |
#include "FLT.h" |
83 |
|
84 |
c == routine arguments == |
85 |
|
86 |
c mythid - thread number for this instance of the routine. |
87 |
|
88 |
INTEGER myCurrentIter, myThid |
89 |
_RL myCurrentTime |
90 |
|
91 |
c integration of the float trajectories |
92 |
c |
93 |
CALL TIMER_START('FLOATS RUNGA2 [FLT LOOP]',myThid) |
94 |
call flt_runga2(myCurrentIter,myCurrentTime,myThid) |
95 |
CALL TIMER_STOP ('FLOATS RUNGA2 [FLT LOOP]',myThid) |
96 |
|
97 |
c check if exchanges between tiles are necessary |
98 |
c |
99 |
if (Nx .ne. sNx .or. Ny .ne. sNy) then |
100 |
CALL TIMER_START('FLOATS EXCHG [FLT LOOP]',myThid) |
101 |
call flt_exchg(myCurrentIter,myCurrentTime,myThid) |
102 |
CALL TIMER_STOP ('FLOATS EXCHG [FLT LOOP]',myThid) |
103 |
endif |
104 |
|
105 |
c store profiles every flt_int_prof time steps: |
106 |
c and move floats up and down |
107 |
c |
108 |
|
109 |
if (mod(myCurrentTime,flt_int_prof).eq.0.) then |
110 |
CALL TIMER_START('FLOATS UP [FLT LOOP]',myThid) |
111 |
call flt_up(myCurrentIter,myCurrentTime,myThid) |
112 |
CALL TIMER_STOP ('FLOATS UP [FLT LOOP]',myThid) |
113 |
endif |
114 |
|
115 |
CALL TIMER_START('FLOATS DOWN [FLT LOOP]',myThid) |
116 |
call flt_down(MyCurrentIter,myCurrentTime,myThid) |
117 |
CALL TIMER_STOP ('FLOATS DOWN [FLT LOOP]',myThid) |
118 |
|
119 |
c store particles every flt_int_traj timesteps: |
120 |
c |
121 |
if (mod(myCurrentTime,flt_int_traj).eq.0.) then |
122 |
CALL TIMER_START('FLOATS TRAJ [FLT LOOP]',myThid) |
123 |
call flt_traj(myCurrentIter,myCurrentTime,myThid) |
124 |
CALL TIMER_STOP ('FLOATS TRAJ [FLT LOOP]',myThid) |
125 |
endif |
126 |
|
127 |
return |
128 |
end |