/[MITgcm]/MITgcm_contrib/dgoldberg/streamice/streamice_init_varia.F
ViewVC logotype

Diff of /MITgcm_contrib/dgoldberg/streamice/streamice_init_varia.F

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

revision 1.4 by dgoldberg, Tue Sep 18 17:06:48 2012 UTC revision 1.16 by dgoldberg, Wed Jun 12 20:48:08 2013 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    #ifdef ALLOW_COST
4    # include "COST_OPTIONS.h"
5    #endif
6  #include "STREAMICE_OPTIONS.h"  #include "STREAMICE_OPTIONS.h"
7    
8  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
# Line 37  C     I,J,bi,bj - Loop counters Line 39  C     I,J,bi,bj - Loop counters
39        INTEGER col_y, col_x        INTEGER col_y, col_x
40        _RL slope_pos, c1, x, y, lenx, leny        _RL slope_pos, c1, x, y, lenx, leny
41        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
42          _RS     dummyRS
43    
44  CEOP  CEOP
45    
46  C     ZERO OUT FLOATING POINT ARRAYS  C     ZERO OUT FLOATING POINT ARRAYS
47    
48    
49        DO bj = myByLo(myThid), myByHi(myThid)        DO bj = myByLo(myThid), myByHi(myThid)
50         DO bi = myBxLo(myThid), myBxHi(myThid)         DO bi = myBxLo(myThid), myBxHi(myThid)
51          DO j=1-Oly,sNy+Oly          DO j=1-Oly,sNy+Oly
# Line 56  C     ZERO OUT FLOATING POINT ARRAYS Line 61  C     ZERO OUT FLOATING POINT ARRAYS
61            area_shelf_streamice(i,j,bi,bj) = 0. _d 0            area_shelf_streamice(i,j,bi,bj) = 0. _d 0
62            mass_ice_streamice(i,j,bi,bj) = 0. _d 0            mass_ice_streamice(i,j,bi,bj) = 0. _d 0
63            BDOT_streamice(i,j,bi,bj) = 0. _d 0            BDOT_streamice(i,j,bi,bj) = 0. _d 0
64  !           C_basal_friction(i,j,bi,bj) = C_basal_fric_const            ADOT_streamice(i,j,bi,bj) = streamice_adot_uniform
65            A_glen(i,j,bi,bj) = A_glen_isothermal            C_basal_friction(i,j,bi,bj) = C_basal_fric_const
66              B_glen(i,j,bi,bj) = B_glen_isothermal
67              H_streamice_prev(i,j,bi,bj) = 0. _d 0
68    #ifdef ALLOW_STREAMICE_2DTRACER
69    #ifdef STREAMICE_TRACER_AB
70             GAD_trac_2d (i,j,bi,bj) = 0. _d 0
71    !         GAD_trac_2dNm1 (i,j,bi,bj) = 0. _d 0
72    #endif
73    #endif
74  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
75            ru_old_si(i,j,bi,bj) = 0. _d 0            ru_old_si(i,j,bi,bj) = 0. _d 0
76            rv_old_si(i,j,bi,bj) = 0. _d 0            rv_old_si(i,j,bi,bj) = 0. _d 0
77            zu_old_si(i,j,bi,bj) = 0. _d 0            zu_old_si(i,j,bi,bj) = 0. _d 0
78            zv_old_si(i,j,bi,bj) = 0. _d 0            zv_old_si(i,j,bi,bj) = 0. _d 0
79            h_after_uflux_SI(i,j,bi,bj) = 0. _d 0  !          h_after_uflux_SI(i,j,bi,bj) = 0. _d 0
80    #endif
81    #ifdef USE_ALT_RLOW
82              R_low_si(i,j,bi,bj) = 0. _d 0
83  #endif  #endif
84    
85  #ifdef STREAMICE_HYBRID_STRESS  #ifdef STREAMICE_HYBRID_STRESS
86            do k=1,Nr            do k=1,Nr
87             visc_streamice_full(i,j,k,bi,bj) =             visc_streamice_full(i,j,k,bi,bj) =
88       &     eps_glen_min**((1-n_glen)/n_glen)       &     eps_glen_min**((1-n_glen)/n_glen)
89            enddo                  enddo      
90              streamice_taubx (i,j,bi,bj) = 0. _d 0
91              streamice_tauby (i,j,bi,bj) = 0. _d 0
92  #endif  #endif
93           ENDDO           ENDDO
94          ENDDO          ENDDO
95    
96    #ifdef ALLOW_COST_TEST
97            cost_func1_streamice (bi,bj) = 0.0
98    #endif
99    
100         ENDDO         ENDDO
101        ENDDO        ENDDO
102    
# Line 112  C     INIT. INTEGER ARRAYS Line 136  C     INIT. INTEGER ARRAYS
136         ENDDO         ENDDO
137        ENDDO        ENDDO
138    
139    
140    #ifdef USE_ALT_RLOW
141    ! init alternate array for topog
142          IF ( STREAMICEtopogFile .NE. ' ' ) THEN
143            _BARRIER
144    C The 0 is the "iteration" argument. The ' ' is an empty suffix
145           CALL READ_FLD_XY_RS( STREAMICEtopogFile, '',
146         &      R_low_si, 0, myThid )
147          
148          ELSE
149            WRITE(msgBuf,'(A)') 'STREAMICE TOPOG - FILENAME MISSING'
150            CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
151         &                    SQUEEZE_RIGHT , 1)
152          ENDIF
153    #endif
154    
155  ! initialize thickness  ! initialize thickness
156    
157    #ifndef STREAMICE_GEOM_FILE_SETUP
158            
159        IF ( STREAMICEthickInit.EQ.'PARAM' ) THEN        IF ( STREAMICEthickInit.EQ.'PARAM' ) THEN
160    
# Line 154  C             IF (flow_dir .EQ. 2.0) THE Line 196  C             IF (flow_dir .EQ. 2.0) THE
196                 area_shelf_streamice(i,j,bi,bj) = rA(i,j,bi,bj) *                 area_shelf_streamice(i,j,bi,bj) = rA(i,j,bi,bj) *
197       &          (shelf_edge_pos-xG(i,j,bi,bj)) /       &          (shelf_edge_pos-xG(i,j,bi,bj)) /
198       &          (xG(i+1,j,bi,bj)-xG(i,j,bi,bj))       &          (xG(i+1,j,bi,bj)-xG(i,j,bi,bj))
199                 IF (area_shelf_streamice(i,j,bi,bj).gt. 0._d 0) THEN                 IF (area_shelf_streamice(i,j,bi,bj).gt. 0. _d 0) THEN
200                  STREAMICE_hmask(i,j,bi,bj) = 2.0                  STREAMICE_hmask(i,j,bi,bj) = 2.0
201                 ELSE                 ELSE
202                  STREAMICE_hmask(i,j,bi,bj) = 0.0                  STREAMICE_hmask(i,j,bi,bj) = 0.0
# Line 179  C             IF (flow_dir .EQ. 2.0) THE Line 221  C             IF (flow_dir .EQ. 2.0) THE
221         IF ( STREAMICEthickFile .NE. ' ' ) THEN         IF ( STREAMICEthickFile .NE. ' ' ) THEN
222          _BARRIER          _BARRIER
223  C The 0 is the "iteration" argument. The ' ' is an empty suffix  C The 0 is the "iteration" argument. The ' ' is an empty suffix
224          CALL READ_FLD_XY_RS( STREAMICEthickFile, ' ', H_streamice,          CALL READ_FLD_XY_RL( STREAMICEthickFile, ' ', H_streamice,
225       &      0, myThid )       &      0, myThid )
226          DO bj = myByLo(myThid), myByHi(myThid)          DO bj = myByLo(myThid), myByHi(myThid)
227           DO bi = myBxLo(myThid), myBxHi(myThid)           DO bi = myBxLo(myThid), myBxHi(myThid)
# Line 196  C The 0 is the "iteration" argument. The Line 238  C The 0 is the "iteration" argument. The
238                area_shelf_streamice(i,j,bi,bj) = 0. _d 0                area_shelf_streamice(i,j,bi,bj) = 0. _d 0
239                STREAMICE_hmask(i,j,bi,bj) = 0. _d 0                STREAMICE_hmask(i,j,bi,bj) = 0. _d 0
240               ENDIF               ENDIF
241                 Do k=1,Nr
242                 STREAMICE_ctrl_mask(i,j,k,bi,bj) = 1. _d 0
243                 enddo
244              ENDIF              ENDIF
245             ENDDO             ENDDO
246            ENDDO            ENDDO
# Line 214  C The 0 is the "iteration" argument. The Line 259  C The 0 is the "iteration" argument. The
259       &                    SQUEEZE_RIGHT , 1)       &                    SQUEEZE_RIGHT , 1)
260        ENDIF        ENDIF
261    
262    #else
263    ! STREAMICE_GEOM_FILE_SETUP - init thickness and hmask MUST come from file
264    
265          IF ( STREAMICEthickFile .NE. ' ' ) THEN
266            _BARRIER
267    C The 0 is the "iteration" argument. The ' ' is an empty suffix
268          CALL READ_FLD_XY_RL( STREAMICEthickFile, ' ', H_streamice,
269         &      0, myThid )
270          ELSE
271           WRITE(msgBuf,'(A)') 'INIT THICKNESS - FILENAME MISSING'
272           CALL PRINT_ERROR( msgBuf, myThid)
273          ENDIF
274    
275          IF ( STREAMICEhMaskFile .NE. ' ' ) THEN
276            _BARRIER
277    C The 0 is the "iteration" argument. The ' ' is an empty suffix
278          CALL READ_FLD_XY_RS( STREAMICEhMaskFile, ' ', STREAMICE_hmask,
279         &      0, myThid )
280          ELSE
281           WRITE(msgBuf,'(A)') 'INIT HMASK - FILENAME MISSING'
282           CALL PRINT_ERROR( msgBuf, myThid)
283          ENDIF
284    
285    #endif
286    ! STREAMICE_GEOM_FILE_SETUP
287    
288    
289  ! finish initialize thickness  ! finish initialize thickness
290    
291    ! initialize glen constant
292    
293          IF ( STREAMICEGlenConstConfig.EQ.'FILE' ) THEN
294    
295           IF ( STREAMICEGlenConstFile .NE. ' ' ) THEN
296            _BARRIER
297    
298            CALL READ_FLD_XY_RL( STREAMICEGlenConstFile, ' ',
299         &      B_glen, 0, myThid )
300    
301           ELSE
302            WRITE(msgBuf,'(A)') 'INIT GLEN - FILENAME MISSING'
303            CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
304         &                    SQUEEZE_RIGHT , 1)
305           ENDIF
306          
307          ELSE IF (STREAMICEGlenConstConfig.EQ.'UNIFORM' ) THEN
308    
309            DO bj = myByLo(myThid), myByHi(myThid)
310             DO bi = myBxLo(myThid), myBxHi(myThid)
311              DO j=1,sNy
312               DO i=1,sNx
313                B_glen(i,j,bi,bj) = B_glen_isothermal
314               ENDDO
315              ENDDO
316             ENDDO
317            ENDDO
318    
319          ELSE
320    
321           WRITE(msgBuf,'(A)') 'INIT GLEN CONSTANT - NOT IMPLENTED'
322           CALL PRINT_ERROR( msgBuf, myThid)
323           STOP 'ABNORMAL END: S/R STREAMICE_INIT_VAR'
324          ENDIF
325    
326    ! finish initialize glen constant
327    
328  ! initialize basal traction  ! initialize basal traction
329    
330        IF ( STREAMICEbasalTracConfig.EQ.'FILE' ) THEN        IF ( STREAMICEbasalTracConfig.EQ.'FILE' ) THEN
331    
332         IF ( STREAMICEbasalTracFile .NE. ' ' ) THEN         IF ( STREAMICEbasalTracFile .NE. ' ' ) THEN
333          _BARRIER          _BARRIER
334  C The 0 is the "iteration" argument. The ' ' is an empty suffix  
335          CALL READ_FLD_XY_RS( STREAMICEbasalTracFile, ' ',          CALL READ_FLD_XY_RL( STREAMICEbasalTracFile, ' ',
336       &      C_basal_friction, 0, myThid )       &      C_basal_friction, 0, myThid )
337    
338         ELSE         ELSE
339          WRITE(msgBuf,'(A)') 'INIT THICKNESS - FILENAME MISSING'          WRITE(msgBuf,'(A)') 'INIT C_BASAL - FILENAME MISSING'
340          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
341       &                    SQUEEZE_RIGHT , 1)       &                    SQUEEZE_RIGHT , 1)
342         ENDIF         ENDIF
# Line 248  C The 0 is the "iteration" argument. The Line 357  C The 0 is the "iteration" argument. The
357                            
358         lenx = sNx*nSx*nPx*delX(1)         lenx = sNx*nSx*nPx*delX(1)
359         leny = sNy*nSy*nPy*delY(1)         leny = sNy*nSy*nPy*delY(1)
        print *, 'lenx', lenx  
        print *, 'leny', leny  
