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

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

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

revision 1.1 by adcroft, Thu Sep 13 17:43:55 2001 UTC revision 1.2 by jmc, Wed Dec 3 01:35:42 2008 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4  #include "FLT_CPPOPTIONS.h"  #include "FLT_OPTIONS.h"
5    
6  c     ==================================================================  c     ==================================================================
7  c  c
# Line 10  c Line 10  c
10  c     Main Routines:  c     Main Routines:
11  c  c
12  c     o flt_main      - Integrates the floats forward and stores  c     o flt_main      - Integrates the floats forward and stores
13  c                       positions and vertical profiles at specific  c                       positions and vertical profiles at specific
14  c                       time intervals.  c                       time intervals.
15  c     o flt_init      - Initialise the floats  c     o flt_init      - Initialise the floats
16  c     o flt_restart   - Writes restart data to file.  c     o flt_restart   - Writes restart data to file.
17  c  c
18  c     Second Level Subroutines:  c     Second Level Subroutines:
19  c  c
# Line 29  c     o flt_functions - contains some fu Line 29  c     o flt_functions - contains some fu
29  c     o flt_mdsreadvector - modified mdsreadvector to read files  c     o flt_mdsreadvector - modified mdsreadvector to read files
30  c  c
31  c     ToDo:  c     ToDo:
32  c      c
33  c     o avoid exchanges when arrays empty  c     o avoid exchanges when arrays empty
34  c     o 3D advection of floats  c     o 3D advection of floats
35  c        c
36  c     ==================================================================  c     ==================================================================
37  c  c
38  c     Documentation:  c     Documentation:
# Line 41  c     To be made.... Line 41  c     To be made....
41  c  c
42  c  c
43  c     started: Arne Biastoch abiastoch@ucsd.edu 10-Jan-2000  c     started: Arne Biastoch abiastoch@ucsd.edu 10-Jan-2000
44  c              (adopted from version written by Detlef Stammer  c              (adopted from version written by Detlef Stammer
45  c               for the old model code)  c               for the old model code)
46  c  c
47  c     changed: Arne Biastoch abiastoch@ucsd.edu 21-JUN-2001  c     changed: Arne Biastoch abiastoch@ucsd.edu 21-JUN-2001
# Line 49  c Line 49  c
49  c     ==================================================================  c     ==================================================================
50    
51    
52        subroutine flt_main (        SUBROUTINE FLT_MAIN (
53       I                      myCurrentIter,       I                      myIter,
54       I                      myCurrentTime,       I                      myTime,
55       I                      myThid       I                      myThid
56       &                     )       &                     )
57    
58  c     ==================================================================  C     ==================================================================
59  c     SUBROUTINE flt_main  C     SUBROUTINE FLT_MAIN
60  c     ==================================================================  C     ==================================================================
61  c  C
62  c     o This routine steps floats forward in time and samples the model  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.  C       state at float position every flt_int_traj time steps.
64  c       Also moves the float up and down and samples vertical profiles.  C       Also moves the float up and down and samples vertical profiles.
65  c  C
66  c     o Uses  2nd or fourth order runga-kutta  C     o Uses  2nd or fourth order runga-kutta
67  c     o Spatial interpolation is bilinear close to boundaries and otherwise  C     o Spatial interpolation is bilinear close to boundaries and otherwise
68  c       a polynomial interpolation.  C       a polynomial interpolation.
69  c     o Particles are kept in grid space (with position of dp taken as  C     o Particles are kept in grid space (with position of dp taken as
70  c       x(south), y(east) grid cell point)  C       x(south), y(east) grid cell point)
71  c     o Calls profile every flt_int_prof time steps; in that event the  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  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  C       float might be moved upwards to the surface (depending on its
74  c       configuration).  C       configuration).
75  cc  Cc
76  c     ==================================================================  C     ==================================================================
77  c     SUBROUTINE flt_main  C     SUBROUTINE FLT_MAIN
78  c     ==================================================================  C     ==================================================================
79    
80  #include "EEPARAMS.h"  #include "EEPARAMS.h"
81  #include "SIZE.h"  #include "SIZE.h"
82  #include "FLT.h"  #include "FLT.h"
83    
84  c     == routine arguments ==  C     == routine arguments ==
85    
86  c     mythid - thread number for this instance of the routine.  C     mythid - thread number for this instance of the routine.
87    
88        INTEGER myCurrentIter, myThid        INTEGER myIter, myThid
89        _RL myCurrentTime        _RL myTime
90    
91  c     integration of the float trajectories  C     integration of the float trajectories
92  c  
93    c         write(0,*) ' bf call flt_runga2', myIter
94           CALL TIMER_START('FLOATS RUNGA2      [FLT  LOOP]',myThid)           CALL TIMER_START('FLOATS RUNGA2      [FLT  LOOP]',myThid)
95           call flt_runga2(myCurrentIter,myCurrentTime,myThid)           call flt_runga2( myIter, myTime, myThid )
96           CALL TIMER_STOP ('FLOATS RUNGA2      [FLT  LOOP]',myThid)           CALL TIMER_STOP ('FLOATS RUNGA2      [FLT  LOOP]',myThid)
97    c         write(0,*) ' af call flt_runga2', myIter
98    
99    C     check if exchanges between tiles are necessary
100    
 c     check if exchanges between tiles are necessary  
 c  
