/[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.3 by mlosch, Tue Nov 6 13:10:14 2012 UTC revision 1.8 by mlosch, Tue May 23 16:24:46 2017 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 71  C     i,j,bi,bj :: loop indices Line 69  C     i,j,bi,bj :: loop indices
69        _RL epsilon, reps        _RL epsilon, reps
70  CEOP  CEOP
71  C     Instructions for using TAF or TAMC to generate exact Jacobian times  C     Instructions for using TAF or TAMC to generate exact Jacobian times
72  C     vector operations:  C     vector operations (if SEAICE_ALLOW_MOM_ADVECTION is defined, the
73    C     file list also needs to include seaice_mom_advection.f,
74    C     mom_calc_hfacz.f, mom_calc_ke.f, mom_calc_relvort3.f,
75    C     mom_vi_u_coriolis.f, mom_vi_u_coriolis_c4.f, mom_vi_u_grad_ke.f,
76    C     mom_vi_v_coriolis.f, mom_vi_v_coriolis_c4.f, mom_vi_v_grad_ke.f
77    C     plus flow information for diagnostics_fill.f:
78    CCCCCCCADJ SUBROUTINE DIAGNOSTICS_FILL INPUT  = 1,2,3,4,5,6,7,8
79    CCCCCCCADJ SUBROUTINE DIAGNOSTICS_FILL OUTPUT =
80    C     )
81  C  C
82  C     1. make small_f  C     1. make small_f
83  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  C     2. cat seaice_calc_residual.f seaice_oceandrag_coeffs.f \
84  C     3. staf -v1 -forward -toplevel seaice_calc_residual -input uIceLoc,viceLoc -output uIceRes,vIceRes taf_input.f  C        seaice_bottomdrag_coeffs.f seaice_calc_stressdiv.f \
85    C        seaice_calc_strainrates.f seaice_calc_viscosities.f \
86    C        seaice_calc_rhs.f seaice_calc_lhs.f > taf_input.f
87    C     3. staf -v1 -forward -toplevel seaice_calc_residual \
88    C             -input uIceLoc,viceLoc -output uIceRes,vIceRes taf_input.f
89  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
90  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
91    C
92    C     Instruction for using TAF 2.4 and higher (or staf with default -v2
93    C     starting with version 2.0):
94    C
95    C     1. make small_f
96    C     2. files="seaice_calc_residual.f seaice_oceandrag_coeffs.f \
97    C               seaice_bottomdrag_coeffs.f seaice_calc_stressdiv.f \
98    C               seaice_calc_strainrates.f seaice_calc_viscosities.f \
99    C               seaice_calc_rhs.f seaice_calc_lhs.f"
100    C     3. staf -forward -toplevel seaice_calc_residual \
101    C             -input uIceLoc,viceLoc -output uIceRes,vIceRes $files
102    C     4. copy files seaice_*_tl.f to the corresponding seaice_*.f files,
103    C        e.g. with this bash script:
104    C     for file in $files; do
105    C       nfile=`echo $file | awk -F. '{printf "%s_tl.f", $1}'`;
106    C       \cp -f $nfile $file
107    C     done
108    C     5. add the following code, change "call g_seaice_calc_residual"
109    C        to "call seaice_calc_residual_tl", and comment out the finite
110    C        difference code
111  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)
112  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)
113  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)
# Line 102  CML Line 132  CML
132  CML      CALL G_SEAICE_CALC_RESIDUAL( uIce, g_duice, vIce,  CML      CALL G_SEAICE_CALC_RESIDUAL( uIce, g_duice, vIce,
133  CML     $g_dvice, uiceresp, g_uiceres, viceresp, g_viceres, newtoniter,  CML     $g_dvice, uiceresp, g_uiceres, viceresp, g_viceres, newtoniter,
134  CML     $kryloviter, mytime, myiter, mythid )  CML     $kryloviter, mytime, myiter, mythid )
135    CMLCML      For staf -v2 replace the above with the below call
136    CMLCML      CALL SEAICE_CALC_RESIDUAL_TL( uIce, g_duice, vIce,
137    CMLCML     $g_dvice, uiceresp, g_uiceres, viceresp, g_viceres, newtoniter,
138    CMLCML     $kryloviter, mytime, myiter, mythid )
139  CML  CML
140  CML      DO bj=myByLo(myThid),myByHi(myThid)  CML      DO bj=myByLo(myThid),myByHi(myThid)
141  CML       DO bi=myBxLo(myThid),myBxHi(myThid)  CML       DO bi=myBxLo(myThid),myBxHi(myThid)
# Line 115  CML       ENDDO Line 149  CML       ENDDO
149  CML      ENDDO  CML      ENDDO
150    
151  C     Initialise  C     Initialise
152        epsilon = 1. _d -06        epsilon = SEAICE_JFNKepsilon
153        reps    = 1. _d 0/epsilon        reps    = 1. _d 0/epsilon
154    
155        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
# Line 150  C     and store in du/vIce Line 184  C     and store in du/vIce
184         ENDDO         ENDDO
185        ENDDO        ENDDO
186    
187  #endif /* SEAICE_ALLOW_DYNAMICS and SEAICE_CGRID and SEAICE_ALLOW_JFNK */  #endif /* SEAICE_ALLOW_JFNK */
188    
189        RETURN        RETURN
190        END        END

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.22