360         DO bj = myByLo(myThid), myByHi(myThid)         DO bj = myByLo(myThid), myByHi(myThid)
361          DO bi = myBxLo(myThid), myBxHi(myThid)          DO bi = myBxLo(myThid), myBxHi(myThid)
362           DO j=1,sNy           DO j=1,sNy
# Line 268  C The 0 is the "iteration" argument. The Line 375  C The 0 is the "iteration" argument. The
375        ELSE IF (STREAMICEbasalTracConfig.EQ.'1DPERIODIC' ) THEN        ELSE IF (STREAMICEbasalTracConfig.EQ.'1DPERIODIC' ) THEN
376                            
377         lenx = sNx*nSx*nPx*delX(1)         lenx = sNx*nSx*nPx*delX(1)
        print *, 'lenx', lenx  
378         DO bj = myByLo(myThid), myByHi(myThid)         DO bj = myByLo(myThid), myByHi(myThid)
379          DO bi = myBxLo(myThid), myBxHi(myThid)          DO bi = myBxLo(myThid), myBxHi(myThid)
380           DO j=1,sNy           DO j=1,sNy
# Line 285  C The 0 is the "iteration" argument. The Line 391  C The 0 is the "iteration" argument. The
391    
392        ELSE        ELSE
393    
394         WRITE(msgBuf,'(A)') 'INIT THICKNESS - NOT IMPLENTED'         WRITE(msgBuf,'(A)') 'INIT TRAC - NOT IMPLENTED'
395         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,         CALL PRINT_ERROR( msgBuf, myThid)
396       &                    SQUEEZE_RIGHT , 1)         STOP 'ABNORMAL END: S/R STREAMICE_INIT_VAR'
397        ENDIF        ENDIF
398    
399  ! finish initialize basal traction  ! finish initialize basal trac
400    
401    #ifdef ALLOW_STREAMICE_2DTRACER
402    
403          IF ( STREAMICETRAC2DINITFILE .NE. ' ' ) THEN
404             _BARRIER
405    
406            CALL READ_FLD_XY_RL( STREAMICETRAC2dInitFile, ' ',
407         &      trac2d, 0, myThid )
408    
409           ELSE
410            WRITE(msgBuf,'(A)') 'TRAC2dInit - NO FILE SPECIFIED'
411            CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
412         &                    SQUEEZE_RIGHT , 1)
413            DO bj = myByLo(myThid), myByHi(myThid)
414             DO bi = myBxLo(myThid), myBxHi(myThid)
415              DO j=1,sNy
416               DO i=1,sNx
417                trac2d(i,j,bi,bj) = 0.0
418               ENDDO
419              ENDDO
420             ENDDO
421            ENDDO
422    
423           ENDIF
424    
425          _EXCH_XY_RL (trac2d, myThid)
426    
427    
428    #endif /*STREAMICE_ALLOW_2DTRACER*/
429    
430        CALL STREAMICE_UPD_FFRAC_UNCOUPLED ( myThid )        CALL STREAMICE_UPD_FFRAC_UNCOUPLED ( myThid )
431    
# Line 298  C The 0 is the "iteration" argument. The Line 433  C The 0 is the "iteration" argument. The
433        _EXCH_XY_RL(STREAMICE_hmask, myThid )        _EXCH_XY_RL(STREAMICE_hmask, myThid )
434        _EXCH_XY_RL(area_shelf_streamice, myThid )        _EXCH_XY_RL(area_shelf_streamice, myThid )
435        _EXCH_XY_RL(C_basal_friction, myThid )        _EXCH_XY_RL(C_basal_friction, myThid )
436          _EXCH_XY_RL(B_glen, myThid )
437    #ifdef USE_ALT_RLOW
438          _EXCH_XY_RL(R_low_si, myThid )
439    #endif
440    
441    !#ifdef STREAMICE_HYBRID_STRESS
442    
443  #ifdef STREAMICE_HYBRID_STRESS  !      CALL STREAMICE_VISC_BETA (myThid)
444    
445        CALL STREAMICE_VISC_BETA (myThid)  ! DNG THIS CALL IS TO INITIALISE VISCOSITY
446    !     TO AVOID POSSIBLE ADJOINT INSTABILITIES
447    !     IT IS WRITTEN OVER IN FIRST TIMESTEP
448    
449    #ifdef ALLOW_AUTODIFF
450    
451           CALL STREAMICE_UPD_FFRAC_UNCOUPLED ( myThid )
452           CALL STREAMICE_VELMASK_UPD (myThid)
453           CALL STREAMICE_VEL_SOLVE( myThid )
454    
455  #endif  #endif
456    
457    !#endif
458          
459          CALL WRITE_FLD_XY_RL ( "C_basal_fric", "",
460         & C_basal_friction, 0, myThid )
461          CALL WRITE_FLD_XY_RL ( "B_glen_sqrt", "",
462         & B_glen, 0, myThid )
463        CALL WRITE_FLD_XY_RL ( "H_streamice", "init",        CALL WRITE_FLD_XY_RL ( "H_streamice", "init",
464       & H_streamIce, 0, myThid )       & H_streamIce, 0, myThid )
465    #ifdef ALLOW_STREAMICE_2DTRACER
466          CALL WRITE_FLD_XY_RL ( "2DTracer", "init",
467         & trac2d, 0, myThid )
468    #endif
469        CALL WRITE_FLD_XY_RL ( "area_shelf_streamice", "init",        CALL WRITE_FLD_XY_RL ( "area_shelf_streamice", "init",
470       & area_shelf_streamice, 0, myThid )       & area_shelf_streamice, 0, myThid )
471        CALL WRITE_FLD_XY_RL ( "STREAMICE_hmask", "init",        CALL WRITE_FLD_XY_RL ( "STREAMICE_hmask", "init",
472       & STREAMICE_hmask, 0, myThid )       & STREAMICE_hmask, 0, myThid )
473    #ifdef ALLOW_CTRL
474          CALL ACTIVE_WRITE_GEN_RS( 'maskCtrlst', STREAMICE_ctrl_mask,
475         &  'XY', Nr, 1, .FALSE., 0, mythid, dummyRS )
476    #endif
477    !      call active_write_xyz( 'maskCtrlS', STREAMICE_ctrl_mask, 1, 0,
478    !     & mythid, dummy)
479  !       CALL STREAMICE_VELMASK_UPD (myThid)  !       CALL STREAMICE_VELMASK_UPD (myThid)
480  !       CALL STREAMICE_UPD_FFRAC_UNCOUPLED ( myThid )  !       CALL STREAMICE_UPD_FFRAC_UNCOUPLED ( myThid )
481  !       CALL STREAMICE_VEL_SOLVE( myThid )  !       CALL STREAMICE_VEL_SOLVE( myThid )
# Line 321  C The 0 is the "iteration" argument. The Line 484  C The 0 is the "iteration" argument. The
484       &   C_basal_friction, 0, myThid )       &   C_basal_friction, 0, myThid )
485        CALL WRITE_FLD_XY_RL ( "V_init", "",        CALL WRITE_FLD_XY_RL ( "V_init", "",
486       &   V_streamice, 0, myThid )       &   V_streamice, 0, myThid )
487    #ifdef USE_ALT_RLOW
488          CALL WRITE_FLD_XY_RL ( "R_low_si", "init",
489         & R_low_si, 0, myThid )
490    #endif
491    
492  !       CALL WRITE_FULLARRAY_RL ("H",H_streamice,1,0,0,1,0,myThid)  !       CALL WRITE_FULLARRAY_RL ("H",H_streamice,1,0,0,1,0,myThid)
493  !       CALL WRITE_FULLARRAY_RL ("hmask",STREAMICE_hmask,1,0,0,1,0,myThid)  !       CALL WRITE_FULLARRAY_RL ("hmask",STREAMICE_hmask,1,0,0,1,0,myThid)
494  !       CALL WRITE_FULLARRAY_RL ("umask",STREAMICE_umask,1,0,0,1,0,myThid)  !       CALL WRITE_FULLARRAY_RL ("umask",STREAMICE_umask,1,0,0,1,0,myThid)
495    
496    
497                
498  #endif /* ALLOW_STREAMICE */  #endif /* ALLOW_STREAMICE */
499    

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

  ViewVC Help
Powered by ViewVC 1.1.22