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

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

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


Revision 1.4 - (hide annotations) (download)
Thu Sep 1 05:34:31 2005 UTC (18 years, 10 months ago) by heimbach
Branch: MAIN
Changes since 1.3: +16 -3 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 heimbach 1.4 C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_cost_final.F,v 1.3 2005/08/25 18:23:12 heimbach Exp $
2 heimbach 1.1
3     #include "SEAICE_OPTIONS.h"
4    
5    
6     subroutine seaice_cost_final( mythid )
7    
8     c ==================================================================
9     c SUBROUTINE seaice_cost_final
10     c ==================================================================
11     c
12     c ==================================================================
13     c SUBROUTINE seaice_cost_final
14     c ==================================================================
15    
16     implicit none
17    
18     c == global variables ==
19    
20     #include "EEPARAMS.h"
21     #include "SIZE.h"
22     #include "PARAMS.h"
23 heimbach 1.3 #ifdef ALLOW_COST
24 heimbach 1.1 #include "SEAICE_COST.h"
25     #include "cost.h"
26     #include "ctrl.h"
27     #include "optim.h"
28 heimbach 1.3 #endif
29 heimbach 1.1
30     c == routine arguments ==
31    
32     integer mythid
33    
34 heimbach 1.3 #ifdef ALLOW_COST
35    
36 heimbach 1.1 c == local variables ==
37    
38     integer bi,bj
39     integer itlo,ithi
40     integer jtlo,jthi
41     integer ifc
42     integer totnum
43    
44     _RL f_ice
45 heimbach 1.4 _RL f_smrarea
46 heimbach 1.1
47     _RL no_ice
48 heimbach 1.4 _RL no_smrarea
49 heimbach 1.1
50     character*20 cfname
51     #ifdef ECCO_VERBOSE
52     character*(MAX_LEN_MBUF) msgbuf
53     #endif
54    
55     c == end of interface ==
56    
57     jtlo = mybylo(mythid)
58     jthi = mybyhi(mythid)
59     itlo = mybxlo(mythid)
60     ithi = mybxhi(mythid)
61    
62     ifc = 30
63    
64 heimbach 1.4 f_ice = 0. _d 0
65     f_smrarea = 0. _d 0
66     c
67     no_ice = 0. _d 0
68     no_smrarea = 0. _d 0
69 heimbach 1.1
70     c-- Sum up all contributions.
71     do bj = jtlo,jthi
72     do bi = itlo,ithi
73    
74     fc = fc
75     & + mult_ice * objf_ice(bi,bj)
76 heimbach 1.4 & + mult_smrarea * objf_smrarea(bi,bj)
77 heimbach 1.1
78     f_ice = f_ice + objf_ice(bi,bj)
79 heimbach 1.4 f_smrarea = f_smrarea + objf_smrarea(bi,bj)
80 heimbach 1.1
81     no_ice = no_ice + num_ice(bi,bj)
82 heimbach 1.4 no_smrarea = no_smrarea + num_smrarea(bi,bj)
83 heimbach 1.1
84     enddo
85     enddo
86    
87     c-- Do global summation.
88     _GLOBAL_SUM_R8( fc , myThid )
89    
90     c-- Do global summation for each part of the cost function
91    
92     _GLOBAL_SUM_R8( f_ice , myThid )
93 heimbach 1.4 _GLOBAL_SUM_R8( f_smrarea , myThid )
94 heimbach 1.1
95     _GLOBAL_SUM_R8( no_ice , myThid )
96 heimbach 1.4 _GLOBAL_SUM_R8( no_smrarea , myThid )
97 heimbach 1.1
98     write(standardmessageunit,'(A,D22.15)')
99     & ' --> f_ice =',f_ice
100 heimbach 1.4 write(standardmessageunit,'(A,D22.15)')
101     & ' --> f_smrarea =',f_smrarea
102 heimbach 1.1
103     c-- Each process has calculated the global part for itself.
104     _BEGIN_MASTER( mythid )
105    
106     write(cfname,'(A,i4.4)') 'costfunction_seaice',optimcycle
107     open(unit=ifc,file=cfname)
108    
109     write(ifc,*) 'fc =', fc
110     write(ifc,*) 'f_ice =', f_ice, no_ice
111 heimbach 1.4 write(ifc,*) 'f_smrarea =', f_smrarea, no_smrarea
112 heimbach 1.1
113     close(ifc)
114    
115     _END_MASTER( mythid )
116    
117     taveFreq = 0.
118     dumpFreq = 0.
119     pChkptFreq = 0.
120     monitorFreq = 0.
121     useDiagnostics = .FALSE.
122    
123 heimbach 1.3 #endif
124    
125 heimbach 1.1 end

  ViewVC Help
Powered by ViewVC 1.1.22