[3] | 1 | MODULE stpctl |
---|
[1489] | 2 | !!====================================================================== |
---|
[3] | 3 | !! *** MODULE stpctl *** |
---|
| 4 | !! Ocean run control : gross check of the ocean time stepping |
---|
[1489] | 5 | !!====================================================================== |
---|
| 6 | !! History : OPA ! 1991-03 (G. Madec) Original code |
---|
| 7 | !! 6.0 ! 1992-06 (M. Imbard) |
---|
| 8 | !! 8.0 ! 1997-06 (A.M. Treguier) |
---|
| 9 | !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module |
---|
| 10 | !! 2.0 ! 2009-07 (G. Madec) Add statistic for time-spliting |
---|
[9019] | 11 | !! 3.7 ! 2016-09 (G. Madec) Remove solver |
---|
| 12 | !! 4.0 ! 2017-04 (G. Madec) regroup global communications |
---|
[1489] | 13 | !!---------------------------------------------------------------------- |
---|
[3] | 14 | |
---|
| 15 | !!---------------------------------------------------------------------- |
---|
| 16 | !! stp_ctl : Control the run |
---|
| 17 | !!---------------------------------------------------------------------- |
---|
| 18 | USE oce ! ocean dynamics and tracers variables |
---|
| 19 | USE dom_oce ! ocean space and time domain variables |
---|
[6140] | 20 | USE c1d ! 1D vertical configuration |
---|
[9210] | 21 | USE diawri ! Standard run outputs (dia_wri_state routine) |
---|
[6140] | 22 | ! |
---|
[3] | 23 | USE in_out_manager ! I/O manager |
---|
| 24 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 25 | USE lib_mpp ! distributed memory computing |
---|
[10364] | 26 | USE zdf_oce , ONLY : ln_zad_Aimp ! ocean vertical physics variables |
---|
[9210] | 27 | USE wet_dry, ONLY : ll_wd, ssh_ref ! reference depth for negative bathy |
---|
[3] | 28 | |
---|
[15371] | 29 | USE lib_fortran ! Fortran utilities |
---|
[9441] | 30 | USE netcdf ! NetCDF library |
---|
[3] | 31 | IMPLICIT NONE |
---|
| 32 | PRIVATE |
---|
| 33 | |
---|
| 34 | PUBLIC stp_ctl ! routine called by step.F90 |
---|
[9441] | 35 | |
---|
[10364] | 36 | INTEGER :: idrun, idtime, idssh, idu, ids1, ids2, idt1, idt2, idc1, idw1, istatus |
---|
[3] | 37 | !!---------------------------------------------------------------------- |
---|
[9598] | 38 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[1489] | 39 | !! $Id$ |
---|
[10068] | 40 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[1489] | 41 | !!---------------------------------------------------------------------- |
---|
[3] | 42 | CONTAINS |
---|
| 43 | |
---|
[12859] | 44 | SUBROUTINE stp_ctl( kt ) |
---|
[3] | 45 | !!---------------------------------------------------------------------- |
---|
| 46 | !! *** ROUTINE stp_ctl *** |
---|
| 47 | !! |
---|
| 48 | !! ** Purpose : Control the run |
---|
| 49 | !! |
---|
| 50 | !! ** Method : - Save the time step in numstp |
---|
| 51 | !! - Print it each 50 time steps |
---|
[12859] | 52 | !! - Stop the run IF problem encountered by setting nstop > 0 |
---|
[10425] | 53 | !! Problems checked: |ssh| maximum larger than 10 m |
---|
[9019] | 54 | !! |U| maximum larger than 10 m/s |
---|
| 55 | !! negative sea surface salinity |
---|
[3] | 56 | !! |
---|
[9019] | 57 | !! ** Actions : "time.step" file = last ocean time-step |
---|
| 58 | !! "run.stat" file = run statistics |
---|
[12859] | 59 | !! nstop indicator sheared among all local domain |
---|
[3] | 60 | !!---------------------------------------------------------------------- |
---|
[6140] | 61 | INTEGER, INTENT(in ) :: kt ! ocean time-step index |
---|
[1489] | 62 | !! |
---|
[10425] | 63 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
[12859] | 64 | INTEGER, DIMENSION(3) :: ih, iu, is1, is2 ! min/max loc indices |
---|
| 65 | INTEGER, DIMENSION(9) :: iareasum, iareamin, iareamax |
---|
[10425] | 66 | REAL(wp) :: zzz ! local real |
---|
[12859] | 67 | REAL(wp), DIMENSION(9) :: zmax, zmaxlocal |
---|
[10570] | 68 | LOGICAL :: ll_wrtstp, ll_colruns, ll_wrtruns |
---|
[13137] | 69 | LOGICAL, DIMENSION(jpi,jpj,jpk) :: llmsk |
---|
[9565] | 70 | CHARACTER(len=20) :: clname |
---|
[3] | 71 | !!---------------------------------------------------------------------- |
---|
[12859] | 72 | IF( nstop > 0 .AND. ngrdstop > -1 ) RETURN ! stpctl was already called by a child grid |
---|
[6140] | 73 | ! |
---|
[12859] | 74 | ll_wrtstp = ( MOD( kt-nit000, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) |
---|
| 75 | ll_colruns = ll_wrtstp .AND. sn_cfctl%l_runstat .AND. jpnij > 1 |
---|
| 76 | ll_wrtruns = ( ll_colruns .OR. jpnij == 1 ) .AND. lwm |
---|
| 77 | ! |
---|
| 78 | IF( kt == nit000 ) THEN |
---|
| 79 | ! |
---|
| 80 | IF( lwp ) THEN |
---|
| 81 | WRITE(numout,*) |
---|
| 82 | WRITE(numout,*) 'stp_ctl : time-stepping control' |
---|
| 83 | WRITE(numout,*) '~~~~~~~' |
---|
| 84 | ENDIF |
---|
[9019] | 85 | ! ! open time.step file |
---|
[10425] | 86 | IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) |
---|
[10570] | 87 | ! ! open run.stat file(s) at start whatever |
---|
| 88 | ! ! the value of sn_cfctl%ptimincr |
---|
[12859] | 89 | IF( ll_wrtruns ) THEN |
---|
[10425] | 90 | CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) |
---|
[9565] | 91 | clname = 'run.stat.nc' |
---|
| 92 | IF( .NOT. Agrif_Root() ) clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) |
---|
| 93 | istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, idrun ) |
---|
[9441] | 94 | istatus = NF90_DEF_DIM( idrun, 'time', NF90_UNLIMITED, idtime ) |
---|
| 95 | istatus = NF90_DEF_VAR( idrun, 'abs_ssh_max', NF90_DOUBLE, (/ idtime /), idssh ) |
---|
[9808] | 96 | istatus = NF90_DEF_VAR( idrun, 'abs_u_max', NF90_DOUBLE, (/ idtime /), idu ) |
---|
| 97 | istatus = NF90_DEF_VAR( idrun, 's_min', NF90_DOUBLE, (/ idtime /), ids1 ) |
---|
| 98 | istatus = NF90_DEF_VAR( idrun, 's_max', NF90_DOUBLE, (/ idtime /), ids2 ) |
---|
[10364] | 99 | istatus = NF90_DEF_VAR( idrun, 't_min', NF90_DOUBLE, (/ idtime /), idt1 ) |
---|
| 100 | istatus = NF90_DEF_VAR( idrun, 't_max', NF90_DOUBLE, (/ idtime /), idt2 ) |
---|
| 101 | IF( ln_zad_Aimp ) THEN |
---|
| 102 | istatus = NF90_DEF_VAR( idrun, 'abs_wi_max', NF90_DOUBLE, (/ idtime /), idw1 ) |
---|
[11407] | 103 | istatus = NF90_DEF_VAR( idrun, 'Cf_max', NF90_DOUBLE, (/ idtime /), idc1 ) |
---|
[10364] | 104 | ENDIF |
---|
[9441] | 105 | istatus = NF90_ENDDEF(idrun) |
---|
| 106 | ENDIF |
---|
[3] | 107 | ENDIF |
---|
[6140] | 108 | ! |
---|
[10570] | 109 | IF(lwm .AND. ll_wrtstp) THEN !== current time step ==! ("time.step" file) |
---|
[9019] | 110 | WRITE ( numstp, '(1x, i8)' ) kt |
---|
| 111 | REWIND( numstp ) |
---|
[3] | 112 | ENDIF |
---|
[6140] | 113 | ! |
---|
[9019] | 114 | ! !== test of extrema ==! |
---|
[13137] | 115 | ! |
---|
| 116 | ! define zmax default value. needed for land processors |
---|
| 117 | IF( ll_colruns ) THEN ! default value: must not be kept when calling mpp_max -> must be as small as possible |
---|
| 118 | zmax(:) = -HUGE(1._wp) |
---|
| 119 | ELSE ! default value: must not give true for any of the tests bellow (-> avoid manipulating HUGE...) |
---|
| 120 | zmax(:) = 0._wp |
---|
| 121 | zmax(3) = -1._wp ! avoid salinity minimum at 0. |
---|
| 122 | ENDIF |
---|
| 123 | ! |
---|
[9023] | 124 | IF( ll_wd ) THEN |
---|
[9210] | 125 | zmax(1) = MAXVAL( ABS( sshn(:,:) + ssh_ref*tmask(:,:,1) ) ) ! ssh max |
---|
[9023] | 126 | ELSE |
---|
[9210] | 127 | zmax(1) = MAXVAL( ABS( sshn(:,:) ) ) ! ssh max |
---|
[9023] | 128 | ENDIF |
---|
[9019] | 129 | zmax(2) = MAXVAL( ABS( un(:,:,:) ) ) ! velocity max (zonal only) |
---|
[13137] | 130 | llmsk(:,:,:) = tmask(:,:,:) == 1._wp |
---|
| 131 | IF( COUNT( llmsk(:,:,:) ) > 0 ) THEN ! avoid huge values sent back for land processors... |
---|
| 132 | zmax(3) = MAXVAL( -tsn(:,:,:,jp_sal) , mask = llmsk ) ! minus salinity max |
---|
| 133 | zmax(4) = MAXVAL( tsn(:,:,:,jp_sal) , mask = llmsk ) ! salinity max |
---|
| 134 | IF( ll_colruns .OR. jpnij == 1 ) THEN ! following variables are used only in the netcdf file |
---|
| 135 | zmax(5) = MAXVAL( -tsn(:,:,:,jp_tem) , mask = llmsk ) ! minus temperature max |
---|
| 136 | zmax(6) = MAXVAL( tsn(:,:,:,jp_tem) , mask = llmsk ) ! temperature max |
---|
| 137 | IF( ln_zad_Aimp ) THEN |
---|
| 138 | zmax(9) = MAXVAL( Cu_adv(:,:,:) , mask = llmsk ) ! partitioning coeff. max |
---|
| 139 | llmsk(:,:,:) = wmask(:,:,:) == 1._wp |
---|
| 140 | IF( COUNT( llmsk(:,:,:) ) > 0 ) THEN ! avoid huge values sent back for land processors... |
---|
| 141 | zmax(8) = MAXVAL( ABS( wi(:,:,:) ) , mask = wmask(:,:,:) == 1._wp ) ! implicit vertical vel. max |
---|
| 142 | ENDIF |
---|
| 143 | ENDIF |
---|
[12859] | 144 | ENDIF |
---|
| 145 | ENDIF |
---|
[10364] | 146 | zmax(7) = REAL( nstop , wp ) ! stop indicator |
---|
[1489] | 147 | ! |
---|
[10570] | 148 | IF( ll_colruns ) THEN |
---|
[12859] | 149 | zmaxlocal(:) = zmax(:) |
---|
[10425] | 150 | CALL mpp_max( "stpctl", zmax ) ! max over the global domain |
---|
[10364] | 151 | nstop = NINT( zmax(7) ) ! nstop indicator sheared among all local domains |
---|
[9210] | 152 | ENDIF |
---|
[10425] | 153 | ! !== run statistics ==! ("run.stat" files) |
---|
[10570] | 154 | IF( ll_wrtruns ) THEN |
---|
[10425] | 155 | WRITE(numrun,9500) kt, zmax(1), zmax(2), -zmax(3), zmax(4) |
---|
| 156 | istatus = NF90_PUT_VAR( idrun, idssh, (/ zmax(1)/), (/kt/), (/1/) ) |
---|
| 157 | istatus = NF90_PUT_VAR( idrun, idu, (/ zmax(2)/), (/kt/), (/1/) ) |
---|
| 158 | istatus = NF90_PUT_VAR( idrun, ids1, (/-zmax(3)/), (/kt/), (/1/) ) |
---|
| 159 | istatus = NF90_PUT_VAR( idrun, ids2, (/ zmax(4)/), (/kt/), (/1/) ) |
---|
| 160 | istatus = NF90_PUT_VAR( idrun, idt1, (/-zmax(5)/), (/kt/), (/1/) ) |
---|
| 161 | istatus = NF90_PUT_VAR( idrun, idt2, (/ zmax(6)/), (/kt/), (/1/) ) |
---|
| 162 | IF( ln_zad_Aimp ) THEN |
---|
| 163 | istatus = NF90_PUT_VAR( idrun, idw1, (/ zmax(8)/), (/kt/), (/1/) ) |
---|
| 164 | istatus = NF90_PUT_VAR( idrun, idc1, (/ zmax(9)/), (/kt/), (/1/) ) |
---|
| 165 | ENDIF |
---|
[12859] | 166 | IF( kt == nitend ) istatus = NF90_CLOSE(idrun) |
---|
[10425] | 167 | END IF |
---|
| 168 | ! !== error handling ==! |
---|
[12859] | 169 | IF( zmax(1) > 20._wp .OR. & ! too large sea surface height ( > 20 m ) |
---|
[9808] | 170 | & zmax(2) > 10._wp .OR. & ! too large velocity ( > 10 m/s) |
---|
| 171 | & zmax(3) >= 0._wp .OR. & ! negative or zero sea surface salinity |
---|
| 172 | & zmax(4) >= 100._wp .OR. & ! too large sea surface salinity ( > 100 ) |
---|
| 173 | & zmax(4) < 0._wp .OR. & ! too large sea surface salinity (keep this line for sea-ice) |
---|
[12859] | 174 | & ISNAN( zmax(1) + zmax(2) + zmax(3) ) .OR. & ! NaN encounter in the tests |
---|
| 175 | & ABS( zmax(1) + zmax(2) + zmax(3) ) > HUGE(1._wp) ) THEN ! Infinity encounter in the tests |
---|
| 176 | IF( ll_colruns ) THEN |
---|
| 177 | ! first: close the netcdf file, so we can read it |
---|
| 178 | IF( lwm .AND. kt /= nitend ) istatus = NF90_CLOSE(idrun) |
---|
| 179 | CALL mpp_maxloc( 'stpctl', ABS(sshn) , ssmask(:,:) , zzz, ih(1:2) ) ; ih(3) = 0 |
---|
[10425] | 180 | CALL mpp_maxloc( 'stpctl', ABS(un) , umask (:,:,:), zzz, iu ) |
---|
| 181 | CALL mpp_minloc( 'stpctl', tsn(:,:,:,jp_sal), tmask (:,:,:), zzz, is1 ) |
---|
| 182 | CALL mpp_maxloc( 'stpctl', tsn(:,:,:,jp_sal), tmask (:,:,:), zzz, is2 ) |
---|
[12859] | 183 | ! find which subdomain has the max. |
---|
| 184 | iareamin(:) = jpnij+1 ; iareamax(:) = 0 ; iareasum(:) = 0 |
---|
| 185 | DO ji = 1, 9 |
---|
| 186 | IF( zmaxlocal(ji) == zmax(ji) ) THEN |
---|
| 187 | iareamin(ji) = narea ; iareamax(ji) = narea ; iareasum(ji) = 1 |
---|
| 188 | ENDIF |
---|
| 189 | END DO |
---|
| 190 | CALL mpp_min( "stpctl", iareamin ) ! min over the global domain |
---|
| 191 | CALL mpp_max( "stpctl", iareamax ) ! max over the global domain |
---|
| 192 | CALL mpp_sum( "stpctl", iareasum ) ! sum over the global domain |
---|
[7852] | 193 | ELSE |
---|
[12859] | 194 | ih(1:2)= MAXLOC( ABS( sshn(:,:) ) ) + (/ nimpp - 1, njmpp - 1 /) ; ih(3) = 0 |
---|
[10425] | 195 | iu(:) = MAXLOC( ABS( un (:,:,:) ) ) + (/ nimpp - 1, njmpp - 1, 0 /) |
---|
| 196 | is1(:) = MINLOC( tsn(:,:,:,jp_sal), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) |
---|
| 197 | is2(:) = MAXLOC( tsn(:,:,:,jp_sal), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) |
---|
[12859] | 198 | iareamin(:) = narea ; iareamax(:) = narea ; iareasum(:) = 1 ! this is local information |
---|
[7852] | 199 | ENDIF |
---|
[12859] | 200 | ! |
---|
[10425] | 201 | WRITE(ctmp1,*) ' stp_ctl: |ssh| > 20 m or |U| > 10 m/s or S <= 0 or S >= 100 or NaN encounter in the tests' |
---|
[12859] | 202 | CALL wrt_line(ctmp2, kt, ' |ssh| max ', zmax(1), ih , iareasum(1), iareamin(1), iareamax(1) ) |
---|
| 203 | CALL wrt_line(ctmp3, kt, ' |U| max ', zmax(2), iu , iareasum(2), iareamin(2), iareamax(2) ) |
---|
| 204 | CALL wrt_line(ctmp4, kt, ' Sal min ', - zmax(3), is1, iareasum(3), iareamin(3), iareamax(3) ) |
---|
| 205 | CALL wrt_line(ctmp5, kt, ' Sal max ', zmax(4), is2, iareasum(4), iareamin(4), iareamax(4) ) |
---|
| 206 | IF( Agrif_Root() ) THEN |
---|
| 207 | WRITE(ctmp6,*) ' ===> output of last computed fields in output.abort* files' |
---|
[10425] | 208 | ELSE |
---|
[12859] | 209 | WRITE(ctmp6,*) ' ===> output of last computed fields in '//TRIM(Agrif_CFixed())//'_output.abort* files' |
---|
[7852] | 210 | ENDIF |
---|
[9210] | 211 | ! |
---|
[12859] | 212 | CALL dia_wri_state( 'output.abort' ) ! create an output.abort file |
---|
| 213 | ! |
---|
| 214 | IF( ll_colruns .or. jpnij == 1 ) THEN ! all processes synchronized -> use lwp to print in opened ocean.output files |
---|
[13116] | 215 | IF(lwp) THEN ; CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 ) |
---|
| 216 | ELSE ; nstop = MAX(1, nstop) ! make sure nstop > 0 (automatically done when calling ctl_stop) |
---|
| 217 | ENDIF |
---|
[12859] | 218 | ELSE ! only mpi subdomains with errors are here -> STOP now |
---|
| 219 | CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 ) |
---|
| 220 | ENDIF |
---|
| 221 | ! |
---|
[7852] | 222 | ENDIF |
---|
[10425] | 223 | ! |
---|
[13116] | 224 | IF( nstop > 0 ) THEN ! an error was detected and we did not abort yet... |
---|
| 225 | ngrdstop = Agrif_Fixed() ! store which grid got this error |
---|
| 226 | IF( .NOT. ll_colruns .AND. jpnij > 1 ) CALL ctl_stop( 'STOP' ) ! we must abort here to avoid MPI deadlock |
---|
| 227 | ENDIF |
---|
| 228 | ! |
---|
[9808] | 229 | 9500 FORMAT(' it :', i8, ' |ssh|_max: ', D23.16, ' |U|_max: ', D23.16,' S_min: ', D23.16,' S_max: ', D23.16) |
---|
[7852] | 230 | ! |
---|
[3] | 231 | END SUBROUTINE stp_ctl |
---|
| 232 | |
---|
[12859] | 233 | |
---|
| 234 | SUBROUTINE wrt_line( cdline, kt, cdprefix, pval, kloc, ksum, kmin, kmax ) |
---|
| 235 | !!---------------------------------------------------------------------- |
---|
| 236 | !! *** ROUTINE wrt_line *** |
---|
| 237 | !! |
---|
| 238 | !! ** Purpose : write information line |
---|
| 239 | !! |
---|
| 240 | !!---------------------------------------------------------------------- |
---|
| 241 | CHARACTER(len=*), INTENT( out) :: cdline |
---|
| 242 | CHARACTER(len=*), INTENT(in ) :: cdprefix |
---|
| 243 | REAL(wp), INTENT(in ) :: pval |
---|
| 244 | INTEGER, DIMENSION(3), INTENT(in ) :: kloc |
---|
| 245 | INTEGER, INTENT(in ) :: kt, ksum, kmin, kmax |
---|
| 246 | ! |
---|
| 247 | CHARACTER(len=80) :: clsuff |
---|
| 248 | CHARACTER(len=9 ) :: clkt, clsum, clmin, clmax |
---|
| 249 | CHARACTER(len=9 ) :: cli, clj, clk |
---|
| 250 | CHARACTER(len=1 ) :: clfmt |
---|
| 251 | CHARACTER(len=4 ) :: cl4 ! needed to be able to compile with Agrif, I don't know why |
---|
| 252 | INTEGER :: ifmtk |
---|
| 253 | !!---------------------------------------------------------------------- |
---|
| 254 | WRITE(clkt , '(i9)') kt |
---|
| 255 | |
---|
| 256 | WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij ,wp))) + 1 ! how many digits to we need to write ? (we decide max = 9) |
---|
| 257 | !!! WRITE(clsum, '(i'//clfmt//')') ksum ! this is creating a compilation error with AGRIF |
---|
| 258 | cl4 = '(i'//clfmt//')' ; WRITE(clsum, cl4) ksum |
---|
[13010] | 259 | WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1 ! how many digits to we need to write ? (we decide max = 9) |
---|
[12859] | 260 | cl4 = '(i'//clfmt//')' ; WRITE(clmin, cl4) kmin-1 |
---|
| 261 | WRITE(clmax, cl4) kmax-1 |
---|
| 262 | ! |
---|
| 263 | WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpiglo,wp))) + 1 ! how many digits to we need to write jpiglo? (we decide max = 9) |
---|
| 264 | cl4 = '(i'//clfmt//')' ; WRITE(cli, cl4) kloc(1) ! this is ok with AGRIF |
---|
| 265 | WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpjglo,wp))) + 1 ! how many digits to we need to write jpjglo? (we decide max = 9) |
---|
| 266 | cl4 = '(i'//clfmt//')' ; WRITE(clj, cl4) kloc(2) ! this is ok with AGRIF |
---|
| 267 | ! |
---|
| 268 | IF( ksum == 1 ) THEN ; WRITE(clsuff,9100) TRIM(clmin) |
---|
| 269 | ELSE ; WRITE(clsuff,9200) TRIM(clsum), TRIM(clmin), TRIM(clmax) |
---|
| 270 | ENDIF |
---|
| 271 | IF(kloc(3) == 0) THEN |
---|
| 272 | ifmtk = INT(LOG10(REAL(jpk,wp))) + 1 ! how many digits to we need to write jpk? (we decide max = 9) |
---|
| 273 | clk = REPEAT(' ', ifmtk) ! create the equivalent in blank string |
---|
| 274 | WRITE(cdline,9300) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj), clk(1:ifmtk), TRIM(clsuff) |
---|
| 275 | ELSE |
---|
| 276 | WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpk,wp))) + 1 ! how many digits to we need to write jpk? (we decide max = 9) |
---|
| 277 | !!! WRITE(clk, '(i'//clfmt//')') kloc(3) ! this is creating a compilation error with AGRIF |
---|
| 278 | cl4 = '(i'//clfmt//')' ; WRITE(clk, cl4) kloc(3) ! this is ok with AGRIF |
---|
| 279 | WRITE(cdline,9400) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj), TRIM(clk), TRIM(clsuff) |
---|
| 280 | ENDIF |
---|
| 281 | ! |
---|
| 282 | 9100 FORMAT('MPI rank ', a) |
---|
| 283 | 9200 FORMAT('found in ', a, ' MPI tasks, spread out among ranks ', a, ' to ', a) |
---|
| 284 | 9300 FORMAT('kt ', a, ' ', a, ' ', 1pg11.4, ' at i j ', a, ' ', a, ' ', a, ' ', a) |
---|
| 285 | 9400 FORMAT('kt ', a, ' ', a, ' ', 1pg11.4, ' at i j k ', a, ' ', a, ' ', a, ' ', a) |
---|
| 286 | ! |
---|
| 287 | END SUBROUTINE wrt_line |
---|
| 288 | |
---|
| 289 | |
---|
[3] | 290 | !!====================================================================== |
---|
| 291 | END MODULE stpctl |
---|