/[MITgcm]/MITgcm/pkg/ecco/cost_gencost_assignperiod.F
ViewVC logotype

Contents of /MITgcm/pkg/ecco/cost_gencost_assignperiod.F

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


Revision 1.5 - (show annotations) (download)
Mon Jun 27 13:13:38 2011 UTC (12 years, 10 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint63p, checkpoint63q, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint63
Changes since 1.4: +5 -1 lines
- bug fix: those tests break the ALLOW_GENCOST_FREEFORM case.

1 C $Header: /u/gcmpack/MITgcm/pkg/ecco/cost_gencost_assignperiod.F,v 1.4 2011/06/19 22:47:51 heimbach Exp $
2 C $Name: $
3
4 #include "COST_CPPOPTIONS.h"
5
6 subroutine cost_gencost_assignperiod(
7 I startofday, startofmonth, startofyear,
8 I inday, inmonth, inyear,
9 I endofday, endofmonth, endofyear,
10 O startofgen, endofgen, ingen,
11 O sum1gen, genrec,
12 I mythid )
13
14 c ==================================================================
15 c SUBROUTINE cost_gencost_assignperiod
16 c ==================================================================
17
18 implicit none
19
20 c == global variables ==
21
22 #include "EEPARAMS.h"
23 #include "SIZE.h"
24 #include "PARAMS.h"
25 #include "optim.h"
26 #include "ecco_cost.h"
27 #include "ctrl_dummy.h"
28
29 c == routine arguments ==
30
31 logical startofday
32 logical startofmonth
33 logical startofyear
34 logical inday
35 logical inmonth
36 logical inyear
37 logical endofday
38 logical endofmonth
39 logical endofyear
40 logical startofgen(NGENCOST)
41 logical endofgen(NGENCOST)
42 logical ingen(NGENCOST)
43 integer sum1gen(NGENCOST)
44 integer genrec(NGENCOST)
45
46 integer mythid
47
48 #ifdef ALLOW_GENCOST_CONTRIBUTION
49 c == local variables ==
50
51 integer num_var
52
53 c == end of interface ==
54
55 do num_var = 1, NGENCOST
56 #ifndef ALLOW_GENCOST_FREEFORM
57 if ( gencost_datafile(num_var) .ne. ' ' ) then
58 #endif
59 if ( gencost_avgperiod(num_var) .EQ. 'day' .OR.
60 & gencost_avgperiod(num_var) .EQ. 'DAY' ) then
61 startofgen(num_var) = startofday
62 endofgen(num_var) = endofday
63 ingen(num_var) = inday
64 sum1gen(num_var) = sum1day
65 genrec(num_var) = dayrec
66 else if ( gencost_avgperiod(num_var) .EQ. 'month' .OR.
67 & gencost_avgperiod(num_var) .EQ. 'MONTH' ) then
68 startofgen(num_var) = startofmonth
69 endofgen(num_var) = endofmonth
70 ingen(num_var) = inmonth
71 sum1gen(num_var) = sum1mon
72 genrec(num_var) = monrec
73 else if ( gencost_avgperiod(num_var) .EQ. 'year' .OR.
74 & gencost_avgperiod(num_var) .EQ. 'YEAR' ) then
75 startofgen(num_var) = startofyear
76 endofgen(num_var) = endofyear
77 ingen(num_var) = inyear
78 sum1gen(num_var) = sum1year
79 genrec(num_var) = yearrec
80 #ifndef ALLOW_GENCOST_FREEFORM
81 else
82 STOP 'gencost_avgperiod wrongly specified'
83 #endif
84 end if
85 #ifndef ALLOW_GENCOST_FREEFORM
86 end if
87 #endif
88 end do
89
90 #endif /* ALLOW_GENCOST_CONTRIBUTION */
91
92 end

  ViewVC Help
Powered by ViewVC 1.1.22