Changeset 14037 for NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/tests/STATION_ASF/MY_SRC/stpctl.F90
- Timestamp:
- 2020-12-03T12:20:38+01:00 (3 years ago)
- Location:
- NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG
- Property svn:externals
-
old new 8 8 9 9 # SETTE 10 ^/utils/CI/sette @13292sette10 ^/utils/CI/sette_wave@13990 sette
-
- Property svn:externals
-
NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/tests/STATION_ASF/MY_SRC/stpctl.F90
r13136 r14037 47 47 !! 48 48 !! ** Method : - Save the time step in numstp 49 !! - Print it each 50 time steps50 49 !! - Stop the run IF problem encountered by setting nstop > 0 51 50 !! Problems checked: wind stress module max larger than 5 N/m^2 … … 66 65 REAL(wp) :: zzz ! local real 67 66 REAL(wp), DIMENSION(4) :: zmax, zmaxlocal 68 LOGICAL :: ll_wrtstp, ll_colruns, ll_wrtruns 67 LOGICAL :: ll_wrtstp, ll_colruns, ll_wrtruns, ll_0oce 69 68 LOGICAL, DIMENSION(jpi,jpj) :: llmsk 70 69 CHARACTER(len=20) :: clname … … 110 109 ! !== test of local extrema ==! 111 110 ! !== done by all processes at every time step ==! 112 llmsk(:,:) = tmask(:,:,1) == 1._wp 113 IF( COUNT( llmsk(:,:) ) > 0 ) THEN ! avoid huge values sent back for land processors... 114 zmax(1) = MAXVAL( taum(:,:) , mask = llmsk ) ! max wind stress module 115 zmax(2) = MAXVAL( ABS( qns(:,:) ) , mask = llmsk ) ! max non-solar heat flux 116 zmax(3) = MAXVAL( ABS( emp(:,:) ) , mask = llmsk ) ! max E-P 117 ELSE 118 IF( ll_colruns ) THEN ! default value: must not be kept when calling mpp_max -> must be as small as possible 119 zmax(1:3) = -HUGE(1._wp) 120 ELSE ! default value: must not give true for any of the tests bellow (-> avoid manipulating HUGE...) 121 zmax(1:3) = 0._wp 122 ENDIF 123 ENDIF 124 zmax(4) = REAL( nstop, wp ) ! stop indicator 111 ! 112 llmsk( 1:Nis1,:) = .FALSE. ! exclude halos from the checked region 113 llmsk(Nie1: jpi,:) = .FALSE. 114 llmsk(:, 1:Njs1) = .FALSE. 115 llmsk(:,Nje1: jpj) = .FALSE. 116 ! 117 llmsk(Nis0:Nie0,Njs0:Nje0) = tmask(Nis0:Nie0,Njs0:Nje0,1) == 1._wp ! test only the inner domain 118 ! 119 ll_0oce = .NOT. ANY( llmsk(:,:) ) ! no ocean point in the inner domain? 120 ! 121 zmax(1) = MAXVAL( taum(:,:) , mask = llmsk ) ! max wind stress module 122 zmax(2) = MAXVAL( ABS( qns(:,:) ), mask = llmsk ) ! max non-solar heat flux 123 zmax(3) = MAXVAL( ABS( emp(:,:) ), mask = llmsk ) ! max E-P 124 zmax(4) = REAL( nstop, wp ) ! stop indicator 125 ! 125 126 ! !== get global extrema ==! 126 127 ! !== done by all processes if writting run.stat ==! … … 129 130 CALL mpp_max( "stpctl", zmax ) ! max over the global domain 130 131 nstop = NINT( zmax(4) ) ! update nstop indicator (now sheared among all local domains) 131 ENDIF 132 ELSE 133 ! if no ocean point: MAXVAL returns -HUGE => we must overwrite this value to avoid error handling bellow. 134 IF( ll_0oce ) zmax(1:3) = 0._wp ! default "valid" values... 135 ENDIF 136 ! !== error handling ==! 132 137 ! !== write "run.stat" files ==! 133 138 ! !== done only by 1st subdomain at writting timestep ==! 134 139 IF( ll_wrtruns ) THEN 135 140 WRITE(numrun,9500) kt, zmax(1), zmax(2), zmax(3) 136 istatus = NF90_PUT_VAR( nrunid, nvarid(1), (/ zmax(1)/), (/kt/), (/1/) )137 istatus = NF90_PUT_VAR( nrunid, nvarid(2), (/ zmax(2)/), (/kt/), (/1/) )138 istatus = NF90_PUT_VAR( nrunid, nvarid(3), (/ zmax(3)/), (/kt/), (/1/) )141 DO ji = 1, 3 142 istatus = NF90_PUT_VAR( nrunid, nvarid(ji), (/zmax(ji)/), (/kt/), (/1/) ) 143 END DO 139 144 IF( kt == nitend ) istatus = NF90_CLOSE(nrunid) 140 145 END IF … … 153 158 IF( lwm .AND. kt /= nitend ) istatus = NF90_CLOSE(nrunid) 154 159 ! get global loc on the min/max 155 CALL mpp_maxloc( 'stpctl', taum(:,:) , tmask(:,:,1), zzz, iloc(1:2,1) ) ! mpp_maxloc ok if mask = F156 CALL mpp_maxloc( 'stpctl',ABS( qns(:,:) ), tmask(:,:,1), zzz, iloc(1:2,2) )157 CALL mpp_minloc( 'stpctl',ABS( emp(:,:) ), tmask(:,:,1), zzz, iloc(1:2,3) )160 CALL mpp_maxloc( 'stpctl', taum(:,:) , llmsk, zzz, iloc(1:2,1) ) ! mpp_maxloc ok if mask = F 161 CALL mpp_maxloc( 'stpctl',ABS( qns(:,:) ), llmsk, zzz, iloc(1:2,2) ) 162 CALL mpp_minloc( 'stpctl',ABS( emp(:,:) ), llmsk, zzz, iloc(1:2,3) ) 158 163 ! find which subdomain has the max. 159 164 iareamin(:) = jpnij+1 ; iareamax(:) = 0 ; iareasum(:) = 0 … … 168 173 ELSE ! find local min and max locations: 169 174 ! if we are here, this means that the subdomain contains some oce points -> no need to test the mask used in maxloc 170 iloc(1:2,1) = MAXLOC( taum(:,:) , mask = llmsk ) + (/ nimpp - 1, njmpp - 1/) 171 iloc(1:2,2) = MAXLOC( ABS( qns(:,:) ), mask = llmsk ) + (/ nimpp - 1, njmpp - 1/) 172 iloc(1:2,3) = MINLOC( ABS( emp(:,:) ), mask = llmsk ) + (/ nimpp - 1, njmpp - 1/) 175 iloc(1:2,1) = MAXLOC( taum(:,:) , mask = llmsk ) 176 iloc(1:2,2) = MAXLOC( ABS( qns(:,:) ), mask = llmsk ) 177 iloc(1:2,3) = MINLOC( ABS( emp(:,:) ), mask = llmsk ) 178 DO ji = 1, 3 ! local domain indices ==> global domain indices, excluding halos 179 iloc(1:2,ji) = (/ mig0(iloc(1,ji)), mjg0(iloc(2,ji)) /) 180 END DO 173 181 iareamin(:) = narea ; iareamax(:) = narea ; iareasum(:) = 1 ! this is local information 174 182 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.