/[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.2 by mlosch, Tue Nov 6 13:09:30 2012 UTC revision 1.5 by mlosch, Thu Apr 4 07:02:51 2013 UTC
# Line 56  C     du/vIce   :: correction of ice vel Line 56  C     du/vIce   :: correction of ice vel
56        _RL duIce  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL duIce  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
57        _RL dvIce  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL dvIce  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
58    
59  #if ( defined (SEAICE_CGRID) && \  #ifdef SEAICE_ALLOW_JFNK
       defined (SEAICE_ALLOW_JFNK) && \  
       defined (SEAICE_ALLOW_DYNAMICS) )  
60  C     Local variables:  C     Local variables:
61        _RL utp     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL utp     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
62        _RL vtp     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL vtp     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
# Line 78  C     2. cat seaice_calc_residual.f seai Line 76  C     2. cat seaice_calc_residual.f seai
76  C     3. staf -v1 -forward -toplevel seaice_calc_residual -input uIceLoc,viceLoc -output uIceRes,vIceRes taf_input.f  C     3. staf -v1 -forward -toplevel seaice_calc_residual -input uIceLoc,viceLoc -output uIceRes,vIceRes taf_input.f
77  C     4. insert content of taf_input_ftl.f at the end of this file  C     4. insert content of taf_input_ftl.f at the end of this file
78  C     5. add the following code and comment out the finite difference code  C     5. add the following code and comment out the finite difference code
79    C
80    C     Instruction for using TAF 2.4 and higher (or staf with default -v2
81    C     starting with version 2.0):
82    C
83    C     1. make small_f
84    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
85    C     3. copy files seaice_*_tl.f to the corresponding seaice_*.f files,
86    C        e.g. with this bash script:
87    C     for file in `ls seaice_*_tl.f`; do
88    C       nfile=`echo $file | awk -F_ '{printf "%s_%s_%s.f", $1,$2,$3}'`;
89    C       \cp -f $file $nfile
90    C     done
91    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
92  CML      _RL g_duIce(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)  CML      _RL g_duIce(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
93  CML      _RL g_dvIce(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)  CML      _RL g_dvIce(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
94  CML      _RL g_uIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)  CML      _RL g_uIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
95  CML      _RL g_vIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)  CML      _RL g_vIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
96  CML  CML
 CML      IF (.false.) then  
97  CMLC     Initialise  CMLC     Initialise
98  CML      DO bj=myByLo(myThid),myByHi(myThid)  CML      DO bj=myByLo(myThid),myByHi(myThid)
99  CML       DO bi=myBxLo(myThid),myBxHi(myThid)  CML       DO bi=myBxLo(myThid),myBxHi(myThid)
# Line 103  CML Line 113  CML
113  CML      CALL G_SEAICE_CALC_RESIDUAL( uIce, g_duice, vIce,  CML      CALL G_SEAICE_CALC_RESIDUAL( uIce, g_duice, vIce,
114  CML     $g_dvice, uiceresp, g_uiceres, viceresp, g_viceres, newtoniter,  CML     $g_dvice, uiceresp, g_uiceres, viceresp, g_viceres, newtoniter,
115  CML     $kryloviter, mytime, myiter, mythid )  CML     $kryloviter, mytime, myiter, mythid )
116    CMLCML      For staf -v2 replace the above with the below call
117    CMLCML      CALL SEAICE_CALC_RESIDUAL_TL( uIce, g_duice, vIce,
118    CMLCML     $g_dvice, uiceresp, g_uiceres, viceresp, g_viceres, newtoniter,
119    CMLCML     $kryloviter, mytime, myiter, mythid )
120  CML  CML
121  CML      DO bj=myByLo(myThid),myByHi(myThid)  CML      DO bj=myByLo(myThid),myByHi(myThid)
122  CML       DO bi=myBxLo(myThid),myBxHi(myThid)  CML       DO bi=myBxLo(myThid),myBxHi(myThid)
# Line 116  CML       ENDDO Line 130  CML       ENDDO
130  CML      ENDDO  CML      ENDDO
131    
132  C     Initialise  C     Initialise
133        epsilon = 1. _d -06        epsilon = SEAICE_JFNKepsilon
134        reps    = 1. _d 0/epsilon        reps    = 1. _d 0/epsilon
135    
136        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
# Line 151  C     and store in du/vIce Line 165  C     and store in du/vIce
165         ENDDO         ENDDO
166        ENDDO        ENDDO
167    
168  #endif /* SEAICE_ALLOW_DYNAMICS and SEAICE_CGRID and SEAICE_ALLOW_JFNK */  #endif /* SEAICE_ALLOW_JFNK */
169    
170        RETURN        RETURN
171        END        END

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22