/[MITgcm]/MITgcm/pkg/seaice/seaice_cost_init_fixed.F
ViewVC logotype

Annotation of /MITgcm/pkg/seaice/seaice_cost_init_fixed.F

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


Revision 1.7 - (hide annotations) (download)
Mon Mar 23 21:04:59 2015 UTC (9 years, 1 month ago) by gforget
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65k, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, HEAD
Changes since 1.6: +4 -1 lines
- add CPP brackets.

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

  ViewVC Help
Powered by ViewVC 1.1.22