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

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

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


Revision 1.1 - (hide annotations) (download)
Thu Sep 1 05:34:31 2005 UTC (18 years, 8 months ago) by heimbach
Branch: MAIN
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.1 C $Header: /u/gcmpack/MITgcm/pkg/ecco/ecco_cost_weights.F,v 1.13 2005/08/06 11:02:01 heimbach Exp $
2    
3     #include "SEAICE_OPTIONS.h"
4    
5     subroutine seaice_cost_weights( mythid )
6    
7     c ==================================================================
8     c SUBROUTINE seaice_cost_weights
9     c ==================================================================
10     c
11     c ==================================================================
12     c SUBROUTINE seaice_cost_weights
13     c ==================================================================
14    
15     implicit none
16    
17     c == global variables ==
18    
19     #include "EEPARAMS.h"
20     #include "SIZE.h"
21     #include "PARAMS.h"
22     #include "GRID.h"
23    
24     #include "ctrl.h"
25     #include "ecco_cost.h"
26     #ifdef ALLOW_COST
27     # include "SEAICE_COST.h"
28     #endif
29    
30     c == routine arguments ==
31    
32     integer mythid
33    
34     c == local variables ==
35    
36     integer bi,bj
37     integer i,j,k
38     integer itlo,ithi
39     integer jtlo,jthi
40     integer jmin,jmax
41     integer imin,imax
42     integer gwunit
43     integer irec,nnz
44     integer ilo,ihi
45    
46     _RL dummy
47    
48     c == external ==
49    
50     integer ifnblnk
51     external ifnblnk
52     integer ilnblnk
53     external ilnblnk
54    
55     c == end of interface ==
56    
57     jtlo = mybylo(mythid)
58     jthi = mybyhi(mythid)
59     itlo = mybxlo(mythid)
60     ithi = mybxhi(mythid)
61     jmin = 1-oly
62     jmax = sny+oly
63     imin = 1-olx
64     imax = snx+olx
65    
66     do bj = jtlo,jthi
67     do bi = itlo,ithi
68     do j = jmin,jmax
69     do i = imin,imax
70     wsmrarea (i,j,bi,bj) = 0. _d 0
71     enddo
72     enddo
73     enddo
74     enddo
75    
76    
77     c-- Define frame.
78     do j = jmin,jmax
79     do i = imin,imax
80     c-- North/South and West/East edges set to zero.
81     if ( (j .lt. 1) .or. (j .gt. sny) .or.
82     & (i .lt. 1) .or. (i .gt. snx) ) then
83     frame(i,j) = 0. _d 0
84     else
85     frame(i,j) = 1. _d 0
86     endif
87     enddo
88     enddo
89    
90     #ifdef ALLOW_SEAICE_COST_SMR_AREA
91     c--
92     nnz = 1
93     irec = 1
94     k = 1
95     if ( smrarea_errfile .NE. ' ' ) then
96     call mdsreadfield( smrarea_errfile, cost_iprec, cost_yftype,
97     & nnz, wsmrarea, irec, mythid )
98     do bj = jtlo,jthi
99     do bi = itlo,ithi
100     do j = jmin,jmax
101     do i = imin,imax
102     wsmrarea(i,j,bi,bj) = wsmrarea(i,j,bi,bj)
103     & *frame(i,j)*_hFacC(i,j,k,bi,bj)
104     enddo
105     enddo
106     enddo
107     enddo
108     else
109     do bj = jtlo,jthi
110     do bi = itlo,ithi
111     do j = jmin,jmax
112     do i = imin,imax
113     wsmrarea(i,j,bi,bj) = wsmrarea0
114     & *frame(i,j)*_hFacC(i,j,k,bi,bj)
115     enddo
116     enddo
117     enddo
118     enddo
119     endif
120     c--
121     do bj = jtlo,jthi
122     do bi = itlo,ithi
123     do j = jmin,jmax
124     do i = imin,imax
125     if (wsmrarea(i,j,bi,bj) .ne. 0.)
126     & wsmrarea(i,j,bi,bj) =
127     & 1./wsmrarea(i,j,bi,bj)/wsmrarea(i,j,bi,bj)
128     enddo
129     enddo
130     enddo
131     enddo
132     #endif /* ALLOW_SEAICE_COST_SMR_AREA */
133    
134     end

  ViewVC Help
Powered by ViewVC 1.1.22