/[MITgcm]/MITgcm/pkg/flt/flt_main.F
ViewVC logotype

Annotation of /MITgcm/pkg/flt/flt_main.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.9 - (hide annotations) (download)
Wed Aug 31 21:33:50 2011 UTC (12 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint63g, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63c, checkpoint65o, checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, HEAD
Changes since 1.8: +49 -14 lines
use standard DIFFERENT_MULTIPLE function; add some DEBUG calls.

1 jmc 1.9 C $Header: /u/gcmpack/MITgcm/pkg/flt/flt_main.F,v 1.8 2010/12/22 21:25:18 jahn Exp $
2 jmc 1.2 C $Name: $
3 adcroft 1.1
4 jmc 1.2 #include "FLT_OPTIONS.h"
5 adcroft 1.1
6 jmc 1.3 C ==================================================================
7     C
8     C Float Package for the MIT Model
9     C
10     C Main Routines:
11     C
12 jmc 1.5 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_readparms - Read parameter file
16     C o flt_init_fixed - Initialise fixed
17     C o flt_init_varia - Initialise the floats
18     C o flt_restart - Writes restart data to file (=> renamed: flt_write_pickup)
19 jmc 1.3 C
20     C Second Level Subroutines:
21     C
22 jmc 1.5 C o flt_runga2 - Second order Runga-Kutta inetgration (default)
23     C o flt_exchg - Does a new distribution of floats over tiles
24     C after every integration step.
25     C o flt_up - moves float to the surface (if flag is set)
26     C and stores profiles to file
27     C o flt_down - moves float to its target depth (if flag is set)
28     C o flt_traj - stores positions and data to file
29     C o flt_interp_linear - contains blinear interpolation scheme
30     C o flt_mapping - contains mapping functions & subroutine
31     C o flt_mdsreadvector - modified mdsreadvector to read files
32 jmc 1.3 C
33     C ToDo:
34     C
35     C o avoid exchanges when arrays empty
36     C o 3D advection of floats
37     C
38     C ==================================================================
39     C
40     C Documentation:
41     C
42     C To be made....
43     C
44     C
45     C started: Arne Biastoch abiastoch@ucsd.edu 10-Jan-2000
46     C (adopted from version written by Detlef Stammer
47     C for the old model code)
48     C
49     C changed: Arne Biastoch abiastoch@ucsd.edu 21-JUN-2001
50     C
51     C ==================================================================
52 adcroft 1.1
53 jmc 1.9 CBOP 0
54     C !ROUTINE: FLT_MAIN
55 adcroft 1.1
56 jmc 1.9 C !INTERFACE:
57 jmc 1.2 SUBROUTINE FLT_MAIN (
58 jmc 1.3 I myTime, myIter, myThid )
59 adcroft 1.1
60 jmc 1.9 C !DESCRIPTION:
61 jmc 1.2 C ==================================================================
62     C SUBROUTINE FLT_MAIN
63     C ==================================================================
64     C o This routine steps floats forward in time and samples the model
65     C state at float position every flt_int_traj time steps.
66     C Also moves the float up and down and samples vertical profiles.
67     C
68     C o Uses 2nd or fourth order runga-kutta
69     C o Spatial interpolation is bilinear close to boundaries and otherwise
70     C a polynomial interpolation.
71     C o Particles are kept in grid space (with position of dp taken as
72     C x(south), y(east) grid cell point)
73     C o Calls profile every flt_int_prof time steps; in that event the
74     C profile over the whole water column is written to file and the
75     C float might be moved upwards to the surface (depending on its
76     C configuration).
77     C ==================================================================
78 jmc 1.5
79     C !USES:
80     IMPLICIT NONE
81 jmc 1.9 C == global variables ==
82     #include "SIZE.h"
83 adcroft 1.1 #include "EEPARAMS.h"
84 jmc 1.9 #include "PARAMS.h"
85 jahn 1.8 #include "FLT_SIZE.h"
86 adcroft 1.1 #include "FLT.h"
87    
88 jmc 1.9 C !INPUT PARAMETERS:
89     C myTime :: current time in simulation
90     C myIter :: current iteration number
91     C myThid :: my Thread Id number
92 jmc 1.3 _RL myTime
93 jmc 1.2 INTEGER myIter, myThid
94 adcroft 1.1
95 jmc 1.9 C !FUNCTIONS:
96     LOGICAL DIFFERENT_MULTIPLE
97     EXTERNAL DIFFERENT_MULTIPLE
98    
99     C !LOCAL VARIABLES:
100     CEOP
101 jmc 1.2
102 jmc 1.9 #ifdef ALLOW_DEBUG
103     IF (debugMode) CALL DEBUG_ENTER( 'FLT_MAIN', myThid )
104     #endif
105    
106     C-- integration of the float trajectories
107     #ifdef ALLOW_DEBUG
108     IF (debugMode) CALL DEBUG_CALL('FLT_RUNGA*', myThid )
109     #endif
110 jahn 1.6 #ifdef FLT_SECOND_ORDER_RUNGE_KUTTA
111 jmc 1.3 c WRITE(0,*) ' bf call flt_runga2', myIter
112 adcroft 1.1 CALL TIMER_START('FLOATS RUNGA2 [FLT LOOP]',myThid)
113 jmc 1.3 CALL FLT_RUNGA2( myTime, myIter, myThid )
114 adcroft 1.1 CALL TIMER_STOP ('FLOATS RUNGA2 [FLT LOOP]',myThid)
115 jmc 1.3 c WRITE(0,*) ' af call flt_runga2', myIter
116 jahn 1.6 #else
117     c WRITE(0,*) ' bf call flt_runga4', myIter
118     CALL TIMER_START('FLOATS RUNGA4 [FLT LOOP]',myThid)
119     CALL FLT_RUNGA4( myTime, myIter, myThid )
120     CALL TIMER_STOP ('FLOATS RUNGA4 [FLT LOOP]',myThid)
121     c WRITE(0,*) ' af call flt_runga4', myIter
122     #endif
123 jmc 1.2
124 jmc 1.9 C-- do exchanges between tiles if necessary
125 adcroft 1.1
126 jmc 1.9 #ifdef ALLOW_DEBUG
127     IF (debugMode) CALL DEBUG_CALL('FLT_EXCH*', myThid )
128     #endif
129 jmc 1.4 CALL TIMER_START('FLOATS EXCHG [FLT LOOP]',myThid)
130 jahn 1.7 #ifdef ALLOW_EXCH2
131     CALL FLT_EXCH2( myTime, myIter, myThid )
132     #else
133 jmc 1.4 CALL FLT_EXCHG( myTime, myIter, myThid )
134 jahn 1.7 #endif
135 jmc 1.4 CALL TIMER_STOP ('FLOATS EXCHG [FLT LOOP]',myThid)
136 adcroft 1.1
137 jmc 1.9 C-- store profiles every flt_int_prof time steps and move floats up and down
138 adcroft 1.1
139 jmc 1.9 IF ( DIFFERENT_MULTIPLE( flt_int_prof, myTime, deltaTClock )
140     & ) THEN
141     #ifdef ALLOW_DEBUG
142     IF (debugMode) CALL DEBUG_CALL('FLT_UP', myThid )
143     #endif
144 jmc 1.4 CALL TIMER_START('FLOATS UP [FLT LOOP]',myThid)
145     CALL FLT_UP( myTime, myIter, myThid )
146     CALL TIMER_STOP ('FLOATS UP [FLT LOOP]',myThid)
147 jmc 1.3 ENDIF
148 adcroft 1.1
149 jmc 1.9 #ifdef ALLOW_DEBUG
150     IF (debugMode) CALL DEBUG_CALL('FLT_DOWN', myThid )
151     #endif
152 jmc 1.3 c WRITE(0,*) ' bf call flt_down', myIter
153 jmc 1.4 CALL TIMER_START('FLOATS DOWN [FLT LOOP]',myThid)
154     CALL FLT_DOWN( myTime, myIter, myThid )
155     CALL TIMER_STOP ('FLOATS DOWN [FLT LOOP]',myThid)
156 jmc 1.3 c WRITE(0,*) ' af call flt_down', myIter
157 jmc 1.2
158 jmc 1.9 C-- store particles every flt_int_traj timesteps:
159 adcroft 1.1
160 jmc 1.9 IF ( DIFFERENT_MULTIPLE( flt_int_traj, myTime, deltaTClock )
161     & ) THEN
162     #ifdef ALLOW_DEBUG
163     IF (debugMode) CALL DEBUG_CALL('FLT_TRAJ', myThid )
164     #endif
165 jmc 1.3 c WRITE(0,*) ' bf call flt_traj', myIter
166 jmc 1.4 CALL TIMER_START('FLOATS TRAJ [FLT LOOP]',myThid)
167     CALL FLT_TRAJ( myTime, myIter, myThid )
168     CALL TIMER_STOP ('FLOATS TRAJ [FLT LOOP]',myThid)
169 jmc 1.3 c WRITE(0,*) ' af call flt_traj', myIter
170     ENDIF
171 adcroft 1.1
172 jmc 1.9 #ifdef ALLOW_DEBUG
173     IF (debugMode) CALL DEBUG_LEAVE( 'FLT_MAIN', myThid )
174     #endif
175    
176 jmc 1.2 RETURN
177     END

  ViewVC Help
Powered by ViewVC 1.1.22