/[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.8 - (hide annotations) (download)
Mon Oct 20 03:20:57 2014 UTC (9 years, 6 months 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, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65g, HEAD
Changes since 1.7: +12 -8 lines
- ECCO_OPTIONS.h is needed when including ecco_cost.h, ecco.h
- AUTODIFF_OPTIONS.h is needed when including tamc.h, tamc_keys.h
- CTRL_OPTIONS.h is needed when including ctrl.h, etc

- pkg/seaice/seaice_cost*.F : clean up CPP brackets
- SEAICE_SIZE.h : replace ALLOW_AUTODIFF_TAMC with ALLOW_AUTODIFF to
  avoid needing AUTODIFF_OPTIONS.h anytime SEAICE_SIZE.h is included
  (it seems that THSICE_SIZE.h, PTRACERS_SIZE.h have the same issue...)

1 gforget 1.8 C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_cost_weights.F,v 1.7 2014/10/11 19:02:25 gforget Exp $
2 jmc 1.5 C $Name: $
3 heimbach 1.1
4     #include "SEAICE_OPTIONS.h"
5 gforget 1.8 #ifdef ALLOW_ECCO
6     #include "ECCO_OPTIONS.h"
7     #endif
8     #ifdef ALLOW_CTRL
9     #include "CTRL_OPTIONS.h"
10     #endif
11 heimbach 1.1
12     subroutine seaice_cost_weights( mythid )
13    
14     c ==================================================================
15     c SUBROUTINE seaice_cost_weights
16     c ==================================================================
17     c
18     c ==================================================================
19     c SUBROUTINE seaice_cost_weights
20     c ==================================================================
21    
22     implicit none
23    
24     c == global variables ==
25    
26     #include "EEPARAMS.h"
27     #include "SIZE.h"
28     #include "PARAMS.h"
29     #include "GRID.h"
30    
31 gforget 1.8 #ifdef ALLOW_CTRL
32 heimbach 1.3 # include "ctrl.h"
33 heimbach 1.1 #endif
34 gforget 1.8 #ifdef ALLOW_ECCO
35     # include "ecco.h"
36     #endif
37     #include "SEAICE_COST.h"
38 heimbach 1.1
39     c == routine arguments ==
40    
41     integer mythid
42    
43 heimbach 1.4 #ifdef ALLOW_ECCO
44 heimbach 1.1 c == local variables ==
45    
46     integer bi,bj
47     integer i,j,k
48     integer itlo,ithi
49     integer jtlo,jthi
50     integer jmin,jmax
51     integer imin,imax
52     integer gwunit
53     integer irec,nnz
54     integer ilo,ihi
55    
56     _RL dummy
57    
58     c == external ==
59    
60     integer ifnblnk
61     external ifnblnk
62     integer ilnblnk
63     external ilnblnk
64    
65     c == end of interface ==
66    
67     jtlo = mybylo(mythid)
68     jthi = mybyhi(mythid)
69     itlo = mybxlo(mythid)
70     ithi = mybxhi(mythid)
71     jmin = 1-oly
72     jmax = sny+oly
73     imin = 1-olx
74     imax = snx+olx
75    
76     c-- Define frame.
77     do j = jmin,jmax
78     do i = imin,imax
79     c-- North/South and West/East edges set to zero.
80     if ( (j .lt. 1) .or. (j .gt. sny) .or.
81     & (i .lt. 1) .or. (i .gt. snx) ) then
82     frame(i,j) = 0. _d 0
83     else
84     frame(i,j) = 1. _d 0
85     endif
86     enddo
87     enddo
88    
89     #ifdef ALLOW_SEAICE_COST_SMR_AREA
90 heimbach 1.2
91     do bj = jtlo,jthi
92     do bi = itlo,ithi
93     do j = jmin,jmax
94     do i = imin,imax
95     wsmrarea (i,j,bi,bj) = 0. _d 0
96     enddo
97     enddo
98     enddo
99     enddo
100 jmc 1.5 c--
101 heimbach 1.1 nnz = 1
102     irec = 1
103     k = 1
104 jmc 1.5 if ( smrarea_errfile .NE. ' ' ) then
105 jmc 1.6 IF ( cost_yftype.EQ.'RL' ) THEN
106     CALL READ_REC_3D_RL( smrarea_errfile, cost_iprec, nnz,
107     & wsmrarea, irec, 0, mythid )
108     ELSE
109     STOP 'S/R SEAICE_COST_WEIGHTS: invalid cost_yftype'
110     ENDIF
111 heimbach 1.1 do bj = jtlo,jthi
112     do bi = itlo,ithi
113     do j = jmin,jmax
114     do i = imin,imax
115     wsmrarea(i,j,bi,bj) = wsmrarea(i,j,bi,bj)
116     & *frame(i,j)*_hFacC(i,j,k,bi,bj)
117     enddo
118     enddo
119     enddo
120     enddo
121     else
122     do bj = jtlo,jthi
123     do bi = itlo,ithi
124     do j = jmin,jmax
125     do i = imin,imax
126     wsmrarea(i,j,bi,bj) = wsmrarea0
127     & *frame(i,j)*_hFacC(i,j,k,bi,bj)
128     enddo
129     enddo
130     enddo
131     enddo
132     endif
133     c--
134     do bj = jtlo,jthi
135     do bi = itlo,ithi
136     do j = jmin,jmax
137     do i = imin,imax
138     if (wsmrarea(i,j,bi,bj) .ne. 0.)
139 jmc 1.5 & wsmrarea(i,j,bi,bj) =
140 heimbach 1.1 & 1./wsmrarea(i,j,bi,bj)/wsmrarea(i,j,bi,bj)
141     enddo
142     enddo
143     enddo
144     enddo
145     #endif /* ALLOW_SEAICE_COST_SMR_AREA */
146    
147 heimbach 1.2 #endif
148    
149 heimbach 1.1 end

  ViewVC Help
Powered by ViewVC 1.1.22