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

Diff of /MITgcm/pkg/seaice/seaice_jacvec.F

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

revision 1.1 by mlosch, Tue Oct 16 07:00:21 2012 UTC revision 1.4 by mlosch, Thu Feb 28 17:12:48 2013 UTC
# Line 70  C     i,j,bi,bj :: loop indices Line 70  C     i,j,bi,bj :: loop indices
70        INTEGER i,j,bi,bj        INTEGER i,j,bi,bj
71        _RL epsilon, reps        _RL epsilon, reps
72  CEOP  CEOP
73    C     Instructions for using TAF or TAMC to generate exact Jacobian times
74    C     vector operations:
75    C
76    C     1. make small_f
77    C     2. cat seaice_calc_residual.f seaice_oceandrag_coeffs.f seaice_calc_strainrates.f seaice_calc_viscosities.f seaice_calc_rhs.f seaice_calc_lhs.f > taf_input.f
78    C     3. staf -v1 -forward -toplevel seaice_calc_residual -input uIceLoc,viceLoc -output uIceRes,vIceRes taf_input.f
79    C     4. insert content of taf_input_ftl.f at the end of this file
80    C     5. add the following code and comment out the finite difference code
81    C
82    C     Instruction for using TAF 2.4 and higher (or staf with default -v2
83    C     starting with version 2.0):
84    C
85    C     1. make small_f
86    C     2. staf -forward -toplevel seaice_calc_residual -input uIceLoc,viceLoc -output uIceRes,vIceRes seaice_calc_residual.f seaice_oceandrag_coeffs.f seaice_calc_strainrates.f seaice_calc_viscosities.f seaice_calc_rhs.f seaice_calc_lhs.f
87    C     3. copy files seaice_*_tl.f to the corresponding seaice_*.f files,
88    C        e.g. with this bash script:
89    C     for file in `ls seaice_*_tl.f`; do
90    C       nfile=`echo $file | awk -F_ '{printf "%s_%s_%s.f", $1,$2,$3}'`;
91    C       \cp -f $file $nfile
92    C     done
93    C     4. add the following code, change "call g_seaice_calc_residual" to "call seaice_calc_residual_tl", and comment out the finite difference code
94    CML      _RL g_duIce(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
95    CML      _RL g_dvIce(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
96    CML      _RL g_uIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
97    CML      _RL g_vIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
98    CML
99    CMLC     Initialise
100    CML      DO bj=myByLo(myThid),myByHi(myThid)
101    CML       DO bi=myBxLo(myThid),myBxHi(myThid)
102    CML        DO J=1-Oly,sNy+Oly
103    CML         DO I=1-Olx,sNx+Olx
104    CML          g_duIce(I,J,bi,bj) = duice(I,J,bi,bj)
105    CML          g_dvIce(I,J,bi,bj) = dvice(I,J,bi,bj)
106    CML          g_uIceRes(I,J,bi,bj) = 0. _d 0
107    CML          g_vIceRes(I,J,bi,bj) = 0. _d 0
108    CML          uIceResP(I,J,bi,bj) = 0. _d 0
109    CML          vIceResP(I,J,bi,bj) = 0. _d 0
110    CML         ENDDO
111    CML        ENDDO
112    CML       ENDDO
113    CML      ENDDO
114    CML
115    CML      CALL G_SEAICE_CALC_RESIDUAL( uIce, g_duice, vIce,
116    CML     $g_dvice, uiceresp, g_uiceres, viceresp, g_viceres, newtoniter,
117    CML     $kryloviter, mytime, myiter, mythid )
118    CMLCML      For staf -v2 replace the above with the below call
119    CMLCML      CALL SEAICE_CALC_RESIDUAL_TL( uIce, g_duice, vIce,
120    CMLCML     $g_dvice, uiceresp, g_uiceres, viceresp, g_viceres, newtoniter,
121    CMLCML     $kryloviter, mytime, myiter, mythid )
122    CML
123    CML      DO bj=myByLo(myThid),myByHi(myThid)
124    CML       DO bi=myBxLo(myThid),myBxHi(myThid)
125    CML        DO J=1-Oly,sNy+Oly
126    CML         DO I=1-Olx,sNx+Olx
127    CML          duice(I,J,bi,bj)=g_uiceres(I,J,bi,bj)
128    CML          dvice(I,J,bi,bj)=g_viceres(I,J,bi,bj)
129    CML         ENDDO
130    CML        ENDDO
131    CML       ENDDO
132    CML      ENDDO
133    
134  C     Initialise  C     Initialise
135        epsilon = 1. _d -06        epsilon = SEAICE_JFNKepsilon
136        reps    = 1. _d 0/epsilon        reps    = 1. _d 0/epsilon
137    
138        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22