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.
florst.F90 in trunk/NEMOGCM/NEMO/OPA_SRC/FLO – NEMO

source: trunk/NEMOGCM/NEMO/OPA_SRC/FLO/florst.F90 @ 7753

Last change on this file since 7753 was 7646, checked in by timgraham, 7 years ago

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1MODULE florst
2   !!======================================================================
3   !!                       ***  MODULE  florst  ***
4   !! Ocean floats : write floats restart files
5   !!======================================================================
6   !!  History :  OPA  !  1999-09  (Y. Drillet)    : Original code
7   !!              -   !  2000-06  (J.-M. Molines) : Profiling floats for CLS
8   !!   NEMO      1.0  !  2002-10  (A. Bozec)  F90 : Free form and module
9   !!             3.2  !  2010-08  (slaw, cbricaud): netcdf outputs and others
10   !!----------------------------------------------------------------------
11#if   defined key_floats
12   !!----------------------------------------------------------------------
13   !!   'key_floats'                                     float trajectories
14   !!----------------------------------------------------------------------
15   USE flo_oce         ! ocean drifting floats
16   USE dom_oce         ! ocean space and time domain
17   USE lib_mpp         ! distribued memory computing library
18   USE in_out_manager  ! I/O manager
19
20   IMPLICIT NONE
21   PRIVATE
22
23   PUBLIC flo_rst         ! routine called by floats.F90
24   PUBLIC flo_rst_alloc   ! routine called by floats.F90
25
26   INTEGER, ALLOCATABLE, DIMENSION(:) :: iperproc   ! 1D workspace
27
28   !!----------------------------------------------------------------------
29   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009)
30   !! $Id$
31   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
32   !!----------------------------------------------------------------------
33CONTAINS
34
35   INTEGER FUNCTION flo_rst_alloc()
36      !!-------------------------------------------------------------------
37      !!                ***  FUNCTION flo_rst_alloc  ***
38      !!-------------------------------------------------------------------
39      ALLOCATE( iperproc(jpnij), STAT=flo_rst_alloc )
40     
41      IF( lk_mpp             )   CALL mpp_sum ( flo_rst_alloc )
42      IF( flo_rst_alloc /= 0 )   CALL ctl_warn('flo_rst_alloc: failed to allocate arrays.')
43   END FUNCTION flo_rst_alloc
44
45
46   SUBROUTINE flo_rst( kt )
47      !!---------------------------------------------------------------------
48      !!                  ***  ROUTINE flo_rst ***
49      !!             
50      !! ** Purpose : 
51      !!             
52      !!     
53      !! ** Method  :   The frequency of  ??? is nwritefl
54      !!     
55      !!----------------------------------------------------------------------
56      INTEGER  :: kt                            ! time step
57      !
58      CHARACTER (len=80)       :: clname             ! restart filename
59      INTEGER                  :: ic , jc , jpn ,jfl ! temporary integer
60      INTEGER                  :: inum               ! temporary logical unit for restart file
61      !!----------------------------------------------------------------------
62
63      IF(  ( MOD(kt,nn_stockfl) == 0 ) .OR. ( kt == nitend )  )THEN     
64
65         IF(lwp) THEN
66            WRITE(numout,*)
67            WRITE(numout,*) 'flo_rst : write in  restart_float file '
68            WRITE(numout,*) '~~~~~~~    '
69         ENDIF
70
71         ! file is opened and closed every time it is used.
72
73         clname = 'restart.float.'
74         ic = 1
75         DO jc = 1, 16
76            IF( cexper(jc:jc) /= ' ' ) ic = jc
77         END DO
78         clname = clname(1:14)//cexper(1:ic)
79         ic = 1
80         DO jc = 1, 48
81            IF( clname(jc:jc) /= ' ' ) ic = jc
82         END DO
83
84         inum=0
85         IF( lwp )THEN
86            CALL ctl_opn( inum, clname, 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
87            REWIND inum
88         ENDIF
89         !
90         DO jpn = 1, jpnij
91            iperproc(jpn) = 0
92         END DO
93         !
94         IF(lwp) THEN
95            REWIND(inum)
96            WRITE (inum,*) tpifl,tpjfl,tpkfl,nisobfl,ngrpfl
97            CLOSE (inum)
98         ENDIF
99         !
100         ! Compute the number of trajectories for each processor
101         !
102         IF( lk_mpp ) THEN
103            DO jfl = 1, jpnfl
104               IF( (INT(tpifl(jfl)) >= mig(nldi)) .AND.   &
105                  &(INT(tpifl(jfl)) <= mig(nlei)) .AND.   &
106                  &(INT(tpjfl(jfl)) >= mjg(nldj)) .AND.   &
107                  &(INT(tpjfl(jfl)) <= mjg(nlej)) ) THEN
108                  iperproc(narea) = iperproc(narea)+1
109               ENDIF
110            END DO
111            CALL mpp_sum( iperproc, jpnij )
112            !
113            IF(lwp) THEN
114               WRITE(numout,*) 'DATE',adatrj
115               DO jpn = 1, jpnij
116                  IF( iperproc(jpn) /= 0 ) THEN
117                     WRITE(numout,*)'PROCESSOR',jpn-1,'compute',iperproc(jpn), 'trajectories.'
118                  ENDIF
119               END DO
120            ENDIF
121         ENDIF
122         !
123      ENDIF
124      !
125   END SUBROUTINE flo_rst
126
127#  else
128   !!----------------------------------------------------------------------
129   !!   Default option                                         Empty module
130   !!----------------------------------------------------------------------
131CONTAINS
132   SUBROUTINE flo_rst                 ! Empty routine
133   END SUBROUTINE flo_rst
134#endif
135
136   !!=======================================================================
137END MODULE florst
Note: See TracBrowser for help on using the repository browser.