/[MITgcm]/MITgcm/model/src/update_masks_etc.F
ViewVC logotype

Diff of /MITgcm/model/src/update_masks_etc.F

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

revision 1.4 by jmc, Tue Mar 16 00:08:27 2010 UTC revision 1.5 by jmc, Sun May 9 22:40:03 2010 UTC
# Line 13  C     | SUBROUTINE UPDATE_MASKS_ETC Line 13  C     | SUBROUTINE UPDATE_MASKS_ETC
13  C     | o Re-initialise masks and topography factors after a new  C     | o Re-initialise masks and topography factors after a new
14  C     |   hFacC has been calculated by the minimizer  C     |   hFacC has been calculated by the minimizer
15  C     *==========================================================*  C     *==========================================================*
16  C     | These arrays are used throughout the code and describe      C     | These arrays are used throughout the code and describe
17  C     | the topography of the domain through masks (0s and 1s)      C     | the topography of the domain through masks (0s and 1s)
18  C     | and fractional height factors (0<hFac<1). The latter        C     | and fractional height factors (0<hFac<1). The latter
19  C     | distinguish between the lopped-cell and full-step          C     | distinguish between the lopped-cell and full-step
20  C     | topographic representations.                                C     | topographic representations.
21  C     *==========================================================*  C     *==========================================================*
22  C     | code taken from ini_masks_etc.F  C     | code taken from ini_masks_etc.F
23  C     *==========================================================*  C     *==========================================================*
# Line 34  C     === Global variables === Line 34  C     === Global variables ===
34  Cml we need optimcycle for storing the new hFaC(C/W/S) and depth  Cml we need optimcycle for storing the new hFaC(C/W/S) and depth
35  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
36  # include "optim.h"  # include "optim.h"
37  #endif  #endif
38    
39  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
40  C     == Routine arguments ==  C     == Routine arguments ==
# Line 157  CmlC     - end bi,bj loops. Line 157  CmlC     - end bi,bj loops.
157  Cml       ENDDO  Cml       ENDDO
158  Cml      ENDDO  Cml      ENDDO
159    
160  C     CALL PLOT_FIELD_XYRS( tmpfld,        IF ( debugLevel.GE.debLevB ) THEN
161  C    &         'Model Depths K Index' , 1, myThid )          _BARRIER
162  CML I assume that R_low is not changed anywhere else in the code          CALL PLOT_FIELD_XYRS( R_low,
163  CML and since it is not changed in this routine, we do not need to       &         'Model R_low (update_masks_etc)', 1, myThid )
164    CML I assume that Ro_surf is not changed anywhere else in the code
165    CML and since it is not changed in this routine, we do not need to
166  CML print it again.  CML print it again.
167  CML      CALL PLOT_FIELD_XYRS(R_low,  CML     CALL PLOT_FIELD_XYRS( Ro_surf,
168  CML     &         'Model R_low (ini_masks_etc)', 1, myThid)  CML  &         'Model Ro_surf (update_masks_etc)', 1, myThid )
169        CALL PLOT_FIELD_XYRS(Ro_surf,        ENDIF
      &         'Model Ro_surf (update_masks_etc)', 1, myThid)  
