--- MITgcm/pkg/streamice/streamice_readparms.F 2014/05/27 23:47:42 1.4 +++ MITgcm/pkg/streamice/streamice_readparms.F 2016/03/17 20:15:43 1.14 @@ -1,4 +1,4 @@ -C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/streamice/streamice_readparms.F,v 1.4 2014/05/27 23:47:42 jmc Exp $ +C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/streamice/streamice_readparms.F,v 1.14 2016/03/17 20:15:43 dgoldberg Exp $ C $Name: $ C this needs changes @@ -19,9 +19,9 @@ #include "PARAMS.h" #include "STREAMICE.h" #include "STREAMICE_BDRY.h" -#ifdef ALLOW_STREAMICE_FLUX_CONTROL -#include "STREAMICE_CTRL_FLUX.h" -#endif +!#ifdef ALLOW_STREAMICE_FLUX_CONTROL +!#include "STREAMICE_CTRL_FLUX.h" +!#endif C !INPUT PARAMETERS: INTEGER myThid @@ -37,22 +37,22 @@ NAMELIST /STREAMICE_PARM01/ & streamice_density, streamice_density_ocean_avg, + & streamice_density_firn, & B_glen_isothermal, n_glen, eps_glen_min, eps_u_min, & C_basal_fric_const, n_basal_friction, & streamice_vel_update,streamice_cg_tol,streamice_nonlin_tol, & streamice_nonlin_tol_fp, & streamice_max_cg_iter, streamice_max_nl_iter, - & STREAMICE_GL_regularize, + & streamice_maxcgiter_cpl, streamice_maxnliter_cpl, & STREAMICEthickInit, & STREAMICEsigcoordInit, & STREAMICEsigcoordFile, & STREAMICEthickFile, & STREAMICEcalveMaskFile, & STREAMICEcostMaskFile, - & STREAMICEison, & STREAMICE_dump_mdsio, STREAMICE_tave_mdsio, & STREAMICE_dump_mnc, STREAMICE_tave_mnc, - & STREAMICE_GL_regularize, STREAMICE_move_front, + & STREAMICE_move_front, & STREAMICE_calve_to_mask, & STREAMICE_diagnostic_only, & STREAMICE_lower_cg_tol, @@ -64,6 +64,7 @@ & STREAMICEBdotConfig, & STREAMICEbasalTracFile, & STREAMICEBdotFile, + & STREAMICEBdotTimeDepFile, & STREAMICEvelOptimFile, & STREAMICEtopogFile, & STREAMICEhmaskFile, @@ -79,6 +80,11 @@ & STREAMICEvNormalStressFile, & STREAMICEuShearStressFile, & STREAMICEvShearStressFile, + & STREAMICEuNormalTimeDepFile, + & STREAMICEvNormalTimeDepFile, + & STREAMICEuShearTimeDepFile, + & STREAMICEvShearTimeDepFile, + & STREAMICEuFluxTimeDepFile, STREAMICEvFluxTimeDepFile, & STREAMICEGlenConstFile, STREAMICEGlenConstConfig, & STREAMICE_ppm_driving_stress, & STREAMICE_h_ctrl_const_surf, @@ -87,7 +93,16 @@ & streamice_addl_backstress, & streamice_smooth_gl_width, & streamice_adot_uniform, - & STREAMICE_ADV_SCHEME + & streamice_firn_correction, + & STREAMICE_apply_firn_correction, + & STREAMICE_ADV_SCHEME, streamice_forcing_period, + & STREAMICE_chkfixedptconvergence, + & STREAMICE_chkresidconvergence, +#ifdef STREAMICE_FLOWLINE_BUTTRESS + & streamice_buttr_width, + & useStreamiceFlowlineButtr, +#endif + & STREAMICE_allow_cpl #ifdef ALLOW_STREAMICE_2DTRACER NAMELIST /STREAMICE_PARMTRACER/ @@ -98,16 +113,26 @@ #ifdef ALLOW_PETSC NAMELIST /STREAMICE_PARMPETSC/ - & PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE + & PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE, + & streamice_use_petsc #endif -#ifdef ALLOW_STREAMICE_FLUX_CONTROL - NAMELIST /STREAMICE_PARMFLUXCTRL/ - & n_fluxes, n_epochs, - & streamice_ctrl_flux_id, - & streamice_ctrl_flux_scaleVel +#if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP)) + NAMELIST /STREAMICE_PARMOAD/ + & streamice_nonlin_tol_adjoint +#ifdef ALLOW_PETSC + & ,STREAMICE_OAD_petsc_reuse, + & PETSC_PRECOND_OAD +#endif #endif +!#ifdef ALLOW_STREAMICE_FLUX_CONTROL +! NAMELIST /STREAMICE_PARMFLUXCTRL/ +! & n_fluxes, n_epochs, +! & streamice_ctrl_flux_id, +! & streamice_ctrl_flux_scaleVel +!#endif + NAMELIST /STREAMICE_PARM02/ & shelf_max_draft, & shelf_min_draft, @@ -147,6 +172,7 @@ C- pkg STREAMICE is not used _BEGIN_MASTER(myThid) C- Track pkg activation status: + STREAMICEisOn = .FALSE. C print a (weak) warning if data.streamice is found CALL PACKAGES_UNUSED_MSG( 'useStreamIce', ' ', ' ' ) _END_MASTER(myThid) @@ -155,23 +181,37 @@ _BEGIN_MASTER(myThid) +C This routine has been called by the main model so we set our +C internal flag to indicate we are in business + STREAMICEisOn = .TRUE. + C-- Default values for STREAMICE streamice_density = 917. streamice_density_ocean_avg = 1024. + streamice_density_firn = streamice_density B_glen_isothermal = 9.461e-18 ! Pa (-1/3) a n_glen = 3. eps_glen_min = 1.0e-12 eps_u_min = 1.0e-6 C_basal_fric_const = 31.71 ! Pa (m/a)-1n n_basal_friction = 1. - streamice_vel_update = 169200. ! seconds + streamice_vel_update = deltaT ! seconds streamice_cg_tol = 1e-6 streamice_nonlin_tol = 1e-6 streamice_nonlin_tol_fp = 1.e-14 +#if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP)) + streamice_nonlin_tol_adjoint = 1.e-14 +#ifdef ALLOW_PETSC + PETSC_PRECOND_OAD = 'MUMPS' + STREAMICE_OAD_petsc_reuse =.false. +#endif +#endif streamice_max_cg_iter = 2000 streamice_max_nl_iter = 100 - streamice_n_sub_regularize = 4 + streamice_maxcgiter_cpl = 0 + streamice_maxnliter_cpl = 0 +! streamice_n_sub_regularize = 4 streamice_CFL_factor = .5 streamice_adjDump = 0. streamice_bg_surf_slope_x = .0 @@ -186,7 +226,13 @@ streamice_addl_backstress = 0.0 streamice_smooth_gl_width = 0.0 streamice_adot_uniform = 0.0 - + streamice_forcing_period = 0 + streamice_firn_correction = 0. +#ifdef STREAMICE_FLOWLINE_BUTTRESS + streamice_buttr_width = 1000000000. +#endif + STREAMICE_apply_firn_correction = .false. + STREAMICEthickInit = 'FILE' STREAMICEthickFile = ' ' STREAMICEcalveMaskFile = ' ' @@ -195,6 +241,7 @@ STREAMICEbasalTracConfig = 'UNIFORM' STREAMICEBdotConfig = '' STREAMICEBdotFile = '' + STREAMICEBdotTimeDepFile = ' ' STREAMICEbasalTracFile = ' ' STREAMICEvelOptimFile = '' STREAMICEtopogFile = '' @@ -205,6 +252,12 @@ STREAMICEvNormalStressFile = '' STREAMICEuShearStressFile = '' STREAMICEvShearStressFile = '' + STREAMICEuNormalTimeDepFile = ' ' + STREAMICEvNormalTimeDepFile = ' ' + STREAMICEuShearTimeDepFile = ' ' + STREAMICEvShearTimeDepFile = ' ' + STREAMICEuFluxTimeDepFile = ' ' + STREAMICEvFluxTimeDepFile = ' ' #ifdef ALLOW_STREAMICE_2DTRACER STREAMICETrac2DBCxFile = '' @@ -223,34 +276,40 @@ #ifdef ALLOW_PETSC PETSC_PRECOND_TYPE = 'PCBJACOBI' PETSC_SOLVER_TYPE = 'KSPCG' + streamice_use_petsc = .true. #endif STREAMICE_ADV_SCHEME = '' -#ifdef ALLOW_STREAMICE_FLUX_CONTROL - n_fluxes = 0 - n_epochs = 0 - DO iarr=1,n_fluxes_max - streamice_ctrl_flux_id(iarr) = 0 - DO tarr=1,n_epochs_max - streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0 - ENDDO - ENDDO -#endif +!#ifdef ALLOW_STREAMICE_FLUX_CONTROL +! n_fluxes = 0 +! n_epochs = 0 +! DO iarr=1,n_fluxes_max +! streamice_ctrl_flux_id(iarr) = 0 +! DO tarr=1,n_epochs_max +! streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0 +! ENDDO +! ENDDO +!#endif - STREAMICEison = .TRUE. STREAMICE_tave_mdsio = .TRUE. STREAMICE_dump_mdsio = .TRUE. STREAMICE_dump_mnc = .FALSE. STREAMICE_tave_mnc = .FALSE. - STREAMICE_GL_regularize = .FALSE. +! STREAMICE_GL_regularize = .FALSE. STREAMICE_move_front = .FALSE. STREAMICE_calve_to_mask = .FALSE. ! STREAMICE_geom_file_setup = .FALSE. ! STREAMICE_construct_matrix = .TRUE. STREAMICE_lower_cg_tol = .FALSE. STREAMICE_diagnostic_only = .FALSE. +#ifdef STREAMICE_FLOWLINE_BUTTRESS + useStreamiceFlowlineButtr=.FALSE. +#endif STREAMICE_ppm_driving_stress = .FALSE. + STREAMICE_chkfixedptconvergence = .true. + STREAMICE_chkresidconvergence = .true. STREAMICE_h_ctrl_const_surf = .FALSE. + STREAMICE_allow_cpl = .false. ! STREAMICE_hybrid_stress= .FALSE. min_x_noflow_NORTH = 0. @@ -336,27 +395,35 @@ & SQUEEZE_RIGHT , 1) #endif - READ(UNIT=iUnit,NML=STREAMICE_PARM03) +#if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP)) + READ(UNIT=iUnit,NML=STREAMICE_PARMOAD) WRITE(msgBuf,'(A)') - & 'STREAMICE_READPARMS: read third param block' + & 'STREAMICE_READPARMS: read oad parm block' CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, & SQUEEZE_RIGHT , 1) - CLOSE(iUnit) - -#ifdef ALLOW_STREAMICE_FLUX_CONTROL - - CALL OPEN_COPY_DATA_FILE( - I 'data.strmctrlflux', 'STREAMICE_READPARMS', - O iUnit, - I myThid ) +#endif - READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL) + READ(UNIT=iUnit,NML=STREAMICE_PARM03) WRITE(msgBuf,'(A)') - & 'STREAMICE_READPARMS: read flux_ctrl param block' + & 'STREAMICE_READPARMS: read third param block' CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, & SQUEEZE_RIGHT , 1) CLOSE(iUnit) -#endif + +!#ifdef ALLOW_STREAMICE_FLUX_CONTROL +! +! CALL OPEN_COPY_DATA_FILE( +! I 'data.strmctrlflux', 'STREAMICE_READPARMS', +! O iUnit, +! I myThid ) +! +! READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL) +! WRITE(msgBuf,'(A)') +! & 'STREAMICE_READPARMS: read flux_ctrl param block' +! CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, +! & SQUEEZE_RIGHT , 1) +! CLOSE(iUnit) +!#endif streamice_nstep_velocity = NINT (streamice_vel_update / deltaT)