Re: [swanmodel-users] How to merge SWAN BLOCK output from MPI a run
Brought to you by:
mzijlema
|
From: Jianting Du <jia...@gm...> - 2016-12-02 10:17:44
|
The problem is temporary solved, but I think there may be better solutions.
I summarize my solution here in case of others have the same problem.
I modified the SWAN code to make it a post-processing tool as follows (take
swan4110 for example):
In swmod1.ftn line number 514, add one varialbe:
514 INTEGER ITEST, ITRACE, LEVERR, MAXERR*, ICOL*
In swanpre1.ftn, between line 566 and 567, add one line:
566 ENDIF
* CALL ININTG ('ICOL', ICOL, 'STA', 0)*
567 CALL INKEYW ('STA', ' ')
In swanout1.ftn, between line 283 and 284, add one line:
283 & LOGACT)
* IF (ICOL .EQ. 1) GOTO 70*
284 IF (.NOT.LOGACT) THEN
In swanparll.ftn
line 4246 add:
4244! --- rewrite table output by means of collection of
4245 output locations
* IF( ICOL .NE. 1) THEN*
4247 IF ( RTYPE(1:3).EQ.'TAB' ) THEN
line 4269 add:
*4269 ENDIF*
4270 ! --- rewrite block output by means of collection of
process
In swanmain.ftn between line 663 and 664, add the following code:
662 CALL SWOUTP (AC2, SPCSIG, SPCD, COMPDA, XYTST,
663 & KGRPNT, XCGRID, YCGRID, OURQT )
*IF (ICOL .EQ. 1) THEN*
*! --- collect contents of individual process files for*
*! output requests in case of parallel computation*
* CALL SWSYNC*
* IF ( PARLL ) THEN*
* write(PRINTF,*) 'MXC,MYC:',MXC,MYC*
* write(PRINTF,*) 'INODE:',INODE
*
* ALLOCATE (BLKND(MXC*MYC))*
* BLKND = REAL(INODE)*
* IF ( IAMMASTER ) THEN*
* write(PRINTF,*) 'INODE,MXCGL,MYCGL:',INODE,MXCGL,MYCGL*
* ALLOCATE(BLKNDC(MXCGL*MYCGL))*
* BLKNDC = 0.*
* END IF*
* CALL SWCOLLECT ( BLKNDC, BLKND, .TRUE. )*
* IF (STPNOW()) RETURN*
* IF ( IAMMASTER ) THEN*
* CALL SWCOLOUT ( OURQT, BLKNDC )*
* DEALLOCATE(BLKNDC)*
* END IF*
* CALL SWSYNC*
* IF ( IAMMASTER ) stop*
* END IF*
* END IF*
664 ! CALL SWTSTO spiders (9)
665 IF (STPNOW()) RETURN
between line 1487 and 1488, add
1487 ITEST = 1
* ICOL = 0*
1488 INTES = 0
After these changes, recompile swan, there will be one more parameter added
to the INPUT file:
!
! / -> IJ < [i] [j] > | < [k] > \
! TEST [itest] [itrace] [*icol*] POINTS <
> &
! \ XY < [x] [y] > /
!
! PAR 'fname' S1D 'fname' S2D 'fname'
By default, icol=0, SWAN will run normally. If the simulation is crushed
and the *.mat files are not collected, run SWAN again with icol=1. Then
SWAN will not do any calculation and will only collect the *.mat files into
one file.
Best regards,
Jianting
On Fri, Nov 18, 2016 at 1:42 PM, Nikhil Garg <nik...@gm...>
wrote:
> i dont think it will work with .mat output. I think it will only work with
> fortran binary file. You might have to figure out how to concatenate matlab
> files yourself.
>
> On 18 November 2016 at 19:51, Jianting Du <jia...@gm...> wrote:
>
>> Thanks Nikhil,
>> I think hcat only works for the hotfiles which can be used as an initial
>> condition for the next simulation. Does it also work for the BLOCK output
>> files?
>> Best regards,
>> Jianting
>>
>> On Fri, Nov 18, 2016 at 12:04 PM, Nikhil Garg <nik...@gm...>
>> wrote:
>>
>>> have you checked out hcat, i think that is what you looking for.
>>>
>>> you might need to use the namelist file.
>>>
>>> On 18 November 2016 at 16:01, Jianting Du <jia...@gm...> wrote:
>>>
>>>> Dear all,
>>>>
>>>> I use SWAN on a Linux cluster. The BLOCK output during the simulation
>>>> are first saved separately as :
>>>> swan_HSIGN.mat-001
>>>> swan_HSIGN.mat-002
>>>> swan_HSIGN.mat-003
>>>> swan_HSIGN.mat-004
>>>> ...
>>>> swan_HSIGN.mat-040
>>>> In the end of the simulation, the results will merge together if SWAN
>>>> finished normally. However, my SWAN simulation was crashed at the end of
>>>> the simulation so that the separated results were not merged together. So I
>>>> cannot read it by Matlab. Is there any post processing tools to merge the
>>>> results?
>>>>
>>>> Thanks!
>>>> Jianting
>>>>
>>>> ------------------------------------------------------------
>>>> ------------------
>>>>
>>>> _______________________________________________
>>>> swanmodel-users mailing list
>>>> swa...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/swanmodel-users
>>>>
>>>>
>>>
>>>
>>> --
>>> Regards
>>>
>>> Nikhil
>>>
>>
>>
>
|