/[MITgcm]/MITgcm/pkg/streamice/streamice_readparms.F
ViewVC logotype

Diff of /MITgcm/pkg/streamice/streamice_readparms.F

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

revision 1.6 by dgoldberg, Thu Jul 10 15:09:40 2014 UTC revision 1.16 by dgoldberg, Thu Oct 20 15:22:53 2016 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
   
4  C this needs changes  C this needs changes
5    
6  #include "STREAMICE_OPTIONS.h"  #include "STREAMICE_OPTIONS.h"
# Line 20  C     !USES: Line 19  C     !USES:
19  #include "PARAMS.h"  #include "PARAMS.h"
20  #include "STREAMICE.h"  #include "STREAMICE.h"
21  #include "STREAMICE_BDRY.h"  #include "STREAMICE_BDRY.h"
22  #ifdef ALLOW_STREAMICE_FLUX_CONTROL  !#ifdef ALLOW_STREAMICE_FLUX_CONTROL
23  #include "STREAMICE_CTRL_FLUX.h"        !#include "STREAMICE_CTRL_FLUX.h"
24  #endif  !#endif
25    
26  C     !INPUT PARAMETERS:  C     !INPUT PARAMETERS:
27        INTEGER myThid        INTEGER myThid
# Line 38  C     iUnit      :: Work variable for IO Line 37  C     iUnit      :: Work variable for IO
37    
38        NAMELIST /STREAMICE_PARM01/        NAMELIST /STREAMICE_PARM01/
39       &     streamice_density, streamice_density_ocean_avg,       &     streamice_density, streamice_density_ocean_avg,
40         &     streamice_density_firn,
41       &     B_glen_isothermal, n_glen, eps_glen_min, eps_u_min,       &     B_glen_isothermal, n_glen, eps_glen_min, eps_u_min,
42       &     C_basal_fric_const, n_basal_friction,       &     C_basal_fric_const, n_basal_friction,
43       &     streamice_vel_update,streamice_cg_tol,streamice_nonlin_tol,       &     streamice_vel_update,streamice_cg_tol,streamice_nonlin_tol,
44       &     streamice_nonlin_tol_fp,       &     streamice_nonlin_tol_fp, streamice_err_norm,
45       &     streamice_max_cg_iter, streamice_max_nl_iter,       &     streamice_max_cg_iter, streamice_max_nl_iter,
46         &     streamice_maxcgiter_cpl, streamice_maxnliter_cpl,
47       &     STREAMICEthickInit,       &     STREAMICEthickInit,
48       &     STREAMICEsigcoordInit,       &     STREAMICEsigcoordInit,
49       &     STREAMICEsigcoordFile,       &     STREAMICEsigcoordFile,
50       &     STREAMICEthickFile,       &     STREAMICEthickFile,
51       &     STREAMICEcalveMaskFile,       &     STREAMICEcalveMaskFile,
52       &     STREAMICEcostMaskFile,       &     STREAMICEcostMaskFile,
      &     STREAMICEison,  