170    
171  C     Calculate quantities derived from XY depth map  C     Calculate quantities derived from XY depth map
172        DO bj = myByLo(myThid), myByHi(myThid)        DO bj = myByLo(myThid), myByHi(myThid)
# Line 192  CML   function MIN is involved which doe Line 193  CML   function MIN is involved which doe
193  CML   for MIN(x,y) at y=x.  CML   for MIN(x,y) at y=x.
194  CML   The thin walls representation has been moved into this loop, that is  CML   The thin walls representation has been moved into this loop, that is
195  CML   before the call to EXCH_UV_XVY_RS, because TAMC will prefer it this  CML   before the call to EXCH_UV_XVY_RS, because TAMC will prefer it this
196  CML   way. On the other hand, this might cause difficulties in some  CML   way. On the other hand, this might cause difficulties in some
197  CML   configurations.  CML   configurations.
198        DO bj=myByLo(myThid), myByHi(myThid)        DO bj=myByLo(myThid), myByHi(myThid)
199         DO bi=myBxLo(myThid), myBxHi(myThid)         DO bi=myBxLo(myThid), myBxHi(myThid)
# Line 238  Cml              hFacS(I,J,K,bi,bj)= Line 239  Cml              hFacS(I,J,K,bi,bj)=
239  #if (defined (ALLOW_AUTODIFF_TAMC) && \  #if (defined (ALLOW_AUTODIFF_TAMC) && \
240       defined (ALLOW_AUTODIFF_MONITOR) && \       defined (ALLOW_AUTODIFF_MONITOR) && \
241       defined (ALLOW_DEPTH_CONTROL))       defined (ALLOW_DEPTH_CONTROL))
242  C     Include call to a dummy routine. Its adjoint will be  C     Include call to a dummy routine. Its adjoint will be
243  C     called at the proper place in the adjoint code.  C     called at the proper place in the adjoint code.
244  C     The adjoint routine will print out adjoint values  C     The adjoint routine will print out adjoint values
245  C     if requested. The location of the call is important,  C     if requested. The location of the call is important,
246  C     it has to be after the adjoint of the exchanges  C     it has to be after the adjoint of the exchanges
247  C     (DO_GTERM_BLOCKING_EXCHANGES).  C     (DO_GTERM_BLOCKING_EXCHANGES).
248  Cml      CALL DUMMY_IN_HFAC( 'W', 0, myThid )  Cml      CALL DUMMY_IN_HFAC( 'W', 0, myThid )
249  Cml      CALL DUMMY_IN_HFAC( 'S', 0, myThid )  Cml      CALL DUMMY_IN_HFAC( 'S', 0, myThid )
# Line 252  Cml      CALL EXCH_UV_XYZ_RL(hFacW,hFacS Line 253  Cml      CALL EXCH_UV_XYZ_RL(hFacW,hFacS
253  #if (defined (ALLOW_AUTODIFF_TAMC) && \  #if (defined (ALLOW_AUTODIFF_TAMC) && \
254       defined (ALLOW_AUTODIFF_MONITOR) && \       defined (ALLOW_AUTODIFF_MONITOR) && \
255       defined (ALLOW_DEPTH_CONTROL))       defined (ALLOW_DEPTH_CONTROL))
256  C     Include call to a dummy routine. Its adjoint will be  C     Include call to a dummy routine. Its adjoint will be
257  C     called at the proper place in the adjoint code.  C     called at the proper place in the adjoint code.
258  C     The adjoint routine will print out adjoint values  C     The adjoint routine will print out adjoint values
259  C     if requested. The location of the call is important,  C     if requested. The location of the call is important,
260  C     it has to be after the adjoint of the exchanges  C     it has to be after the adjoint of the exchanges
261  C     (DO_GTERM_BLOCKING_EXCHANGES).  C     (DO_GTERM_BLOCKING_EXCHANGES).
262  Cml      CALL DUMMY_IN_HFAC( 'W', 1, myThid )  Cml      CALL DUMMY_IN_HFAC( 'W', 1, myThid )
263  Cml      CALL DUMMY_IN_HFAC( 'S', 1, myThid )  Cml      CALL DUMMY_IN_HFAC( 'S', 1, myThid )
264  #endif  #endif
265    
266  C-    Write to disk: Total Column Thickness & hFac(C,W,S):  C-    Write to disk: Total Column Thickness & hFac(C,W,S):
       _BARRIER  
       _BEGIN_MASTER( myThid )  
267        WRITE(suff,'(I10.10)') optimcycle        WRITE(suff,'(I10.10)') optimcycle
268        CALL WRITE_FLD_XY_RS( 'Depth.',suff,tmpfld,optimcycle,myThid)        CALL WRITE_FLD_XY_RS( 'Depth.',suff,tmpfld,optimcycle,myThid)
269        CALL WRITE_FLD_XYZ_RS( 'hFacC.',suff,hFacC,optimcycle,myThid)        CALL WRITE_FLD_XYZ_RS( 'hFacC.',suff,hFacC,optimcycle,myThid)
270        CALL WRITE_FLD_XYZ_RS( 'hFacW.',suff,hFacW,optimcycle,myThid)        CALL WRITE_FLD_XYZ_RS( 'hFacW.',suff,hFacW,optimcycle,myThid)
271        CALL WRITE_FLD_XYZ_RS( 'hFacS.',suff,hFacS,optimcycle,myThid)        CALL WRITE_FLD_XYZ_RS( 'hFacS.',suff,hFacS,optimcycle,myThid)
       _END_MASTER(myThid)  
