- Timestamp:
- 2015-12-17T11:08:49+01:00 (8 years ago)
- Location:
- branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC
- Property svn:mergeinfo deleted
-
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90
r5901 r6079 6 6 !! History : 1.0 ! 2005-12 (C. Talandier, G. Madec, V. Garnier) Original code 7 7 !! 3.2 ! 2009-07 (R. Benshila) Suppression of rigid-lid option 8 !!---------------------------------------------------------------------- 9 10 !!---------------------------------------------------------------------- 11 !! dyn_spg : update the dynamics trend with the lateral diffusion 12 !! dyn_spg_ctl : initialization, namelist read, and parameters control 8 !! 3.7 ! 2015-11 (J. Chanut) Suppression of filtered free surface 9 !!---------------------------------------------------------------------- 10 11 !!---------------------------------------------------------------------- 12 !! dyn_spg : update the dynamics trend with surface pressure gradient 13 !! dyn_spg_init: initialization, namelist read, and parameters control 13 14 !!---------------------------------------------------------------------- 14 15 USE oce ! ocean dynamics and tracers variables … … 18 19 USE sbc_oce ! surface boundary condition: ocean 19 20 USE sbcapr ! surface boundary condition: atmospheric pressure 20 USE dynspg_oce ! surface pressure gradient variables21 21 USE dynspg_exp ! surface pressure gradient (dyn_spg_exp routine) 22 22 USE dynspg_ts ! surface pressure gradient (dyn_spg_ts routine) 23 USE dynspg_flt ! surface pressure gradient (dyn_spg_flt routine)24 USE dynadv ! dynamics: vector invariant versus flux form25 USE dynhpg, ONLY: ln_dynhpg_imp26 23 USE sbctide 27 24 USE updtide … … 32 29 USE in_out_manager ! I/O manager 33 30 USE lib_mpp ! MPP library 34 USE solver ! solver initialization35 31 USE wrk_nemo ! Memory Allocation 36 32 USE timing ! Timing … … 43 39 PUBLIC dyn_spg_init ! routine called by opa module 44 40 45 INTEGER :: nspg = 0 ! type of surface pressure gradient scheme defined from l k_dynspg_...41 INTEGER :: nspg = 0 ! type of surface pressure gradient scheme defined from ln_dynspg_... 46 42 47 43 !! * Substitutions … … 55 51 CONTAINS 56 52 57 SUBROUTINE dyn_spg( kt , kindic)53 SUBROUTINE dyn_spg( kt ) 58 54 !!---------------------------------------------------------------------- 59 55 !! *** ROUTINE dyn_spg *** … … 66 62 !!gm the after velocity, in the 2 other (ua,va) are still the trends 67 63 !! 68 !! ** Method : T hreeschemes:64 !! ** Method : Two schemes: 69 65 !! - explicit computation : the spg is evaluated at now 70 !! - filtered computation : the Roulet & madec (2000) technique is used71 66 !! - split-explicit computation: a time splitting technique is used 72 67 !! … … 80 75 ! 81 76 INTEGER, INTENT(in ) :: kt ! ocean time-step index 82 INTEGER, INTENT( out) :: kindic ! solver flag83 77 ! 84 78 INTEGER :: ji, jj, jk ! dummy loop indices … … 103 97 104 98 IF( ln_apr_dyn & ! atmos. pressure 105 .OR. ( .NOT.l k_dynspg_ts .AND. (ln_tide_pot .AND. lk_tide) ) & ! tide potential (no time slitting)99 .OR. ( .NOT.ln_dynspg_ts .AND. (ln_tide_pot .AND. lk_tide) ) & ! tide potential (no time slitting) 106 100 .OR. nn_ice_embd == 2 ) THEN ! embedded sea-ice 107 101 ! … … 113 107 END DO 114 108 ! 115 IF( ln_apr_dyn .AND. (.NOT. l k_dynspg_ts) ) THEN !== Atmospheric pressure gradient (added later in time-split case) ==!109 IF( ln_apr_dyn .AND. (.NOT. ln_dynspg_ts) ) THEN !== Atmospheric pressure gradient (added later in time-split case) ==! 116 110 zg_2 = grav * 0.5 117 111 DO jj = 2, jpjm1 ! gradient of Patm using inverse barometer ssh … … 126 120 ! 127 121 ! !== tide potential forcing term ==! 128 IF( .NOT.l k_dynspg_ts .AND. ( ln_tide_pot .AND. lk_tide ) ) THEN ! N.B. added directly at sub-time-step in ts-case122 IF( .NOT.ln_dynspg_ts .AND. ( ln_tide_pot .AND. lk_tide ) ) THEN ! N.B. added directly at sub-time-step in ts-case 129 123 ! 130 124 CALL upd_tide( kt ) ! update tide potential … … 171 165 CASE ( 0 ) ; CALL dyn_spg_exp( kt ) ! explicit 172 166 CASE ( 1 ) ; CALL dyn_spg_ts ( kt ) ! time-splitting 173 CASE ( 2 ) ; CALL dyn_spg_flt( kt, kindic ) ! filtered174 167 ! 175 168 END SELECT 176 169 ! 177 170 IF( l_trddyn ) THEN ! save the surface pressure gradient trends for further diagnostics 178 SELECT CASE ( nspg ) 179 CASE ( 0, 1 ) 180 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 181 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 182 CASE( 2 ) 183 z2dt = 2. * rdt 184 IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt 185 ztrdu(:,:,:) = ( ua(:,:,:) - ub(:,:,:) ) / z2dt - ztrdu(:,:,:) 186 ztrdv(:,:,:) = ( va(:,:,:) - vb(:,:,:) ) / z2dt - ztrdv(:,:,:) 187 END SELECT 171 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 172 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 188 173 CALL trd_dyn( ztrdu, ztrdv, jpdyn_spg, kt ) 189 174 ! … … 203 188 !! *** ROUTINE dyn_spg_init *** 204 189 !! 205 !! ** Purpose : Control the consistency between cppoptions for190 !! ** Purpose : Control the consistency between namelist options for 206 191 !! surface pressure gradient schemes 207 192 !!---------------------------------------------------------------------- 208 INTEGER :: ioptio 193 INTEGER :: ioptio, ios 194 ! 195 NAMELIST/namdyn_spg/ ln_dynspg_exp, ln_dynspg_ts, & 196 & ln_bt_fw, ln_bt_av, ln_bt_auto, & 197 & nn_baro, rn_bt_cmax, nn_bt_flt 209 198 !!---------------------------------------------------------------------- 210 199 ! 211 200 IF( nn_timing == 1 ) CALL timing_start('dyn_spg_init') 212 201 ! 213 IF(lwp) THEN ! Control print 202 REWIND( numnam_ref ) ! Namelist namdyn_spg in reference namelist : Free surface 203 READ ( numnam_ref, namdyn_spg, IOSTAT = ios, ERR = 901) 204 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_spg in reference namelist', lwp ) 205 206 REWIND( numnam_cfg ) ! Namelist namdyn_spg in configuration namelist : Free surface 207 READ ( numnam_cfg, namdyn_spg, IOSTAT = ios, ERR = 902 ) 208 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_spg in configuration namelist', lwp ) 209 IF(lwm) WRITE ( numond, namdyn_spg ) 210 ! 211 IF(lwp) THEN ! Namelist print 214 212 WRITE(numout,*) 215 213 WRITE(numout,*) 'dyn_spg_init : choice of the surface pressure gradient scheme' 216 214 WRITE(numout,*) '~~~~~~~~~~~' 217 WRITE(numout,*) ' Explicit free surface lk_dynspg_exp = ', lk_dynspg_exp 218 WRITE(numout,*) ' Free surface with time splitting lk_dynspg_ts = ', lk_dynspg_ts 219 WRITE(numout,*) ' Filtered free surface cst volume lk_dynspg_flt = ', lk_dynspg_flt 220 ENDIF 221 222 IF( lk_dynspg_ts ) CALL dyn_spg_ts_init( nit000 ) 223 ! (do it now, to set nn_baro, used to allocate some arrays later on) 224 ! ! allocate dyn_spg arrays 225 IF( lk_dynspg_ts ) THEN 226 IF( dynspg_oce_alloc() /= 0 ) CALL ctl_stop('STOP', 'dyn_spg_init: failed to allocate dynspg_oce arrays') 215 WRITE(numout,*) ' Explicit free surface ln_dynspg_exp = ', ln_dynspg_exp 216 WRITE(numout,*) ' Free surface with time splitting ln_dynspg_ts = ', ln_dynspg_ts 217 ENDIF 218 219 IF( ln_dynspg_ts ) THEN 220 CALL dyn_spg_ts_init( nit000 ) ! do it first, to set nn_baro, used to allocate some arrays later on 221 ! ! allocate dyn_spg arrays 227 222 IF( dyn_spg_ts_alloc() /= 0 ) CALL ctl_stop('STOP', 'dyn_spg_init: failed to allocate dynspg_ts arrays') 228 223 IF ((neuler/=0).AND.(ln_bt_fw)) CALL ts_rst( nit000, 'READ' ) … … 231 226 ! ! Control of surface pressure gradient scheme options 232 227 ioptio = 0 233 IF(lk_dynspg_exp) ioptio = ioptio + 1 234 IF(lk_dynspg_ts ) ioptio = ioptio + 1 235 IF(lk_dynspg_flt) ioptio = ioptio + 1 228 IF(ln_dynspg_exp) ioptio = ioptio + 1 229 IF(ln_dynspg_ts ) ioptio = ioptio + 1 236 230 ! 237 231 IF( ioptio > 1 .OR. ( ioptio == 0 .AND. .NOT. lk_c1d ) ) & 238 & CALL ctl_stop( ' Choose only one surface pressure gradient scheme with a key cpp' ) 239 IF( ( lk_dynspg_ts .OR. lk_dynspg_exp ) .AND. ln_isfcav ) & 240 & CALL ctl_stop( ' dynspg_ts and dynspg_exp not tested with ice shelf cavity ' ) 241 ! 242 IF( lk_dynspg_exp) nspg = 0 243 IF( lk_dynspg_ts ) nspg = 1 244 IF( lk_dynspg_flt) nspg = 2 232 & CALL ctl_stop( ' Choose only one surface pressure gradient scheme' ) 233 IF( ln_dynspg_ts .AND. ln_isfcav ) & 234 & CALL ctl_stop( ' dynspg_ts not tested with ice shelf cavity ' ) 235 ! 236 IF( ln_dynspg_exp) nspg = 0 237 IF( ln_dynspg_ts ) nspg = 1 245 238 ! 246 239 IF(lwp) THEN … … 248 241 IF( nspg == 0 ) WRITE(numout,*) ' explicit free surface' 249 242 IF( nspg == 1 ) WRITE(numout,*) ' free surface with time splitting scheme' 250 IF( nspg == 2 ) WRITE(numout,*) ' filtered free surface' 251 ENDIF 252 253 #if defined key_dynspg_flt 254 CALL solver_init( nit000 ) ! Elliptic solver initialisation 255 #endif 256 ! ! Control of hydrostatic pressure choice 257 IF( lk_dynspg_ts .AND. ln_dynhpg_imp ) CALL ctl_stop( 'Semi-implicit hpg not compatible with time splitting' ) 243 ENDIF 258 244 ! 259 245 IF( nn_timing == 1 ) CALL timing_stop('dyn_spg_init')
Note: See TracChangeset
for help on using the changeset viewer.