-
Notifications
You must be signed in to change notification settings - Fork 237
/
rw_get_suffix.F
56 lines (46 loc) · 1.34 KB
/
rw_get_suffix.F
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
#include "RW_OPTIONS.h"
CBOP
C !ROUTINE: RW_GET_SUFFIX
C !INTERFACE:
SUBROUTINE RW_GET_SUFFIX(
O suff,
I myTime, myIter, myThid )
C !DESCRIPTION: \bv
C Return a suffix for file names to read/write.
C Default is myIter. Options are for seconds, hours etc, as below
C !USES:
IMPLICIT NONE
C Global variables:
#include "SIZE.h"
#include "EEPARAMS.h"
#include "PARAMS.h"
C !INPUT PARAMETERS:
C myTime :: Current time in simulation
C myIter :: Current iteration number in simulation
C myThid :: My Thread Id number
_RL myTime
INTEGER myIter
INTEGER myThid
C !OUTPUT PARAMETERS:
C suff :: file-name suffix (10.c long)
CHARACTER*(*) suff
C !LOCAL VARIABLES:
CEOP
IF ( rwSuffixType.EQ.1 ) THEN
C 100ths of a second
WRITE(suff,'(I10.10)') NINT( myTime*100. _d 0 )
ELSEIF ( rwSuffixType.EQ.2 ) THEN
C seconds
WRITE(suff,'(I10.10)') NINT( myTime )
ELSEIF ( rwSuffixType.EQ.3 ) THEN
C 10ths hours
WRITE(suff,'(I10.10)') NINT( myTime/360. _d 0 )
ELSEIF ( rwSuffixType.EQ.4 ) THEN
C hours
WRITE(suff,'(I10.10)') NINT( myTime/3600. _d 0 )
ELSE
C default, iteration number
WRITE(suff,'(I10.10)') myIter
ENDIF
RETURN
END