Changeset 9210 for branches/2017/dev_merge_2017/NEMOGCM
- Timestamp:
- 2018-01-11T16:41:21+01:00 (6 years ago)
- Location:
- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r9169 r9210 154 154 ! !-----------------------! 155 155 istp = nit000 156 ! 156 157 #if defined key_c1d 157 DO WHILE ( istp <= nitend .AND. nstop == 0 ) 158 CALL stp_c1d( istp ) 158 DO WHILE ( istp <= nitend .AND. nstop == 0 ) !== C1D time-stepping ==! 159 CALL stp_c1d( istp ) 160 istp = istp + 1 161 END DO 162 #else 163 164 !!gm This data assimilation calls should be part of the initialisation (i.e. put in asm_inc_init) 165 ! 166 IF( lk_asminc ) THEN !== data assimilation ==! (done prior to time stepping) 167 IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 ) ! Output background fields 168 IF( ln_asmdin ) THEN ! Direct initialization 169 IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 ) ! Tracers 170 IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 ) ! Dynamics 171 IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 ) ! SSH 172 ENDIF 173 ENDIF 174 !!gm end 175 ! 176 # if defined key_agrif 177 ! !== AGRIF time-stepping ==! 178 CALL Agrif_Regrid() 179 DO WHILE( istp <= nitend .AND. nstop == 0 ) 180 CALL stp 181 istp = istp + 1 182 END DO 183 ! 184 IF( .NOT. Agrif_Root() ) THEN 185 CALL Agrif_ParentGrid_To_ChildGrid() 186 IF( ln_diaobs ) CALL dia_obs_wri 187 IF( ln_timing ) CALL timing_finalize 188 CALL Agrif_ChildGrid_To_ParentGrid() 189 ENDIF 190 ! 191 # else 192 ! 193 IF( .NOT.ln_diurnal_only ) THEN !== Standard time-stepping ==! 194 ! 195 DO WHILE( istp <= nitend .AND. nstop == 0 ) 196 CALL stp ( istp ) 159 197 istp = istp + 1 160 198 END DO 161 #else 162 IF( lk_asminc ) THEN 163 IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 ) ! Output background fields 164 IF( ln_asmdin ) THEN ! Direct initialization 165 IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 ) ! Tracers 166 IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 ) ! Dynamics 167 IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 ) ! SSH 168 ENDIF 169 ENDIF 170 171 #if defined key_agrif 172 CALL Agrif_Regrid() 173 #endif 174 175 DO WHILE ( istp <= nitend .AND. nstop == 0 ) 176 #if defined key_agrif 177 CALL stp ! AGRIF: time stepping 178 #else 179 IF ( .NOT. ln_diurnal_only ) THEN 180 CALL stp( istp ) ! standard time stepping 181 ELSE 182 CALL stp_diurnal( istp ) ! time step only the diurnal SST 183 ENDIF 184 #endif 199 ! 200 ELSE !== diurnal SST time-steeping only ==! 201 ! 202 DO WHILE( istp <= nitend .AND. nstop == 0 ) 203 CALL stp_diurnal( istp ) ! time step only the diurnal SST 185 204 istp = istp + 1 186 IF( lk_mpp ) CALL mpp_max( nstop )187 205 END DO 188 #endif 189 206 ! 207 ENDIF 208 ! 209 # endif 210 ! 211 #endif 212 ! 190 213 IF( ln_diaobs ) CALL dia_obs_wri 191 214 ! … … 199 222 IF( nstop /= 0 .AND. lwp ) THEN ! error print 200 223 WRITE(numout,cform_err) 201 WRITE(numout,*) nstop, ' error have been found' 202 ENDIF 203 ! 204 #if defined key_agrif 205 IF( .NOT. Agrif_Root() ) THEN 206 CALL Agrif_ParentGrid_To_ChildGrid() 207 IF( ln_diaobs ) CALL dia_obs_wri 208 IF( ln_timing ) CALL timing_finalize 209 CALL Agrif_ChildGrid_To_ParentGrid() 210 ENDIF 211 #endif 224 WRITE(numout,*) 'nemo_gcm: a total of ', nstop, ' errors have been found' 225 WRITE(numout,*) 226 ENDIF 227 ! 212 228 IF( ln_timing ) CALL timing_finalize 213 229 ! … … 215 231 ! 216 232 #if defined key_iomput 217 CALL xios_finalize! end mpp communications with xios218 IF( lk_oasis ) CALL cpl_finalize! end coupling and mpp communications with OASIS233 CALL xios_finalize ! end mpp communications with xios 234 IF( lk_oasis ) CALL cpl_finalize ! end coupling and mpp communications with OASIS 219 235 #else 220 IF( lk_oasis ) THEN 221 CALL cpl_finalize ! end coupling and mpp communications with OASIS 222 ELSE 223 IF( lk_mpp ) CALL mppstop ! end mpp communications 236 IF ( lk_oasis ) THEN ; CALL cpl_finalize ! end coupling and mpp communications with OASIS 237 ELSEIF( lk_mpp ) THEN ; CALL mppstop ! end mpp communications 224 238 ENDIF 225 239 #endif -
branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/step.F90
r9124 r9210 280 280 IF(.NOT.ln_linssh) CALL dom_vvl_sf_swp( kstp ) ! swap of vertical scale factors 281 281 ! 282 IF( ln_diahsb ) CALL dia_hsb( kstp )! - ML - global conservation diagnostics282 IF( ln_diahsb ) CALL dia_hsb ( kstp ) ! - ML - global conservation diagnostics 283 283 284 284 !!gm : This does not only concern the dynamics ==>>> add a new title … … 287 287 !!jc: That would be better, but see comment above 288 288 !! 289 IF( lrst_oce 290 IF( ln_sto_eos 289 IF( lrst_oce ) CALL rst_write ( kstp ) ! write output ocean restart file 290 IF( ln_sto_eos ) CALL sto_rst_write( kstp ) ! write restart file for stochastic parameters 291 291 292 292 #if defined key_agrif … … 298 298 IF( Agrif_NbStepint() == 0 ) THEN ! AGRIF Update 299 299 !!jc in fact update is useless at last time step, but do it for global diagnostics 300 CALL Agrif_Update_ssh()! Update ssh301 IF(.NOT.ln_linssh) CALL Agrif_Update_vvl()! Update vertical scale factors302 CALL Agrif_Update_Tra()! Update active tracers303 CALL Agrif_Update_Dyn()! Update momentum304 # if defined key_top305 CALL Agrif_Update_Trc()! Update passive tracers306 # endif307 ENDIF 308 #endif 309 IF( ln_diaobs ) CALL dia_obs ( kstp )! obs-minus-model (assimilation) diagnostics (call after dynamics update)300 CALL Agrif_Update_ssh() ! Update ssh 301 IF(.NOT.ln_linssh) CALL Agrif_Update_vvl() ! Update vertical scale factors 302 CALL Agrif_Update_Tra() ! Update active tracers 303 CALL Agrif_Update_Dyn() ! Update momentum 304 # if defined key_top 305 CALL Agrif_Update_Trc() ! Update passive tracers 306 # endif 307 ENDIF 308 #endif 309 IF( ln_diaobs ) CALL dia_obs ( kstp ) ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 310 310 311 311 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 312 312 ! Control 313 313 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 314 CALL stp_ctl ( kstp, indic ) 315 IF( indic < 0 ) THEN 316 CALL ctl_stop( 'step: indic < 0' ) 317 CALL dia_wri_state( 'output.abort', kstp ) 318 ENDIF 319 IF( kstp == nit000 ) THEN 320 CALL iom_close( numror ) ! close input ocean restart file 321 IF(lwm) CALL FLUSH ( numond ) ! flush output namelist oce 322 IF(lwm.AND.numoni /= -1 ) & 323 & CALL FLUSH ( numoni ) ! flush output namelist ice (if exist) 314 CALL stp_ctl ( kstp, indic ) 315 316 IF( kstp == nit000 ) THEN ! 1st time step only 317 CALL iom_close( numror ) ! close input ocean restart file 318 IF(lwm) CALL FLUSH ( numond ) ! flush output namelist oce 319 IF(lwm .AND. numoni /= -1 ) CALL FLUSH ( numoni ) ! flush output namelist ice (if exist) 324 320 ENDIF 325 321 … … 337 333 #endif 338 334 ! 339 IF( ln_timing ) THEN 340 IF( ln_timing ) CALL timing_start('stp') 341 !!gm avoid the init phase during 1st time step ??? useless now no? 342 IF( kstp == nit000 ) CALL timing_reset 343 ENDIF 335 IF( ln_timing ) CALL timing_stop('stp') 344 336 ! 345 337 END SUBROUTINE stp -
branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/stpctl.F90
r9023 r9210 19 19 USE dom_oce ! ocean space and time domain variables 20 20 USE c1d ! 1D vertical configuration 21 USE diawri ! Standard run outputs (dia_wri_state routine) 21 22 ! 22 23 USE in_out_manager ! I/O manager 23 24 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 24 25 USE lib_mpp ! distributed memory computing 25 USE wet_dry, ONLY: ll_wd, ssh_ref ! reference depth for negative bathy26 USE wet_dry, ONLY : ll_wd, ssh_ref ! reference depth for negative bathy 26 27 27 28 IMPLICIT NONE … … 51 52 !! ** Actions : "time.step" file = last ocean time-step 52 53 !! "run.stat" file = run statistics 54 !! nstop indicator sheared among all local domain (lk_mpp=T) 53 55 !!---------------------------------------------------------------------- 54 56 INTEGER, INTENT(in ) :: kt ! ocean time-step index … … 62 64 INTEGER , DIMENSION(3) :: ilocu, ilocs 63 65 INTEGER , DIMENSION(2) :: iloch 64 REAL(wp), DIMENSION( 3) :: zmax66 REAL(wp), DIMENSION(4) :: zmax 65 67 !!---------------------------------------------------------------------- 66 68 ! … … 82 84 ! !== test of extrema ==! 83 85 IF( ll_wd ) THEN 84 zmax(1) = MAXVAL( ABS( sshn(:,:) + ssh_ref*tmask(:,:,1) ) ) 86 zmax(1) = MAXVAL( ABS( sshn(:,:) + ssh_ref*tmask(:,:,1) ) ) ! ssh max 85 87 ELSE 86 zmax(1) = MAXVAL( ABS( sshn(:,:) ) ) 88 zmax(1) = MAXVAL( ABS( sshn(:,:) ) ) ! ssh max 87 89 ENDIF 88 90 zmax(2) = MAXVAL( ABS( un(:,:,:) ) ) ! velocity max (zonal only) 89 91 zmax(3) = MAXVAL( -tsn(:,:,:,jp_sal) , mask = tmask(:,:,:) == 1._wp ) ! minus salinity max 92 zmax(4) = REAL( nstop , wp ) ! stop indicator 90 93 ! 91 IF( lk_mpp ) CALL mpp_max_multiple( zmax(:), 3 ) ! max over the global domain 94 IF( lk_mpp ) THEN 95 CALL mpp_max_multiple( zmax(:), 4 ) ! max over the global domain 96 ! 97 nstop = INT( zmax(4) ) ! nstop indicator sheared among all local domains 98 ENDIF 92 99 ! 93 100 IF( MOD( kt, nwrite ) == 1 .AND. lwp ) THEN … … 114 121 IF(lwp) THEN 115 122 WRITE(numout,cform_err) 116 WRITE(numout,*) ' stp ctl: |ssh| > 10 m or |U| > 10 m/s or S < 0 or NaN encounter in the tests'117 WRITE(numout,*) ' ====== '123 WRITE(numout,*) ' stp_ctl: |ssh| > 10 m or |U| > 10 m/s or S < 0 or NaN encounter in the tests' 124 WRITE(numout,*) ' ======= ' 118 125 WRITE(numout,9100) kt, zmax(1), iih, ijh 119 126 WRITE(numout,9200) kt, zmax(2), iiu, iju, iku … … 123 130 ENDIF 124 131 kindic = -3 132 ! 133 nstop = nstop + 1 ! increase nstop by 1 (on all local domains) 134 CALL dia_wri_state( 'output.abort', kt ) ! create an output.abort file 135 ! 125 136 ENDIF 126 137 9100 FORMAT (' kt=',i8,' |ssh| max: ',1pg11.4,', at i j : ',2i5)
Note: See TracChangeset
for help on using the changeset viewer.