1 |
C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_cost_init_fixed.F,v 1.2 2005/09/01 05:34:31 heimbach Exp $ |
2 |
|
3 |
#include "PACKAGES_CONFIG.h" |
4 |
#include "AD_CONFIG.h" |
5 |
#include "SEAICE_OPTIONS.h" |
6 |
|
7 |
subroutine seaice_cost_init_fixed( mythid ) |
8 |
|
9 |
c ================================================================== |
10 |
c SUBROUTINE seaice_cost_init_fixed |
11 |
c ================================================================== |
12 |
c |
13 |
c o Set contributions to the cost function and the cost function |
14 |
c itself to zero. The cost function and the individual contribu- |
15 |
c tions are defined in the header file "SEAICE_COST.h". |
16 |
c |
17 |
c ================================================================== |
18 |
c SUBROUTINE seaice_cost_init_fixed |
19 |
c ================================================================== |
20 |
|
21 |
implicit none |
22 |
|
23 |
c == global variables == |
24 |
|
25 |
#include "EEPARAMS.h" |
26 |
#include "SIZE.h" |
27 |
#include "GRID.h" |
28 |
#include "PARAMS.h" |
29 |
#ifdef ALLOW_COST |
30 |
# include "SEAICE_COST.h" |
31 |
#endif |
32 |
#ifdef ALLOW_CAL |
33 |
# include "cal.h" |
34 |
#endif |
35 |
|
36 |
c == routine arguments == |
37 |
|
38 |
integer mythid |
39 |
|
40 |
#ifdef ALLOW_COST |
41 |
c == local variables == |
42 |
|
43 |
integer tempDate1(4) |
44 |
integer tempDate2(4) |
45 |
|
46 |
logical exst |
47 |
|
48 |
c == external functions == |
49 |
|
50 |
#ifdef ALLOW_CAL |
51 |
integer cal_IntMonths |
52 |
external cal_IntMonths |
53 |
integer cal_IntDays |
54 |
external cal_IntDays |
55 |
#endif |
56 |
|
57 |
c == end of interface == |
58 |
|
59 |
#ifdef ALLOW_CAL |
60 |
|
61 |
_BEGIN_MASTER( myThid ) |
62 |
|
63 |
c-- Sea-ice cost function start and stop times in model seconds. |
64 |
c |
65 |
call cal_FullDate ( costIceStart1 , costIceStart2, |
66 |
& tempDate1 , mythid ) |
67 |
call cal_TimePassed( modelstartdate, tempDate1 , |
68 |
& tempDate2 , mythid ) |
69 |
call cal_ToSeconds ( tempDate2 , costIceStart , mythid ) |
70 |
costIceStart = costIceStart + startTime |
71 |
c |
72 |
call cal_FullDate ( costIceEnd1 , costIceEnd2 , |
73 |
& tempDate1 , mythid ) |
74 |
call cal_TimePassed( modelstartdate, tempDate1 , |
75 |
& tempDate2 , mythid ) |
76 |
call cal_ToSeconds ( tempDate2 , costIceEnd , mythid ) |
77 |
costIceEnd = costIceEnd + startTime |
78 |
c-- |
79 |
call cal_FullDate( smrareastartdate1, smrareastartdate2, |
80 |
& smrareastartdate, mythid ) |
81 |
|
82 |
_END_MASTER( mythid ) |
83 |
|
84 |
#endif /* ALLOW_CAL */ |
85 |
|
86 |
c-- Get the weights that are to be used for the individual cost |
87 |
c-- function contributions. |
88 |
call seaice_cost_weights( mythid ) |
89 |
|
90 |
c-- Initialise adjoint of monthly mean files calculated |
91 |
c-- in cost_averagesfields (and their ad...). |
92 |
cph( |
93 |
cph The following init. shoud not be applied if in the middle |
94 |
cph of a divided adjoint run |
95 |
cph) |
96 |
#ifndef ALLOW_TANGENTLINEAR_RUN |
97 |
cph!!! and I think it needs to be seen by TAF |
98 |
cph!!! for repeated TLM runs |
99 |
cph!!! |
100 |
inquire( file='costfinal', exist=exst ) |
101 |
if ( .NOT. exst) then |
102 |
cph call seaice_cost_init_barfiles( mythid ) |
103 |
endif |
104 |
#endif |
105 |
|
106 |
_BARRIER |
107 |
|
108 |
#endif /* ALLOW_COST */ |
109 |
|
110 |
end |