53       &     STREAMICE_dump_mdsio, STREAMICE_tave_mdsio,       &     STREAMICE_dump_mdsio, STREAMICE_tave_mdsio,
54       &     STREAMICE_dump_mnc, STREAMICE_tave_mnc,       &     STREAMICE_dump_mnc, STREAMICE_tave_mnc,
55       &     STREAMICE_move_front,       &     STREAMICE_move_front,
# Line 73  C     iUnit      :: Work variable for IO Line 73  C     iUnit      :: Work variable for IO
73       &     STREAMICEuFaceBdryFile,       &     STREAMICEuFaceBdryFile,
74       &     STREAMICEvFaceBdryFile,       &     STREAMICEvFaceBdryFile,
75       &     STREAMICEuDirichValsFile,       &     STREAMICEuDirichValsFile,
76       &     STREAMICEvDirichValsFile,       &     STREAMICEvDirichValsFile,
77       &     STREAMICEuMassFluxFile,       &     STREAMICEuMassFluxFile,
78       &     STREAMICEvMassFluxFile,       &     STREAMICEvMassFluxFile,
79       &     STREAMICEuNormalStressFile,       &     STREAMICEuNormalStressFile,
80       &     STREAMICEvNormalStressFile,       &     STREAMICEvNormalStressFile,
81       &     STREAMICEuShearStressFile,       &     STREAMICEuShearStressFile,
# Line 84  C     iUnit      :: Work variable for IO Line 84  C     iUnit      :: Work variable for IO
84       &     STREAMICEvNormalTimeDepFile,       &     STREAMICEvNormalTimeDepFile,
85       &     STREAMICEuShearTimeDepFile,       &     STREAMICEuShearTimeDepFile,
86       &     STREAMICEvShearTimeDepFile,       &     STREAMICEvShearTimeDepFile,
87         &     STREAMICEuFluxTimeDepFile, STREAMICEvFluxTimeDepFile,
88       &     STREAMICEGlenConstFile, STREAMICEGlenConstConfig,       &     STREAMICEGlenConstFile, STREAMICEGlenConstConfig,
89       &     STREAMICE_ppm_driving_stress,       &     STREAMICE_ppm_driving_stress,
90       &     STREAMICE_h_ctrl_const_surf,       &     STREAMICE_h_ctrl_const_surf,
91       &     streamice_wgt_drift,streamice_wgt_surf,streamice_wgt_vel,       &     streamice_wgt_drift,streamice_wgt_surf,streamice_wgt_vel,
92       &     streamice_wgt_avthick, streamice_wgt_tikh,       &     streamice_wgt_avthick, streamice_wgt_tikh,
93       &     streamice_addl_backstress,       &     streamice_addl_backstress,
94       &     streamice_smooth_gl_width,       &     streamice_smooth_gl_width,
95       &     streamice_adot_uniform,       &     streamice_adot_uniform,
96       &     STREAMICE_ADV_SCHEME, streamice_forcing_period       &     streamice_firn_correction,
97         &     STREAMICE_apply_firn_correction,
98         &     STREAMICE_ADV_SCHEME, streamice_forcing_period,
99         &     STREAMICE_chkfixedptconvergence,
100         &     STREAMICE_chkresidconvergence,
101         &     STREAMICE_alt_driving_stress,
102    #ifdef STREAMICE_FLOWLINE_BUTTRESS
103         &     streamice_buttr_width,
104         &     useStreamiceFlowlineButtr,
105    #endif
106         &     STREAMICE_allow_cpl
107    
108  #ifdef ALLOW_STREAMICE_2DTRACER  #ifdef ALLOW_STREAMICE_2DTRACER
109        NAMELIST /STREAMICE_PARMTRACER/        NAMELIST /STREAMICE_PARMTRACER/
# Line 103  C     iUnit      :: Work variable for IO Line 114  C     iUnit      :: Work variable for IO
114    
115  #ifdef ALLOW_PETSC  #ifdef ALLOW_PETSC
116        NAMELIST /STREAMICE_PARMPETSC/        NAMELIST /STREAMICE_PARMPETSC/
117       &     PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE       &     PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE,
118         &     streamice_use_petsc
119  #endif  #endif
120    
121  #ifdef ALLOW_STREAMICE_FLUX_CONTROL  #if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP))
122        NAMELIST /STREAMICE_PARMFLUXCTRL/        NAMELIST /STREAMICE_PARMOAD/
123       &     n_fluxes, n_epochs,       &     streamice_nonlin_tol_adjoint
124       &     streamice_ctrl_flux_id,  #ifdef ALLOW_PETSC
125       &     streamice_ctrl_flux_scaleVel       &     ,STREAMICE_OAD_petsc_reuse,
126         &     PETSC_PRECOND_OAD
127    #endif
128  #endif  #endif
129    
130    !#ifdef ALLOW_STREAMICE_FLUX_CONTROL
131    !      NAMELIST /STREAMICE_PARMFLUXCTRL/
132    !     &     n_fluxes, n_epochs,
133    !     &     streamice_ctrl_flux_id,
134    !     &     streamice_ctrl_flux_scaleVel
135    !#endif
136    
137        NAMELIST /STREAMICE_PARM02/        NAMELIST /STREAMICE_PARM02/
138       &     shelf_max_draft,       &     shelf_max_draft,
# Line 147  C     iUnit      :: Work variable for IO Line 167  C     iUnit      :: Work variable for IO
167       &     flux_bdry_val_WEST, flux_bdry_val_EAST,       &     flux_bdry_val_WEST, flux_bdry_val_EAST,
168       &     STREAMICE_NS_periodic, STREAMICE_EW_periodic       &     STREAMICE_NS_periodic, STREAMICE_EW_periodic
169    
170    C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
171    
172          IF ( .NOT.useStreamIce ) THEN
173    C-    pkg STREAMICE is not used
174            _BEGIN_MASTER(myThid)
175    C-    Track pkg activation status:
176             STREAMICEisOn = .FALSE.
177    C     print a (weak) warning if data.streamice is found
178             CALL PACKAGES_UNUSED_MSG( 'useStreamIce', ' ', ' ' )
179            _END_MASTER(myThid)
180            RETURN
181          ENDIF
182    
183        _BEGIN_MASTER(myThid)        _BEGIN_MASTER(myThid)
184    
185    C This routine has been called by the main model so we set our
186    C internal flag to indicate we are in business
187          STREAMICEisOn = .TRUE.
188    
189  C--   Default values for STREAMICE  C--   Default values for STREAMICE
190    
191        streamice_density = 917.        streamice_density = 917.
192        streamice_density_ocean_avg = 1024.        streamice_density_ocean_avg = 1024.
193          streamice_density_firn = streamice_density  
194        B_glen_isothermal = 9.461e-18   !  Pa (-1/3) a        B_glen_isothermal = 9.461e-18   !  Pa (-1/3) a
195        n_glen = 3.        n_glen = 3.
196        eps_glen_min = 1.0e-12        eps_glen_min = 1.0e-12
197        eps_u_min = 1.0e-6        eps_u_min = 1.0e-6
198        C_basal_fric_const = 31.71 ! Pa (m/a)-1n        C_basal_fric_const = 31.71 ! Pa (m/a)-1n
199        n_basal_friction = 1.        n_basal_friction = 1.
200        streamice_vel_update = 169200. ! seconds        streamice_vel_update = deltaT ! seconds
201        streamice_cg_tol = 1e-6        streamice_cg_tol = 1e-6
202        streamice_nonlin_tol = 1e-6        streamice_nonlin_tol = 1e-6
203        streamice_nonlin_tol_fp = 1.e-14        streamice_nonlin_tol_fp = 1.e-14
204          streamice_err_norm = 0.
205    #if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP))
206          streamice_nonlin_tol_adjoint = 1.e-14
207    #ifdef ALLOW_PETSC
208          PETSC_PRECOND_OAD = 'MUMPS'
209          STREAMICE_OAD_petsc_reuse =.false.
210    #endif
211    #endif
212        streamice_max_cg_iter = 2000        streamice_max_cg_iter = 2000
213        streamice_max_nl_iter = 100        streamice_max_nl_iter = 100
214          streamice_maxcgiter_cpl = 0
215          streamice_maxnliter_cpl = 0
216  !      streamice_n_sub_regularize = 4  !      streamice_n_sub_regularize = 4
217        streamice_CFL_factor = .5        streamice_CFL_factor = .5
218        streamice_adjDump = 0.        streamice_adjDump = 0.
# Line 174  C--   Default values for STREAMICE Line 222  C--   Default values for STREAMICE
222        streamice_ky_b_init = 1.        streamice_ky_b_init = 1.
223        streamice_wgt_drift = 0.        streamice_wgt_drift = 0.
224        streamice_wgt_tikh = 0.        streamice_wgt_tikh = 0.
225        streamice_wgt_surf = 0.            streamice_wgt_surf = 0.
226        streamice_wgt_vel = 0.            streamice_wgt_vel = 0.
227        streamice_wgt_avthick = 0.        streamice_wgt_avthick = 0.
228        streamice_addl_backstress = 0.0        streamice_addl_backstress = 0.0
229        streamice_smooth_gl_width = 0.0        streamice_smooth_gl_width = 0.0
230        streamice_adot_uniform = 0.0        streamice_adot_uniform = 0.0
231        streamice_forcing_period = 0        streamice_forcing_period = 0
232          streamice_firn_correction = 0.
233    #ifdef STREAMICE_FLOWLINE_BUTTRESS
234          streamice_buttr_width = 1000000000.
235    #endif
236          STREAMICE_apply_firn_correction = .false.
237          
238        STREAMICEthickInit = 'FILE'        STREAMICEthickInit = 'FILE'
239        STREAMICEthickFile = ' '        STREAMICEthickFile = ' '
240        STREAMICEcalveMaskFile = ' '        STREAMICEcalveMaskFile = ' '
# Line 205  C--   Default values for STREAMICE Line 258  C--   Default values for STREAMICE
258        STREAMICEvNormalTimeDepFile = ' '        STREAMICEvNormalTimeDepFile = ' '
259        STREAMICEuShearTimeDepFile = ' '        STREAMICEuShearTimeDepFile = ' '
260        STREAMICEvShearTimeDepFile = ' '        STREAMICEvShearTimeDepFile = ' '
261          STREAMICEuFluxTimeDepFile = ' '
262          STREAMICEvFluxTimeDepFile = ' '
263    
264  #ifdef ALLOW_STREAMICE_2DTRACER  #ifdef ALLOW_STREAMICE_2DTRACER
265        STREAMICETrac2DBCxFile = ''        STREAMICETrac2DBCxFile = ''
# Line 223  C--   Default values for STREAMICE Line 278  C--   Default values for STREAMICE
278  #ifdef ALLOW_PETSC  #ifdef ALLOW_PETSC
279        PETSC_PRECOND_TYPE = 'PCBJACOBI'        PETSC_PRECOND_TYPE = 'PCBJACOBI'
280        PETSC_SOLVER_TYPE = 'KSPCG'        PETSC_SOLVER_TYPE = 'KSPCG'
281          streamice_use_petsc = .true.
282  #endif  #endif
283        STREAMICE_ADV_SCHEME = ''        STREAMICE_ADV_SCHEME = ''
284    
285  #ifdef ALLOW_STREAMICE_FLUX_CONTROL  !#ifdef ALLOW_STREAMICE_FLUX_CONTROL
286        n_fluxes = 0  !      n_fluxes = 0
287        n_epochs = 0  !      n_epochs = 0
288        DO iarr=1,n_fluxes_max  !      DO iarr=1,n_fluxes_max
289         streamice_ctrl_flux_id(iarr) = 0  !       streamice_ctrl_flux_id(iarr) = 0
290         DO tarr=1,n_epochs_max  !       DO tarr=1,n_epochs_max
291          streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0  !        streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0
292         ENDDO  !       ENDDO
293        ENDDO  !      ENDDO
294  #endif  !#endif
295    
       STREAMICEison = .TRUE.  
