1 |
C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_interp.F,v 1.30 2012/04/02 21:24:54 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "EXF_OPTIONS.h" |
5 |
|
6 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
7 |
|
8 |
CBOP |
9 |
C !ROUTINE: EXF_GETFIELD_START |
10 |
C !INTERFACE: |
11 |
SUBROUTINE EXF_GETFIELD_START( |
12 |
I useYearlyFields, |
13 |
I fld_startdate1, fld_startdate2, |
14 |
O fld_start_time, |
15 |
I myThid ) |
16 |
|
17 |
C !DESCRIPTION: \bv |
18 |
C *==========================================================* |
19 |
C | SUBROUTINE EXF_GETFIELD_START |
20 |
C | o get forcing-field starting-time (in secs); |
21 |
C | distinguish between using Yearly-Fields or not. |
22 |
C *==========================================================* |
23 |
C \ev |
24 |
|
25 |
C !USES: |
26 |
IMPLICIT NONE |
27 |
C === Global variables === |
28 |
#include "SIZE.h" |
29 |
#include "EEPARAMS.h" |
30 |
c#include "cal.h" |
31 |
#include "PARAMS.h" |
32 |
|
33 |
C !INPUT/OUTPUT PARAMETERS: |
34 |
C useYearlyFields :: select if using EXF Yearly-fields or not |
35 |
C fld_startdate1 :: field starting date (YYYYMMDD) |
36 |
C fld_startdate2 :: field starting date (HHMMSS) |
37 |
C fld_start_time :: corresponding starting time (in sec) for this field |
38 |
C myThid :: My Thread Id number |
39 |
LOGICAL useYearlyFields |
40 |
INTEGER fld_startdate1, fld_startdate2 |
41 |
_RL fld_start_time |
42 |
INTEGER myThid |
43 |
|
44 |
C !FUNCTIONS: |
45 |
|
46 |
C !LOCAL VARIABLES: |
47 |
C msgBuf :: Informational/error message buffer |
48 |
c CHARACTER*(MAX_LEN_MBUF) msgBuf |
49 |
INTEGER date_array(4), difftime(4), yearStartDate(4) |
50 |
INTEGER gcm_startdate(4) |
51 |
CEOP |
52 |
|
53 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
54 |
|
55 |
CALL CAL_FULLDATE( fld_startdate1, fld_startdate2, |
56 |
& date_array, myThid ) |
57 |
IF ( useYearlyFields ) THEN |
58 |
yearStartDate(1) = INT(date_array(1)/10000.) * 10000 + 101 |
59 |
yearStartDate(2) = 0 |
60 |
yearStartDate(3) = date_array(3) |
61 |
yearStartDate(4) = date_array(4) |
62 |
CALL cal_TimePassed( yearStartDate,date_array,difftime,myThid) |
63 |
CALL cal_ToSeconds ( difftime, fld_start_time, myThid) |
64 |
ELSE |
65 |
C-- with "cal.h" header file: |
66 |
c CALL cal_TimePassed(modelstartdate,date_array,difftime,myThid) |
67 |
c CALL cal_ToSeconds ( difftime, fld_start_time, myThid) |
68 |
c fld_start_time = modelstart + fld_start_time |
69 |
C-- with "PARAMS.h" header file: |
70 |
CALL cal_getdate( nIter0, startTime, gcm_startdate, myThid ) |
71 |
CALL cal_TimePassed( gcm_startdate,date_array,difftime,myThid) |
72 |
CALL cal_ToSeconds ( difftime, fld_start_time, myThid) |
73 |
fld_start_time = startTime + fld_start_time |
74 |
ENDIF |
75 |
|
76 |
RETURN |
77 |
END |