101           if (Nx .ne. sNx .or. Ny .ne. sNy) then           if (Nx .ne. sNx .or. Ny .ne. sNy) then
102              CALL TIMER_START('FLOATS EXCHG       [FLT  LOOP]',myThid)              CALL TIMER_START('FLOATS EXCHG       [FLT  LOOP]',myThid)
103              call flt_exchg(myCurrentIter,myCurrentTime,myThid)              call flt_exchg( myIter, myTime, myThid )
104              CALL TIMER_STOP ('FLOATS EXCHG       [FLT  LOOP]',myThid)              CALL TIMER_STOP ('FLOATS EXCHG       [FLT  LOOP]',myThid)
105           endif           endif
106    
107  c     store profiles every flt_int_prof time steps:  C     store profiles every flt_int_prof time steps:
108  c     and move floats up and down  C     and move floats up and down
 c  
109    
110           if (mod(myCurrentTime,flt_int_prof).eq.0.) then           if (mod(myTime,flt_int_prof).eq.0.) then
111              CALL TIMER_START('FLOATS UP          [FLT  LOOP]',myThid)              CALL TIMER_START('FLOATS UP          [FLT  LOOP]',myThid)
112              call flt_up(myCurrentIter,myCurrentTime,myThid)              call flt_up( myIter, myTime, myThid )
113              CALL TIMER_STOP ('FLOATS UP          [FLT  LOOP]',myThid)              CALL TIMER_STOP ('FLOATS UP          [FLT  LOOP]',myThid)
114           endif           endif
115    
116    c         write(0,*) ' bf call flt_down', myIter
117              CALL TIMER_START('FLOATS DOWN        [FLT  LOOP]',myThid)              CALL TIMER_START('FLOATS DOWN        [FLT  LOOP]',myThid)
118              call flt_down(MyCurrentIter,myCurrentTime,myThid)              call flt_down( myIter, myTime, myThid )
119              CALL TIMER_STOP ('FLOATS DOWN        [FLT  LOOP]',myThid)              CALL TIMER_STOP ('FLOATS DOWN        [FLT  LOOP]',myThid)
120    c         write(0,*) ' af call flt_down', myIter
121    
122  c     store particles every flt_int_traj timesteps:  C     store particles every flt_int_traj timesteps:
123  c  
124           if (mod(myCurrentTime,flt_int_traj).eq.0.) then           if (mod(myTime,flt_int_traj).eq.0.) then
125    c         write(0,*) ' bf call flt_traj', myIter
126              CALL TIMER_START('FLOATS TRAJ        [FLT  LOOP]',myThid)              CALL TIMER_START('FLOATS TRAJ        [FLT  LOOP]',myThid)
127              call flt_traj(myCurrentIter,myCurrentTime,myThid)              call flt_traj( myIter, myTime, myThid )
128              CALL TIMER_STOP ('FLOATS TRAJ        [FLT  LOOP]',myThid)              CALL TIMER_STOP ('FLOATS TRAJ        [FLT  LOOP]',myThid)
129    c         write(0,*) ' af call flt_traj', myIter
130           endif           endif
131    
132        return        RETURN
133        end        END

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22