232 | | 10. In case of job chains, the sum array has to be written to the (binary) restart file (local filename BINOUT) in subroutine user_last_actions: |
233 | | |
234 | | IF ( ALLOCATED( u2_av ) ) THEN |
235 | | WRITE ( 14 ) 'u2_av '; WRITE ( 14 ) u2_av |
236 | | ENDIF |
237 | | |
238 | | Otherwise, the calculated time-average may be wrong. In the restart run, this quantity has to be read from the restart file by including the following code in subroutine user_read_restart_data: |
239 | | |
240 | | IF ( initializing_actions == 'read_restart_data' ) THEN |
241 | | READ ( 13 ) field_char |
242 | | DO WHILE ( TRIM( field_char ) /= '*** end user ***' ) |
243 | | |
244 | | SELECT CASE ( TRIM( field_char ) ) |
245 | | |
246 | | CASE ( 'u2_av' ) |
247 | | IF ( .NOT. ALLOCATED( u2_av ) ) THEN |
248 | | ALLOCATE( u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
249 | | ENDIF |
250 | | READ ( 13 ) tmp_3d |
251 | | u2_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
252 | | tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
253 | | |
254 | | CASE DEFAULT |
255 | | PRINT*, '+++ user_init: unknown variable named "', & |
256 | | TRIM( field_char ), '" found in' |
257 | | PRINT*, ' data from prior run on PE ', myid |
258 | | CALL local_stop |
259 | | |
260 | | END SELECT |
261 | | |
262 | | READ ( 13 ) field_char |
263 | | |
264 | | ENDDO |
265 | | ENDIF |
| 232 | 10. In case of job chains, the sum array has to be written to the (binary) restart file (local filename [../../iofiles#BINOUT BINOUT]) in subroutine [../int#user_last_actions user_last_actions]: |
| 233 | |
| 234 | {{{ IF ( ALLOCATED( u2_av ) ) THEN }}}\\ |
| 235 | {{{ WRITE ( 14 ) 'u2_av' }}}\\ |
| 236 | {{{ WRITE ( 14 ) u2_av }}}\\ |
| 237 | {{{ ENDIF }}}\\ |
| 238 | |
| 239 | Otherwise, the calculated time-average may be wrong. In the restart run, this quantity has to be read from the restart file by including the following code in subroutine [../#user_read_restart_data user_read_restart_data]: |
| 240 | |
| 241 | {{{ IF ( initializing_actions == 'read_restart_data' ) THEN |
| 242 | {{{ READ ( 13 ) field_char |
| 243 | {{{ DO WHILE ( TRIM( field_char ) /= '*** end user ***' ) |
| 244 | {{{ SELECT CASE ( TRIM( field_char ) ) |
| 245 | {{{ CASE ( 'u2_av' ) |
| 246 | {{{ IF ( .NOT. ALLOCATED( u2_av ) ) THEN |
| 247 | {{{ ALLOCATE( u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
| 248 | {{{ ENDIF |
| 249 | {{{ READ ( 13 ) tmp_3d |
| 250 | {{{ u2_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = & |
| 251 | {{{ tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1) |
| 252 | |
| 253 | {{{ CASE DEFAULT |
| 254 | {{{ PRINT*, '+++ user_init: unknown variable named "', & |
| 255 | {{{ TRIM( field_char ), '" found in' |
| 256 | {{{ PRINT*, ' data from prior run on PE ', myid |
| 257 | {{{ CALL local_stop |
| 258 | |
| 259 | {{{ END SELECT |
| 260 | |
| 261 | {{{ READ ( 13 ) field_char |
| 262 | |
| 263 | {{{ ENDDO |
| 264 | {{{ ENDIF |