/[MITgcm]/MITgcm/pkg/ctrl/ctrl_bound.F
ViewVC logotype

Contents of /MITgcm/pkg/ctrl/ctrl_bound.F

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


Revision 1.3 - (show annotations) (download)
Sat Feb 9 23:28:59 2008 UTC (16 years, 2 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint63p, checkpoint63q, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59o, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.2: +65 -35 lines
- Rewrite of ctrl_map_ini_ecco.F, introducing a generic
routine (ctrl_map_ini_gen.F).
- Modification of ctrl_bound/adctrl_bound handling
control vector bounds.

1 C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_bound.F,v 1.2 2007/10/09 00:00:00 jmc Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 C !ROUTINE: CTRL_BOUND_3D
7 C !INTERFACE:
8 SUBROUTINE CTRL_BOUND_3D(
9 I fieldCur,maskFld3d,
10 I boundsVec,myThid)
11 C !DESCRIPTION: \bv
12 C *==========================================================*
13 C | started: Gael Forget gforget@mit.edu 20-Aug-2007
14 C |
15 C | o in forward mode: impose bounds on ctrl vector values
16 C | o in adjoint mode: do nothing ... or emulate local minimum
17 C *==========================================================*
18
19 #include "SIZE.h"
20 #include "EEPARAMS.h"
21 #include "PARAMS.h"
22
23 integer myThid,bi,bj,i,j,k
24 integer itlo,ithi,jtlo,jthi
25 _RL fieldCur(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nsx,nsy)
26 _RL maskFld3d(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nsx,nsy)
27 _RL boundsVec(5)
28
29 jtlo = mybylo(mythid)
30 jthi = mybyhi(mythid)
31 itlo = mybxlo(mythid)
32 ithi = mybxhi(mythid)
33
34 if (boundsVec(1).LT.boundsVec(4)) then
35
36 do bj = jtlo,jthi
37 do bi = itlo,ithi
38 do k = 1,nr
39 do j = 1,sny
40 do i = 1,snx
41 IF (maskFld3d(i,j,k,bi,bj).NE.0.) then
42 IF (fieldCur(i,j,k,bi,bj).gt.boundsVec(4)) then
43 fieldCur(i,j,k,bi,bj)=boundsVec(4)
44 ENDIF
45 IF (fieldCur(i,j,k,bi,bj).lt.boundsVec(1)) then
46 fieldCur(i,j,k,bi,bj)=boundsVec(1)
47 ENDIF
48 ENDIF
49 enddo
50 enddo
51 enddo
52 enddo
53 enddo
54
55 endif
56
57 end
58
59 C !ROUTINE: CTRL_BOUND_2D
60 C !INTERFACE:
61 SUBROUTINE CTRL_BOUND_2D(
62 I fieldCur,maskFld3d,
63 I boundsVec,myThid)
64 C !DESCRIPTION: \bv
65 C *==========================================================*
66 C | started: Gael Forget gforget@mit.edu 20-Aug-2007
67 C |
68 C | o in forward mode: impose bounds on ctrl vector values
69 C | o in adjoint mode: do nothing ... or emulate local minimum
70 C *==========================================================*
71
72 #include "SIZE.h"
73 #include "EEPARAMS.h"
74 #include "PARAMS.h"
75
76
77 integer myThid,bi,bj,i,j,k
78 integer itlo,ithi,jtlo,jthi
79 _RL fieldCur(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nsx,nsy)
80 _RL maskFld3d(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nsx,nsy)
81 _RL boundsVec(5)
82
83 jtlo = mybylo(mythid)
84 jthi = mybyhi(mythid)
85 itlo = mybxlo(mythid)
86 ithi = mybxhi(mythid)
87
88 if (boundsVec(1).LT.boundsVec(4)) then
89
90 do bj = jtlo,jthi
91 do bi = itlo,ithi
92 do j = 1-oly,sny+oly
93 do i = 1-olx,snx+olx
94 IF (maskFld3d(i,j,1,bi,bj).NE.0.) then
95 IF (fieldCur(i,j,bi,bj).gt.boundsVec(4)) then
96 fieldCur(i,j,bi,bj)=boundsVec(4)
97 ENDIF
98 IF (fieldCur(i,j,bi,bj).lt.boundsVec(1)) then
99 fieldCur(i,j,bi,bj)=boundsVec(1)
100 ENDIF
101 ENDIF
102 enddo
103 enddo
104 enddo
105 enddo
106
107 endif
108
109
110 end
111

  ViewVC Help
Powered by ViewVC 1.1.22