- Timestamp:
- 2020-10-06T18:17:44+02:00 (4 years ago)
- Location:
- NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/SAS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/SAS/nemogcm.F90
r13286 r13571 2 2 !!====================================================================== 3 3 !! *** MODULE nemogcm *** 4 !! StandAlone Surface module : surface fluxes + sea-ice + iceberg floats 4 !! StandAlone Surface module : surface fluxes + sea-ice + iceberg floats + ABL 5 5 !!====================================================================== 6 6 !! History : 3.6 ! 2011-11 (S. Alderson, G. Madec) original code … … 58 58 59 59 #if defined key_mpp_mpi 60 ! need MPI_Wtime 60 61 INCLUDE 'mpif.h' 61 62 #endif … … 83 84 !!---------------------------------------------------------------------- 84 85 INTEGER :: istp ! time step index 86 REAL(wp):: zstptiming ! elapsed time for 1 time step 85 87 !!---------------------------------------------------------------------- 86 88 ! … … 93 95 #if defined key_agrif 94 96 Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs ! agrif_oce module copies of time level indices 95 CALL Agrif_Declare_Var ! " " " " " DYN/TRA 97 CALL Agrif_Declare_Var ! " " " " " DYN/TRA 96 98 # if defined key_top 97 99 CALL Agrif_Declare_Var_top ! " " " " " TOP … … 107 109 ! !== time stepping ==! 108 110 ! !-----------------------! 111 ! 112 ! !== set the model time-step ==! 113 ! 109 114 istp = nit000 110 115 ! … … 124 129 END DO 125 130 ! 126 # else131 # else 127 132 ! 128 133 IF( .NOT.ln_diurnal_only ) THEN !== Standard time-stepping ==! 129 134 ! 130 135 DO WHILE( istp <= nitend .AND. nstop == 0 ) 131 #if defined key_mpp_mpi 136 132 137 ncom_stp = istp 133 IF ( istp == ( nit000 + 1 ) ) elapsed_time = MPI_Wtime() 134 IF ( istp == nitend ) elapsed_time = MPI_Wtime() - elapsed_time 135 #endif 138 IF( ln_timing ) THEN 139 zstptiming = MPI_Wtime() 140 IF ( istp == ( nit000 + 1 ) ) elapsed_time = zstptiming 141 IF ( istp == nitend ) elapsed_time = zstptiming - elapsed_time 142 ENDIF 143 136 144 CALL stp ( istp ) 137 145 istp = istp + 1 146 147 IF( lwp .AND. ln_timing ) WRITE(numtime,*) 'timing step ', istp-1, ' : ', MPI_Wtime() - zstptiming 148 138 149 END DO 139 150 ! … … 305 316 WRITE(numout,*) " ) ) \) |`\ \) '. \ ( ( " 306 317 WRITE(numout,*) " ( ( \_/ '-._\ ) ) " 307 WRITE(numout,*) " ) ) jgs `( ( "318 WRITE(numout,*) " ) ) jgs ` ( ( " 308 319 WRITE(numout,*) " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " 309 320 WRITE(numout,*) … … 355 366 ! 356 367 ! ! General initialization 357 IF( ln_timing ) CALL timing_init ! timing368 IF( ln_timing ) CALL timing_init ( 'timing_sas.output' ) 358 369 IF( ln_timing ) CALL timing_start( 'nemo_init') 359 370 … … 367 378 & CALL prt_ctl_init ! Print control 368 379 380 IF( ln_rstart ) CALL rst_read_open 369 381 CALL day_init ! model calendar (using both namelist and restart infos) 370 IF( ln_rstart ) CALL rst_read_open 371 382 383 #if defined key_agrif 384 uu(:,:,:,:) = 0.0_wp ; vv(:,:,:,:) = 0.0_wp ; ts(:,:,:,:,:) = 0.0_wp ! needed for interp done at initialization phase 385 #endif 372 386 ! ! external forcing 373 387 CALL sbc_init( Nbb, Nnn, Naa ) ! Forcings : surface module … … 480 494 ierr = dia_wri_alloc() 481 495 ierr = ierr + dom_oce_alloc() ! ocean domain 482 ierr = ierr + oce_alloc () ! (ts n...) needed for agrif and/or SI3 and bdy496 ierr = ierr + oce_alloc () ! (ts...) needed for agrif and/or SI3 and bdy 483 497 ierr = ierr + bdy_oce_alloc() ! bdy masks (incl. initialization) 484 498 ! -
NEMO/branches/2020/dev_r13296_HPC-07_mocavero_mpi3/src/SAS/stpctl.F90
r13136 r13571 20 20 USE dom_oce ! ocean space and time domain variables 21 21 USE ice , ONLY : vt_i, u_ice, tm_i 22 USE phycst , ONLY : rt0 23 USE sbc_oce , ONLY : lk_oasis 22 24 ! 23 25 USE diawri ! Standard run outputs (dia_wri_state routine) … … 48 50 !! 49 51 !! ** Method : - Save the time step in numstp 50 !! - Print it each 50 time steps51 52 !! - Stop the run IF problem encountered by setting nstop > 0 52 53 !! Problems checked: ice thickness maximum > 100 m … … 85 86 ENDIF 86 87 ! ! open time.step ascii file, done only by 1st subdomain 87 IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 88 IF( lk_oasis ) THEN ; clname = 'time_sas.step' 89 ELSE ; clname = 'time.step' 90 ENDIF 91 IF( lwm ) CALL ctl_opn( numstp, clname, 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 88 92 ! 89 93 IF( ll_wrtruns ) THEN 94 IF( lk_oasis ) THEN ; clname = 'run_sas.stat' 95 ELSE ; clname = 'run.stat' 96 ENDIF 90 97 ! ! open run.stat ascii file, done only by 1st subdomain 91 CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )98 CALL ctl_opn( numrun, clname, 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 92 99 ! ! open run.stat.nc netcdf file, done only by 1st subdomain 93 clname = 'run.stat.nc'100 clname = TRIM(clname)//'.nc' 94 101 IF( .NOT. Agrif_Root() ) clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 95 102 istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, nrunid ) … … 111 118 ! !== test of local extrema ==! 112 119 ! !== done by all processes at every time step ==! 113 llmsk(:,:) = tmask(:,:,1) == 1._wp 120 ! 121 llmsk( 1:Nis1,:) = .FALSE. ! exclude halos from the checked region 122 llmsk(Nie1: jpi,:) = .FALSE. 123 llmsk(:, 1:Njs1) = .FALSE. 124 llmsk(:,Nje1: jpj) = .FALSE. 125 ! 126 llmsk(Nis0:Nie0,Njs0:Nje0) = tmask(Nis0:Nie0,Njs0:Nje0,1) == 1._wp ! test only the inner domain 114 127 IF( COUNT( llmsk(:,:) ) > 0 ) THEN ! avoid huge values sent back for land processors... 115 zmax(1) = MAXVAL( vt_i (:,:) 116 zmax(2) = MAXVAL( ABS( u_ice(:,:) ) 117 zmax(3) = MAXVAL( -tm_i (:,:) + 273.15_wp, mask = llmsk ) ! min ice temperature128 zmax(1) = MAXVAL( vt_i (:,:) , mask = llmsk ) ! max ice thickness 129 zmax(2) = MAXVAL( ABS( u_ice(:,:) ) , mask = llmsk ) ! max ice velocity (zonal only) 130 zmax(3) = MAXVAL( -tm_i (:,:) + rt0, mask = llmsk ) ! min ice temperature (in degC) 118 131 ELSE 119 132 IF( ll_colruns ) THEN ! default value: must not be kept when calling mpp_max -> must be as small as possible … … 154 167 IF( lwm .AND. kt /= nitend ) istatus = NF90_CLOSE(nrunid) 155 168 ! get global loc on the min/max 156 CALL mpp_maxloc( 'stpctl', vt_i(:,:) , tmask(:,:,1), zzz, iloc(1:2,1) ) ! mpp_maxloc ok if mask = F157 CALL mpp_maxloc( 'stpctl',ABS( u_ice(:,:) ) , tmask(:,:,1), zzz, iloc(1:2,2) )158 CALL mpp_minloc( 'stpctl', tm_i(:,:) - 273.15_wp, tmask(:,:,1), zzz, iloc(1:2,3) )169 CALL mpp_maxloc( 'stpctl', vt_i(:,:) , llmsk, zzz, iloc(1:2,1) ) ! mpp_maxloc ok if mask = F 170 CALL mpp_maxloc( 'stpctl',ABS( u_ice(:,:) ) , llmsk, zzz, iloc(1:2,2) ) 171 CALL mpp_minloc( 'stpctl', tm_i(:,:) - rt0, llmsk, zzz, iloc(1:2,3) ) 159 172 ! find which subdomain has the max. 160 173 iareamin(:) = jpnij+1 ; iareamax(:) = 0 ; iareasum(:) = 0 … … 169 182 ELSE ! find local min and max locations: 170 183 ! if we are here, this means that the subdomain contains some oce points -> no need to test the mask used in maxloc 171 iloc(1:2,1) = MAXLOC( vt_i(:,:) , mask = llmsk ) + (/ nimpp - 1, njmpp - 1/) 172 iloc(1:2,2) = MAXLOC( ABS( u_ice(:,:) ) , mask = llmsk ) + (/ nimpp - 1, njmpp - 1/) 173 iloc(1:2,3) = MINLOC( tm_i(:,:) - 273.15_wp, mask = llmsk ) + (/ nimpp - 1, njmpp - 1/) 184 iloc(1:2,1) = MAXLOC( vt_i(:,:) , mask = llmsk ) 185 iloc(1:2,2) = MAXLOC( ABS( u_ice(:,:) ) , mask = llmsk ) 186 iloc(1:2,3) = MINLOC( tm_i(:,:) - rt0, mask = llmsk ) 187 DO ji = 1, 3 ! local domain indices ==> global domain indices, excluding halos 188 iloc(1:2,ji) = (/ mig0(iloc(1,ji)), mjg0(iloc(2,ji)) /) 189 END DO 174 190 iareamin(:) = narea ; iareamax(:) = narea ; iareasum(:) = 1 ! this is local information 175 191 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.