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

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

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


Revision 1.2 - (show annotations) (download)
Thu Sep 1 05:34:31 2005 UTC (18 years, 8 months ago) by heimbach
Branch: MAIN
Changes since 1.1: +7 -4 lines
o Adding cost term for seaice obs (daily SMR vs. AREA)
  new seaice_cost init/weight/final routines
o Modularized cost_averages routines (new cost_averagesgeneric.F)

1 C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_cost_init_fixed.F,v 1.1 2005/08/25 16:10:42 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 #include "SEAICE_COST.h"
30
31 #ifdef ALLOW_CAL
32 # include "cal.h"
33 #endif
34
35 c == routine arguments ==
36
37 integer mythid
38
39 c == local variables ==
40
41 integer tempDate1(4)
42 integer tempDate2(4)
43
44 logical exst
45
46 c == external functions ==
47
48 #ifdef ALLOW_CAL
49 integer cal_IntMonths
50 external cal_IntMonths
51 integer cal_IntDays
52 external cal_IntDays
53 #endif
54
55 c == end of interface ==
56
57 #ifdef ALLOW_CAL
58
59 _BEGIN_MASTER( myThid )
60
61 c-- Sea-ice cost function start and stop times in model seconds.
62 c
63 call cal_FullDate ( costIceStart1 , costIceStart2,
64 & tempDate1 , mythid )
65 call cal_TimePassed( modelstartdate, tempDate1 ,
66 & tempDate2 , mythid )
67 call cal_ToSeconds ( tempDate2 , costIceStart , mythid )
68 costIceStart = costIceStart + startTime
69 c
70 call cal_FullDate ( costIceEnd1 , costIceEnd2 ,
71 & tempDate1 , mythid )
72 call cal_TimePassed( modelstartdate, tempDate1 ,
73 & tempDate2 , mythid )
74 call cal_ToSeconds ( tempDate2 , costIceEnd , mythid )
75 costIceEnd = costIceEnd + startTime
76 c--
77 call cal_FullDate( smrareastartdate1, smrareastartdate2,
78 & smrareastartdate, mythid )
79
80 _END_MASTER( mythid )
81
82 #endif /* ALLOW_CAL */
83
84 c-- Get the weights that are to be used for the individual cost
85 c-- function contributions.
86 call seaice_cost_weights( mythid )
87
88 c-- Initialise adjoint of monthly mean files calculated
89 c-- in cost_averagesfields (and their ad...).
90 cph(
91 cph The following init. shoud not be applied if in the middle
92 cph of a divided adjoint run
93 cph)
94 #ifndef ALLOW_TANGENTLINEAR_RUN
95 cph!!! and I think it needs to be seen by TAF
96 cph!!! for repeated TLM runs
97 cph!!!
98 inquire( file='costfinal', exist=exst )
99 if ( .NOT. exst) then
100 cph call seaice_cost_init_barfiles( mythid )
101 endif
102 #endif
103
104 _BARRIER
105
106 end

  ViewVC Help
Powered by ViewVC 1.1.22