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/UKMO/r5518_rm_um_cpl/NEMOGCM/NEMO/OPA_SRC/FLO – NEMO

source: branches/UKMO/r5518_rm_um_cpl/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90 @ 7141

Last change on this file since 7141 was 7141, checked in by jcastill, 7 years ago

Remove svn keywords

File size: 7.3 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
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 florst          ! float restart                    (flo_rst routine)
22   USE flo4rk          ! Trajectories, Runge Kutta scheme (flo_4rk routine)
23   USE floblk          ! Trajectories, Blanke scheme      (flo_blk routine)
24   USE in_out_manager  ! I/O manager
25   USE timing          ! preformance summary
26
27   IMPLICIT NONE
28   PRIVATE 
29
30   PUBLIC   flo_stp    ! routine called by step.F90
31   PUBLIC   flo_init   ! routine called by opa.F90
32
33   !!----------------------------------------------------------------------
34   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
35   !! $Id$
36   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
37   !!----------------------------------------------------------------------
38CONTAINS
39
40   SUBROUTINE flo_stp( kt )
41      !!----------------------------------------------------------------------
42      !!                   ***  ROUTINE flo_stp  ***
43      !!                   
44      !! ** Purpose :   Compute the geographical position (lat., long., depth)
45      !!      of each float at each time step with one of the algorithm.
46      !!
47      !! ** Method  :   The position of a float is computed with Bruno Blanke
48      !!        algorithm by default and with a 4th order Runge-Kutta scheme
49      !!        if ln_flork4 =T
50      !!----------------------------------------------------------------------
51      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
52      !!----------------------------------------------------------------------
53      !
54      IF( nn_timing == 1 )   CALL timing_start('flo_stp')
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      CALL flo_wri( kt )      ! trajectories ouput
63      !
64      CALL flo_rst( kt )      ! trajectories restart
65      !
66      wb(:,:,:) = wn(:,:,:)         ! Save the old vertical velocity field
67      !
68      IF( nn_timing == 1 )   CALL timing_stop('flo_stp')
69      !
70   END SUBROUTINE flo_stp
71
72
73   SUBROUTINE flo_init
74      !!----------------------------------------------------------------
75      !!                 ***  ROUTINE flo_init  ***
76      !!                   
77      !! ** Purpose :   Read the namelist of floats
78      !!----------------------------------------------------------------------
79      INTEGER :: jfl
80      INTEGER :: ios                 ! Local integer output status for namelist read
81      !
82      NAMELIST/namflo/ jpnfl, jpnnewflo, ln_rstflo, nn_writefl, nn_stockfl, ln_argo, ln_flork4, ln_ariane, ln_flo_ascii
83      !!---------------------------------------------------------------------
84      !
85      IF( nn_timing == 1 )   CALL timing_start('flo_init')
86      !
87      IF(lwp) WRITE(numout,*)
88      IF(lwp) WRITE(numout,*) 'flo_stp : call floats routine '
89      IF(lwp) WRITE(numout,*) '~~~~~~~'
90
91      REWIND( numnam_ref )              ! Namelist namflo in reference namelist : Floats
92      READ  ( numnam_ref, namflo, IOSTAT = ios, ERR = 901)
93901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namflo in reference namelist', lwp )
94
95      REWIND( numnam_cfg )              ! Namelist namflo in configuration namelist : Floats
96      READ  ( numnam_cfg, namflo, IOSTAT = ios, ERR = 902 )
97902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namflo in configuration namelist', lwp )
98      IF(lwm) WRITE ( numond, namflo )
99      !
100      IF(lwp) THEN                  ! control print
101         WRITE(numout,*)
102         WRITE(numout,*) '         Namelist floats :'
103         WRITE(numout,*) '            number of floats                      jpnfl        = ', jpnfl
104         WRITE(numout,*) '            number of new floats                  jpnflnewflo  = ', jpnnewflo
105         WRITE(numout,*) '            restart                               ln_rstflo    = ', ln_rstflo
106         WRITE(numout,*) '            frequency of float output file        nn_writefl   = ', nn_writefl
107         WRITE(numout,*) '            frequency of float restart file       nn_stockfl   = ', nn_stockfl
108         WRITE(numout,*) '            Argo type floats                      ln_argo      = ', ln_argo
109         WRITE(numout,*) '            Computation of T trajectories         ln_flork4    = ', ln_flork4
110         WRITE(numout,*) '            Use of ariane convention              ln_ariane    = ', ln_ariane
111         WRITE(numout,*) '            ascii output (T) or netcdf output (F) ln_flo_ascii = ', ln_flo_ascii
112
113      ENDIF
114      !
115      !                             ! allocate floats arrays
116      IF( flo_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_init : unable to allocate arrays' )
117      !
118      !                             ! allocate flodom arrays
119      IF( flo_dom_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_dom : unable to allocate arrays' )
120      !
121      !                             ! allocate flowri arrays
122      IF( flo_wri_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_wri : unable to allocate arrays' )
123      !
124      !                             ! allocate florst arrays
125      IF( flo_rst_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_rst : unable to allocate arrays' )
126      !
127      !memory allocation
128      jpnrstflo = jpnfl-jpnnewflo
129
130      !vertical axe for netcdf IOM ouput
131      DO jfl=1,jpnfl ; nfloat(jfl)=jfl ; ENDDO
132
133      !
134      CALL flo_dom                  ! compute/read initial position of floats
135
136      wb(:,:,:) = wn(:,:,:)         ! set wb for computation of floats trajectories at the first time step
137      !
138      IF( nn_timing == 1 )   CALL timing_stop('flo_init')
139      !
140   END SUBROUTINE flo_init
141
142#  else
143   !!----------------------------------------------------------------------
144   !!   Default option :                                       Empty module
145   !!----------------------------------------------------------------------
146CONTAINS
147   SUBROUTINE flo_stp( kt )          ! Empty routine
148      WRITE(*,*) 'flo_stp: You should not have seen this print! error?', kt
149   END SUBROUTINE flo_stp
150   SUBROUTINE flo_init          ! Empty routine
151   END SUBROUTINE flo_init
152#endif
153
154   !!======================================================================
155 END MODULE floats
Note: See TracBrowser for help on using the repository browser.