296        STREAMICE_tave_mdsio = .TRUE.        STREAMICE_tave_mdsio = .TRUE.
297        STREAMICE_dump_mdsio = .TRUE.        STREAMICE_dump_mdsio = .TRUE.
298        STREAMICE_dump_mnc = .FALSE.        STREAMICE_dump_mnc = .FALSE.
299        STREAMICE_tave_mnc = .FALSE.        STREAMICE_tave_mnc = .FALSE.
300  !      STREAMICE_GL_regularize = .FALSE.  !      STREAMICE_GL_regularize = .FALSE.
301        STREAMICE_move_front = .FALSE.        STREAMICE_move_front = .FALSE.
# Line 249  C--   Default values for STREAMICE Line 304  C--   Default values for STREAMICE
304  !      STREAMICE_construct_matrix = .TRUE.  !      STREAMICE_construct_matrix = .TRUE.
305        STREAMICE_lower_cg_tol = .FALSE.        STREAMICE_lower_cg_tol = .FALSE.
306        STREAMICE_diagnostic_only = .FALSE.        STREAMICE_diagnostic_only = .FALSE.
307    #ifdef STREAMICE_FLOWLINE_BUTTRESS
308          useStreamiceFlowlineButtr=.FALSE.
309    #endif
310        STREAMICE_ppm_driving_stress = .FALSE.        STREAMICE_ppm_driving_stress = .FALSE.
311          STREAMICE_chkfixedptconvergence = .true.
312          STREAMICE_chkresidconvergence = .true.
313          STREAMICE_alt_driving_stress = .FALSE.
314        STREAMICE_h_ctrl_const_surf = .FALSE.        STREAMICE_h_ctrl_const_surf = .FALSE.
315          STREAMICE_allow_cpl = .false.
316  !       STREAMICE_hybrid_stress= .FALSE.  !       STREAMICE_hybrid_stress= .FALSE.
317    
318        min_x_noflow_NORTH = 0.        min_x_noflow_NORTH = 0.
# Line 295  C--   Default values for STREAMICE Line 357  C--   Default values for STREAMICE
357        flux_bdry_val_EAST = 0.        flux_bdry_val_EAST = 0.
358    
359        STREAMICE_NS_periodic = .FALSE.        STREAMICE_NS_periodic = .FALSE.
360        STREAMICE_EW_periodic = .FALSE.        STREAMICE_EW_periodic = .FALSE.
361    
362        WRITE(msgBuf,'(A)') 'STREAMICE_READPARMS: opening data.streamice'        WRITE(msgBuf,'(A)') 'STREAMICE_READPARMS: opening data.streamice'
363        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
# Line 336  C     Read parameters from open data fil Line 398  C     Read parameters from open data fil
398       &    SQUEEZE_RIGHT , 1)       &    SQUEEZE_RIGHT , 1)
399  #endif  #endif
400    
401    #if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP))
402        READ(UNIT=iUnit,NML=STREAMICE_PARM03)        READ(UNIT=iUnit,NML=STREAMICE_PARMOAD)
403        WRITE(msgBuf,'(A)')        WRITE(msgBuf,'(A)')
404       &    'STREAMICE_READPARMS: read third param block'       &    'STREAMICE_READPARMS: read oad parm block'
405        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
406       &    SQUEEZE_RIGHT , 1)       &    SQUEEZE_RIGHT , 1)
407        CLOSE(iUnit)  #endif
   
   
 #ifdef ALLOW_STREAMICE_FLUX_CONTROL  
   
       CALL OPEN_COPY_DATA_FILE(  
      I                     'data.strmctrlflux', 'STREAMICE_READPARMS',  
      O                     iUnit,  
      I                     myThid )  
   
