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