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

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

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


Revision 1.1 - (hide annotations) (download)
Mon Aug 20 17:41:24 2007 UTC (16 years, 9 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint59g, checkpoint59f, checkpoint59h
routine to force parameter correction
to stay in a bounded range (in forward mode)

1 gforget 1.1
2     #include "CPP_OPTIONS.h"
3    
4     C !ROUTINE: CTRL_BOUND_3D
5     C !INTERFACE:
6     SUBROUTINE CTRL_BOUND_3D(
7     I bi, bj, fieldCur,
8     I minCur,maxCur,
9     I myThid)
10     C !DESCRIPTION: \bv
11     C *==========================================================*
12     C | o bound ctrl vector values in forward mode
13     C | author: Gael Forget
14     C *==========================================================*
15    
16     #include "SIZE.h"
17     #include "EEPARAMS.h"
18     #include "PARAMS.h"
19    
20     C == Routine arguments ==
21     C myThid - Thread number for this instance of the routine.
22     integer myThid,bi,bj,i,j,k
23     _RL fieldCur(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
24     _RL minCur,maxCur
25    
26    
27     do k = 1,nr
28     do j = 1-oly,sny+oly
29     do i = 1-olx,snx+olx
30     IF (fieldCur(i,j,k).gt.maxCur) then
31     fieldCur(i,j,k)=maxCur
32     ENDIF
33     IF (fieldCur(i,j,k).lt.minCur) then
34     fieldCur(i,j,k)=minCur
35     ENDIF
36     enddo
37     enddo
38     enddo
39    
40    
41     end
42    
43     C !ROUTINE: CTRL_BOUND_2D
44     C !INTERFACE:
45     SUBROUTINE CTRL_BOUND_2D(
46     I bi, bj, fieldCur,
47     I minCur,maxCur,
48     I myThid)
49     C !DESCRIPTION: \bv
50     C *==========================================================*
51     C | o bound ctrl vector values in forward mode
52     C | author: Gael Forget
53     C *==========================================================*
54    
55     #include "SIZE.h"
56     #include "EEPARAMS.h"
57     #include "PARAMS.h"
58    
59     C == Routine arguments ==
60     C myThid - Thread number for this instance of the routine.
61     integer myThid,bi,bj,i,j,k
62     _RL fieldCur(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
63     _RL minCur,maxCur
64    
65    
66     do j = 1-oly,sny+oly
67     do i = 1-olx,snx+olx
68     IF (fieldCur(i,j).gt.maxCur) then
69     fieldCur(i,j)=maxCur
70     ENDIF
71     IF (fieldCur(i,j).lt.minCur) then
72     fieldCur(i,j)=minCur
73     ENDIF
74     enddo
75     enddo
76    
77    
78     end
79    

  ViewVC Help
Powered by ViewVC 1.1.22