408    
409        READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL)        READ(UNIT=iUnit,NML=STREAMICE_PARM03)
410        WRITE(msgBuf,'(A)')        WRITE(msgBuf,'(A)')
411       &    'STREAMICE_READPARMS: read flux_ctrl param block'       &    'STREAMICE_READPARMS: read third param block'
412        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
413       &    SQUEEZE_RIGHT , 1)       &    SQUEEZE_RIGHT , 1)
414        CLOSE(iUnit)        CLOSE(iUnit)
 #endif  
   
415    
416    !#ifdef ALLOW_STREAMICE_FLUX_CONTROL
417    !
418    !      CALL OPEN_COPY_DATA_FILE(
419    !     I                     'data.strmctrlflux', 'STREAMICE_READPARMS',
420    !     O                     iUnit,
421    !     I                     myThid )
422    !
423    !      READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL)
424    !      WRITE(msgBuf,'(A)')
425    !     &    'STREAMICE_READPARMS: read flux_ctrl param block'
426    !      CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
427    !     &    SQUEEZE_RIGHT , 1)
428    !      CLOSE(iUnit)
429    !#endif
430    
431        streamice_nstep_velocity = NINT (streamice_vel_update / deltaT)        streamice_nstep_velocity = NINT (streamice_vel_update / deltaT)
432    
433  C-    Set Output type flags :  C-    Set Output type flags :
434          
435  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
436        IF (useMNC) THEN        IF (useMNC) THEN
437          IF ( .NOT.outputTypesInclusive          IF ( .NOT.outputTypesInclusive

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

  ViewVC Help
Powered by ViewVC 1.1.22