New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
floats.F90 in branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/FLO – NEMO

source: branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90 @ 4460

Last change on this file since 4460 was 3211, checked in by spickles2, 13 years ago

Stephen Pickles, 11 Dec 2011

Commit to bring the rest of the DCSE NEMO development branch
in line with the latest development version. This includes
array index re-ordering of all OPA_SRC/.

  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1MODULE floats
2   !!======================================================================
3   !!                       ***  MODULE  floats  ***
4   !! Ocean floats : floats
5   !!======================================================================
6   !! History :  OPA  !          (CLIPPER)   original Code
7   !!   NEMO     1.0  ! 2002-06  (A. Bozec)  F90, Free form and module
8   !!----------------------------------------------------------------------
9#if   defined key_floats   ||   defined key_esopa
10   !!----------------------------------------------------------------------
11   !!   'key_floats'                                     float trajectories
12   !!----------------------------------------------------------------------
13   !!   flo_stp   : float trajectories computation
14   !!   flo_init  : initialization of float trajectories computation
15   !!----------------------------------------------------------------------
16   USE oce             ! ocean variables
17   USE flo_oce         ! floats variables
18   USE lib_mpp         ! distributed memory computing
19   USE flodom          ! initialisation Module
20   USE flowri          ! float output                     (flo_wri routine)
21   USE flo4rk          ! Trajectories, Runge Kutta scheme (flo_4rk routine)
22   USE floblk          ! Trajectories, Blanke scheme      (flo_blk routine)
23   USE in_out_manager  ! I/O manager
24
25   IMPLICIT NONE
26   PRIVATE 
27
28   PUBLIC   flo_stp    ! routine called by step.F90
29   PUBLIC   flo_init   ! routine called by opa.F90
30
31   !! * Control permutation of array indices
32#  include "oce_ftrans.h90"
33#  include "flo_oce_ftrans.h90"
34
35   !!----------------------------------------------------------------------
36   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
37   !! $Id$
38   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
39   !!----------------------------------------------------------------------
40CONTAINS
41
42   SUBROUTINE flo_stp( kt )
43      !!----------------------------------------------------------------------
44      !!                   ***  ROUTINE flo_stp  ***
45      !!                   
46      !! ** Purpose :   Compute the geographical position (lat., long., depth)
47      !!      of each float at each time step with one of the algorithm.
48      !!
49      !! ** Method  :   The position of a float is computed with Bruno Blanke
50      !!        algorithm by default and with a 4th order Runge-Kutta scheme
51      !!        if ln_flork4 =T
52      !!----------------------------------------------------------------------
53      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
54      !!----------------------------------------------------------------------
55      !
56      IF( ln_flork4 ) THEN   ;   CALL flo_4rk( kt )        ! Trajectories using a 4th order Runge Kutta scheme
57      ELSE                   ;   CALL flo_blk( kt )        ! Trajectories using Blanke' algorithme
58      ENDIF
59      !
60      IF( lk_mpp )   CALL mppsync   ! synchronization of all the processor
61      !
62      IF( kt == nit000 .OR. MOD( kt, nn_writefl ) == 0 )   CALL flo_wri( kt )      ! trajectories file
63      IF( kt == nitend .OR. MOD( kt, nn_stockfl ) == 0 )   CALL flo_wri( kt )      ! restart file
64      !
65      wb(:,:,:) = wn(:,:,:)         ! Save the old vertical velocity field
66      !
67   END SUBROUTINE flo_stp
68
69
70   SUBROUTINE flo_init
71      !!----------------------------------------------------------------
72      !!                 ***  ROUTINE flo_init  ***
73      !!                   
74      !! ** Purpose :   Read the namelist of floats
75      !!----------------------------------------------------------------------
76      NAMELIST/namflo/ ln_rstflo, nn_writefl, nn_stockfl, ln_argo, ln_flork4 
77      !!---------------------------------------------------------------------
78      !
79      IF(lwp) WRITE(numout,*)
80      IF(lwp) WRITE(numout,*) 'flo_stp : call floats routine '
81      IF(lwp) WRITE(numout,*) '~~~~~~~'
82
83      REWIND( numnam )              ! Namelist namflo : floats
84      READ  ( numnam, namflo )
85      !
86      IF(lwp) THEN                  ! control print
87         WRITE(numout,*)
88         WRITE(numout,*) '         Namelist floats :'
89         WRITE(numout,*) '            restart                          ln_rstflo  = ', ln_rstflo
90         WRITE(numout,*) '            frequency of float output file   nn_writefl = ', nn_writefl
91         WRITE(numout,*) '            frequency of float restart file  nn_stockfl = ', nn_stockfl
92         WRITE(numout,*) '            Argo type floats                 ln_argo    = ', ln_argo
93         WRITE(numout,*) '            Computation of T trajectories    ln_flork4  = ', ln_flork4
94      ENDIF
95      !
96      !                             ! allocate floats arrays
97      IF( flo_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_init : unable to allocate arrays' )
98      !
99      !                             ! allocate flowri arrays
100      IF( flo_wri_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_wri : unable to allocate arrays' )
101      !
102      CALL flo_dom                  ! compute/read initial position of floats
103
104      wb(:,:,:) = wn(:,:,:)         ! set wb for computation of floats trajectories at the first time step
105      !
106   END SUBROUTINE flo_init
107
108#  else
109   !!----------------------------------------------------------------------
110   !!   Default option :                                       Empty module
111   !!----------------------------------------------------------------------
112CONTAINS
113   SUBROUTINE flo_stp( kt )          ! Empty routine
114      WRITE(*,*) 'flo_stp: You should not have seen this print! error?', kt
115   END SUBROUTINE flo_stp
116   SUBROUTINE flo_init          ! Empty routine
117   END SUBROUTINE flo_init
118#endif
119
120   !!======================================================================
121 END MODULE floats
Note: See TracBrowser for help on using the repository browser.