272    
273          IF ( debugLevel.GE.debLevB ) THEN
274            _BARRIER
275  C--   Write to monitor file (standard output)  C--   Write to monitor file (standard output)
276        CALL PLOT_FIELD_XYZRS( hFacC, 'hFacC' , Nr, 1, myThid )          CALL PLOT_FIELD_XYZRS( hFacC,'hFacC (update_masks_etc)',
277        CALL PLOT_FIELD_XYZRS( hFacW, 'hFacW' , Nr, 1, myThid )       &                                          Nr, 1, myThid )
278        CALL PLOT_FIELD_XYZRS( hFacS, 'hFacS' , Nr, 1, myThid )          CALL PLOT_FIELD_XYZRS( hFacW,'hFacW (update_masks_etc)',
279         &                                          Nr, 1, myThid )
280            CALL PLOT_FIELD_XYZRS( hFacS,'hFacS (update_masks_etc)',
281         &                                          Nr, 1, myThid )
282          ENDIF
283    
284  C     Masks and reciprocals of hFac[CWS]  C     Masks and reciprocals of hFac[CWS]
285  Cml   The masks should stay constant, so they are not recomputed at this time  Cml   The masks should stay constant, so they are not recomputed at this time
286  Cml   implicitly implying that no cell that is wet in the begin will ever dry  Cml   implicitly implying that no cell that is wet in the begin will ever dry
287  Cml   up! This is a strong constraint and should be implementent as a hard  Cml   up! This is a strong constraint and should be implementent as a hard
288  Cml   inequality contraint when performing optimization (m1qn3 cannot do that)  Cml   inequality contraint when performing optimization (m1qn3 cannot do that)
289  Cml   Also, I am assuming here that the new hFac(s) never become zero during  Cml   Also, I am assuming here that the new hFac(s) never become zero during
290  Cml   optimization!  Cml   optimization!
# Line 342  Cml           IF (hFacS(I,J,K,bi,bj).NE. Line 346  Cml           IF (hFacS(I,J,K,bi,bj).NE.
346             IF (maskS(I,J,K,bi,bj).NE.0.) THEN             IF (maskS(I,J,K,bi,bj).NE.0.) THEN
347                ksurfS(I,J,bi,bj) = k                ksurfS(I,J,bi,bj) = k
348    
349             ENDIF                     ENDIF
350            ENDDO            ENDDO
351           ENDDO           ENDDO
352          ENDDO          ENDDO
# Line 427  c Line 431  c
431        end if        end if
432    
433        return        return
434        end        end
435    
436        _RL function smoothAbs_R8( x )        _RL function smoothAbs_R8( x )
437    
# Line 464  c Line 468  c
468        end if        end if
469    
470        return        return
471        end        end
472  #endif /* USE_SMOOTH_MIN */  #endif /* USE_SMOOTH_MIN */
473    
474  Cml#ifdef ALLOW_DEPTH_CONTROL  Cml#ifdef ALLOW_DEPTH_CONTROL
# Line 495  Cml      end Line 499  Cml      end
499    
500  #ifdef ALLOW_DEPTH_CONTROL  #ifdef ALLOW_DEPTH_CONTROL
501  cadj SUBROUTINE dummy_in_hfac INPUT   = 1, 2, 3  cadj SUBROUTINE dummy_in_hfac INPUT   = 1, 2, 3
502  cadj SUBROUTINE dummy_in_hfac OUTPUT  =  cadj SUBROUTINE dummy_in_hfac OUTPUT  =
503  cadj SUBROUTINE dummy_in_hfac ACTIVE  =  cadj SUBROUTINE dummy_in_hfac ACTIVE  =
504  cadj SUBROUTINE dummy_in_hfac DEPEND  = 1, 2, 3  cadj SUBROUTINE dummy_in_hfac DEPEND  = 1, 2, 3
505  cadj SUBROUTINE dummy_in_hfac REQUIRED  cadj SUBROUTINE dummy_in_hfac REQUIRED
506  cadj SUBROUTINE dummy_in_hfac INFLUENCED  cadj SUBROUTINE dummy_in_hfac INFLUENCED

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

  ViewVC Help
Powered by ViewVC 1.1.22