/[MITgcm]/MITgcm/pkg/autodiff/addamp_adj.F
ViewVC logotype

Contents of /MITgcm/pkg/autodiff/addamp_adj.F

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


Revision 1.1 - (show annotations) (download)
Sat Apr 17 20:47:24 2010 UTC (14 years ago) by gforget
Branch: MAIN
CVS Tags: checkpoint63p, checkpoint63q, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint63, checkpoint62g, checkpoint62f, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
like zero_adj, but less agressively, the damp_adj code
allows for attenuation of a specific adjoint variable.
This sort of code can be useful to accomodate instable parts
of the ajoint (e.g. from gmredi, kpp, or seaice).

1 C $Header: /u/gcmpack/MITgcm/pkg/autodiff/addamp_adj.F,v 1.1 2010/04/17 00:00:00 gforget Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 C !ROUTINE: ADDAMP_ADJ
7 C !INTERFACE:
8 SUBROUTINE ADDAMP_ADJ(
9 I NrIn,minRef,maxRef,timeDamp,
10 I fieldRef,adfieldDamp,myThid)
11 C !DESCRIPTION: \bv
12 C *==========================================================*
13 C | author: Gael Forget
14 C *==========================================================*
15
16 IMPLICIT NONE
17
18 C == Global arguments ==
19 #include "SIZE.h"
20 #include "EEPARAMS.h"
21 #include "PARAMS.h"
22 #include "GRID.h"
23
24 C == Routine arguments ==
25 C myThid - Thread number for this instance of the routine.
26 integer NrIn, myThid
27 _RL fieldRef(1-Olx:sNx+Olx,1-Oly:sNy+Oly,NrIn,nSx,nSy)
28 _RL adfieldDamp(1-Olx:sNx+Olx,1-Oly:sNy+Oly,NrIn,nSx,nSy)
29 _RL minRef,maxRef,timeDamp,facDamp
30 integer bi,bj,i,j,k
31
32 DO bj=myByLo(myThid),myByHi(myThid)
33 DO bi=myBxLo(myThid),myBxHi(myThid)
34 DO k=1,NrIn
35 DO j=1-Oly,sNy+Oly
36 DO i=1-Olx,sNx+Olx
37 if ( (fieldRef(i,j,k,bi,bj).GE.maxRef).OR.
38 & (fieldRef(i,j,k,bi,bj).LE.minRef) ) then
39 facDamp=(1. _d 0-deltaTClock/timeDamp)
40 else
41 facDamp=1. _d 0
42 endif
43 adfieldDamp(i,j,k,bi,bj)=facDamp*
44 & adfieldDamp(i,j,k,bi,bj)
45 ENDDO
46 ENDDO
47 ENDDO
48 ENDDO
49 ENDDO
50
51 end
52

  ViewVC Help
Powered by ViewVC 1.1.22