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 NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/OCE/FLO – NEMO

source: NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/src/OCE/FLO/floats.F90 @ 11954

Last change on this file since 11954 was 11671, checked in by acc, 5 years ago

Branch 2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles. Final, non-substantive changes to complete this branch. These changes remove all REWIND statements on the old namelist fortran units (now character variables for internal files). These changes have been left until last since they are easily repeated via a script and it may be preferable to use the previous revision for merge purposes and reapply these last changes separately. This branch has been fully SETTE tested.

  • Property svn:keywords set to Id
File size: 6.6 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   !!
10   !!----------------------------------------------------------------------
11   !!   flo_stp   : float trajectories computation
12   !!   flo_init  : initialization of float trajectories computation
13   !!----------------------------------------------------------------------
14   USE oce             ! ocean variables
15   USE flo_oce         ! floats variables
16   USE lib_mpp         ! distributed memory computing
17   USE flodom          ! initialisation Module
18   USE flowri          ! float output                     (flo_wri routine)
19   USE florst          ! float restart                    (flo_rst routine)
20   USE flo4rk          ! Trajectories, Runge Kutta scheme (flo_4rk routine)
21   USE floblk          ! Trajectories, Blanke scheme      (flo_blk routine)
22   !
23   USE in_out_manager  ! I/O manager
24   USE timing          ! preformance summary
25
26   IMPLICIT NONE
27   PRIVATE 
28
29   PUBLIC   flo_stp    ! routine called by step.F90
30   PUBLIC   flo_init   ! routine called by nemogcm.F90
31
32   !!----------------------------------------------------------------------
33   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
34   !! $Id$
35   !! Software governed by the CeCILL license (see ./LICENSE)
36   !!----------------------------------------------------------------------
37CONTAINS
38
39   SUBROUTINE flo_stp( kt )
40      !!----------------------------------------------------------------------
41      !!                   ***  ROUTINE flo_stp  ***
42      !!                   
43      !! ** Purpose :   Compute the geographical position (lat., long., depth)
44      !!      of each float at each time step with one of the algorithm.
45      !!
46      !! ** Method  :   The position of a float is computed with Bruno Blanke
47      !!        algorithm by default and with a 4th order Runge-Kutta scheme
48      !!        if ln_flork4 =T
49      !!----------------------------------------------------------------------
50      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
51      !!----------------------------------------------------------------------
52      !
53      IF( ln_timing )   CALL timing_start('flo_stp')
54      !
55      IF( ln_flork4 ) THEN   ;   CALL flo_4rk( kt )        ! Trajectories using a 4th order Runge Kutta scheme
56      ELSE                   ;   CALL flo_blk( kt )        ! Trajectories using Blanke' algorithme
57      ENDIF
58      !
59      IF( lk_mpp )   CALL mppsync   ! synchronization of all the processor
60      !
61      CALL flo_wri( kt )      ! trajectories ouput
62      !
63      CALL flo_rst( kt )      ! trajectories restart
64      !
65      wb(:,:,:) = wn(:,:,:)         ! Save the old vertical velocity field
66      !
67      IF( ln_timing )   CALL timing_stop('flo_stp')
68      !
69   END SUBROUTINE flo_stp
70
71
72   SUBROUTINE flo_init
73      !!----------------------------------------------------------------
74      !!                 ***  ROUTINE flo_init  ***
75      !!                   
76      !! ** Purpose :   Read the namelist of floats
77      !!----------------------------------------------------------------------
78      INTEGER ::   jfl
79      INTEGER ::   ios                 ! Local integer output status for namelist read
80      !
81      NAMELIST/namflo/ ln_floats, jpnfl, jpnnewflo, ln_rstflo, nn_writefl, nn_stockfl, ln_argo, ln_flork4, ln_ariane, ln_flo_ascii
82      !!---------------------------------------------------------------------
83      !
84      IF(lwp) WRITE(numout,*)
85      IF(lwp) WRITE(numout,*) 'flo_stp : call floats routine '
86      IF(lwp) WRITE(numout,*) '~~~~~~~'
87
88      READ  ( numnam_ref, namflo, IOSTAT = ios, ERR = 901)
89901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namflo in reference namelist' )
90
91      READ  ( numnam_cfg, namflo, IOSTAT = ios, ERR = 902 )
92902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namflo in configuration namelist' )
93      IF(lwm) WRITE ( numond, namflo )
94      !
95      IF(lwp) THEN                  ! control print
96         WRITE(numout,*)
97         WRITE(numout,*) '         Namelist floats :'
98         WRITE(numout,*) '            Activate floats or not                   ln_floats    = ', ln_floats
99         WRITE(numout,*) '               number of floats                      jpnfl        = ', jpnfl
100         WRITE(numout,*) '               number of new floats                  jpnflnewflo  = ', jpnnewflo
101         WRITE(numout,*) '               restart                               ln_rstflo    = ', ln_rstflo
102         WRITE(numout,*) '               frequency of float output file        nn_writefl   = ', nn_writefl
103         WRITE(numout,*) '               frequency of float restart file       nn_stockfl   = ', nn_stockfl
104         WRITE(numout,*) '               Argo type floats                      ln_argo      = ', ln_argo
105         WRITE(numout,*) '               Computation of T trajectories         ln_flork4    = ', ln_flork4
106         WRITE(numout,*) '               Use of ariane convention              ln_ariane    = ', ln_ariane
107         WRITE(numout,*) '               ascii output (T) or netcdf output (F) ln_flo_ascii = ', ln_flo_ascii
108
109      ENDIF
110      !
111      IF( ln_floats ) THEN
112         !                             ! allocate floats arrays
113         IF( flo_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_init : unable to allocate arrays' )
114         !
115         !                             ! allocate flodom arrays
116         IF( flo_dom_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_dom : unable to allocate arrays' )
117         !
118         !                             ! allocate flowri arrays
119         IF( flo_wri_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_wri : unable to allocate arrays' )
120         !
121         !                             ! allocate florst arrays
122         IF( flo_rst_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_rst : unable to allocate arrays' )
123         !
124         jpnrstflo = jpnfl-jpnnewflo   ! memory allocation
125         !
126         DO jfl = 1, jpnfl             ! vertical axe for netcdf IOM ouput
127            nfloat(jfl) = jfl 
128         END DO
129         !
130         CALL flo_dom                  ! compute/read initial position of floats
131         !
132         wb(:,:,:) = wn(:,:,:)         ! set wb for computation of floats trajectories at the first time step
133         !
134      ENDIF
135      !
136   END SUBROUTINE flo_init
137
138   !!======================================================================
139 END MODULE floats
Note: See TracBrowser for help on using the repository browser.