/[MITgcm]/MITgcm/pkg/exf/exf_getffieldrec.F
ViewVC logotype

Contents of /MITgcm/pkg/exf/exf_getffieldrec.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon May 14 22:08:40 2001 UTC (23 years, 1 month ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint44e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, release1_p13_pre, checkpoint46f_post, checkpoint44f_post, checkpoint46b_post, checkpoint43a-release1mods, release1_p13, checkpoint40pre3, checkpoint40pre1, checkpoint40pre7, checkpoint40pre6, checkpoint40pre9, checkpoint40pre8, checkpoint46l_pre, chkpt44d_post, release1_p8, release1_p9, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint44e_pre, release1_b1, checkpoint43, checkpoint47d_pre, release1_chkpt44d_post, checkpoint47a_post, checkpoint47d_post, icebear4, icebear3, icebear2, checkpoint46d_pre, checkpoint40pre2, release1-branch_tutorials, checkpoint45d_post, checkpoint46j_pre, chkpt44a_post, checkpoint44h_pre, checkpoint40pre4, checkpoint46a_post, checkpoint46j_post, checkpoint46k_post, chkpt44c_pre, checkpoint45a_post, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, release1_p12, release1_p10, release1_p11, release1_p16, release1_p17, release1_p14, release1_p15, checkpoint44g_post, checkpoint46e_pre, checkpoint45b_post, checkpoint46b_pre, release1-branch-end, release1_final_v1, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint44b_post, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint45c_post, ecco_ice2, ecco_ice1, checkpoint44h_post, checkpoint46g_post, release1_p12_pre, checkpoint39, ecco_c44_e22, ecco_c44_e25, checkpoint40pre5, chkpt44a_pre, checkpoint46i_post, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e24, checkpoint46c_post, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, checkpoint46e_post, release1_beta1, checkpoint44b_pre, checkpoint42, checkpoint40, checkpoint41, checkpoint47, checkpoint44, checkpoint45, checkpoint46h_post, chkpt44c_post, checkpoint44f_pre, checkpoint46d_post, release1-branch_branchpoint
Branch point for: c24_e25_ice, release1_final, release1-branch, release1, ecco-branch, release1_50yr, release1_coupled
Added external forcing package.
Not presently supported by mitgcm, i.e. disabled by default.

1 c $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/exf/exf_getffieldrec.F,v 1.1 2001/02/02 19:43:46 heimbach Exp $
2
3 #include "CPP_OPTIONS.h"
4
5
6 subroutine exf_GetFFieldRec(
7 I fldstartdate, fldperiod,
8 O fac,
9 O first,
10 O changed,
11 O count0,
12 O count1,
13 I mytime,
14 I myiter,
15 I mythid
16 & )
17
18 c ==================================================================
19 c SUBROUTINE exf_GetFFieldRec
20 c ==================================================================
21 c
22 c o Get flags, counters, and the linear interpolation factor for a
23 c given field.
24 c
25 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
26 c
27 c changed: Christian Eckert eckert@mit.edu 14-Jan-2000
28 c
29 c - Restructured the code in order to create a package
30 c for the MITgcmUV.
31 c
32 c Christian Eckert eckert@mit.edu 12-Feb-2000
33 c
34 c - Changed Routine names (package prefix: exf_)
35 c
36 c ==================================================================
37 c SUBROUTINE exf_GetFFieldRec
38 c ==================================================================
39
40 implicit none
41
42 c == global variables ==
43
44 c cal: modelstart, modelstep
45 #include "EEPARAMS.h"
46 #include "cal.h"
47
48 c == routine arguments ==
49
50 integer fldstartdate(4)
51 _RL fldperiod
52 _RL fac
53 logical first
54 logical changed
55 integer count0
56 integer count1
57 _RL mytime
58 integer myiter
59 integer mythid
60
61 c == local variables ==
62
63 integer mydate(4)
64 integer previousdate(4)
65 integer difftime(4)
66
67 integer fldcount
68 _RL fldsecs
69 integer prevfldcount
70 _RL prevfldsecs
71 integer flddate(4)
72
73
74 #ifdef EXF_VERBOSE
75 character*(max_len_mbuf) msgbuf
76 #endif
77
78 c == end of interface ==
79
80 c Determine the current date.
81 call cal_GetDate( myiter, mytime, mydate, mythid )
82
83 c Determine the flux record just before mycurrentdate.
84 call cal_TimePassed( fldstartdate, mydate, difftime, mythid )
85 call cal_ToSeconds( difftime, fldsecs, mythid )
86 fldsecs = int(fldsecs/fldperiod)*fldperiod
87 fldcount = int(fldsecs/fldperiod) + 1
88
89 c Set switches for reading new records.
90 first = ((mytime - modelstart) .lt. 0.5*modelstep)
91
92 if ( first) then
93 changed = .false.
94 else
95 call cal_GetDate( myiter-1, mytime-modelstep,
96 & previousdate, mythid )
97
98 call cal_TimePassed( fldstartdate, previousdate, difftime,
99 & mythid )
100 call cal_ToSeconds( difftime, prevfldsecs, mythid )
101 prevfldsecs = int(prevfldsecs/fldperiod)*fldperiod
102 prevfldcount = int(prevfldsecs/fldperiod) + 1
103
104 if (fldcount .ne. prevfldcount) then
105 changed = .true.
106 else
107 changed = .false.
108 endif
109 endif
110
111 count0 = fldcount
112 count1 = fldcount + 1
113
114 call cal_TimeInterval( fldsecs, 'secs', difftime, mythid )
115 call cal_AddTime( fldstartdate, difftime, flddate, mythid )
116 call cal_TimePassed( flddate, mydate, difftime, mythid )
117 call cal_ToSeconds( difftime, fldsecs, mythid )
118
119 c Weight belonging to irec for linear interpolation purposes.
120 c Note: The weight as chosen here is 1. - fac of the "old" MITgcm's
121 c estimation program.
122 fac = 1. - fldsecs/fldperiod
123
124 #ifdef EXF_VERBOSE
125 c Do some printing for the protocol.
126 _BEGIN_MASTER( mythid )
127 write(msgbuf,'(a)') ' '
128 call print_message( msgbuf, standardmessageunit,
129 & SQUEEZE_RIGHT , mythid)
130 write(msgbuf,'(a,2x,l2,2x,l2,2x,D15.8)')
131 & ' exf_GetFFieldsRec: first, changed, fac:',
132 & first, changed, fac
133 call print_message( msgbuf, standardmessageunit,
134 & SQUEEZE_RIGHT , mythid)
135 write(msgbuf,'(a,i4,i4)')
136 & ' exf_GetFFieldsRec: count0, count1:',
137 & count0, count1
138 call print_message( msgbuf, standardmessageunit,
139 & SQUEEZE_RIGHT , mythid)
140 write(msgbuf,'(a)') ' '
141 call print_message( msgbuf, standardmessageunit,
142 & SQUEEZE_RIGHT , mythid)
143 _END_MASTER( mythid )
144 #endif
145
146 end

  ViewVC Help
Powered by ViewVC 1.1.22