/[MITgcm]/MITgcm/pkg/debug/write_fullarray_rl.F
ViewVC logotype

Annotation of /MITgcm/pkg/debug/write_fullarray_rl.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Thu Sep 23 21:21:02 2004 UTC (19 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, mitgcm_mapl_00, checkpoint58u_post, checkpoint58w_post, checkpoint57m_post, checkpoint57s_post, checkpoint57k_post, checkpoint55d_pre, checkpoint57d_post, checkpoint57g_post, checkpoint57b_post, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, checkpoint56b_post, checkpoint57i_post, checkpoint57y_post, checkpoint57e_post, checkpoint55h_post, checkpoint58n_post, checkpoint58x_post, checkpoint57g_pre, checkpoint58t_post, checkpoint58h_post, checkpoint56c_post, checkpoint57y_pre, checkpoint57f_pre, checkpoint57a_post, checkpoint58q_post, checkpoint57v_post, checkpoint55g_post, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint57a_pre, checkpoint55i_post, checkpoint57, checkpoint56, eckpoint57e_pre, checkpoint57h_done, checkpoint58f_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57f_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint57c_post, checkpoint58y_post, checkpoint55e_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint57j_post, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint57h_post, checkpoint56a_post, checkpoint55d_post
Changes since 1.1: +38 -12 lines
can now write local array (tile biArg,bjArg) or global array (as before).

1 jmc 1.2 C $Header: /u/gcmpack/MITgcm/pkg/debug/write_fullarray_rl.F,v 1.1 2003/12/07 20:36:16 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "CPP_OPTIONS.h"
5    
6     CStartofinterface
7 jmc 1.2 SUBROUTINE WRITE_FULLARRAY_RL(fnam, fld, kSize,
8     I biArg, bjArg, myIter, myThid)
9 jmc 1.1 C *==========================================================*
10     C | SUBROUTINE WRITE_FULLARRAY
11     C | write full array (including the overlap) to binary files
12     C *==========================================================*
13     C | Only used for debugging purpose.
14 jmc 1.2 C | can write local array (tile biArg,bjArg) or global
15     C | array (with biArg=bjArg=0)
16 jmc 1.1 C *==========================================================*
17     IMPLICIT NONE
18    
19     C == Global variables ===
20     #include "SIZE.h"
21     #include "EEPARAMS.h"
22    
23     C == Routine arguments ==
24     CHARACTER*(*) fnam
25     INTEGER kSize
26 jmc 1.2 INTEGER biArg, bjArg
27 jmc 1.1 INTEGER myIter
28     INTEGER myThid
29     _RL fld(1-Olx:sNx+Olx,1-Oly:sNy+Oly,kSize,nSx,nSy)
30     C == Functions ==
31     INTEGER ILNBLNK,IFNBLNK
32    
33     CEndofinterface
34     C == Local variables ==
35     CHARACTER*(2) fType
36     INTEGER i,j,k,bi,bj,iG,jG
37     INTEGER s1Lo,s1Hi, dUnit
38     CHARACTER*(80) fullName
39    
40     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
41    
42     C-- Only do I/O if I am the master thread
43     _BEGIN_MASTER( myThid )
44    
45     C-- to Build file name
46     s1Lo = IFNBLNK(fnam)
47     s1Hi = ILNBLNK(fnam)
48     CALL MDSFINDUNIT( dUnit, mythid )
49    
50     fType='RL'
51    
52 jmc 1.2 IF ( biArg.EQ.0 .AND. bjArg.EQ.0 ) THEN
53     C-- Write full global array:
54     DO bj = 1,nSy
55     DO bi = 1,nSx
56     iG=bi+(myXGlobalLo-1)/sNx
57     jG=bj+(myYGlobalLo-1)/sNy
58 jmc 1.1
59 jmc 1.2 WRITE( fullName, '(2A,I10.10,2(A,I3.3),A)' )
60 jmc 1.1 & fnam(s1Lo:s1Hi),'.',myIter,'.',iG,'.',jG,'.bin'
61    
62 jmc 1.2 c length_of_rec=MDS_RECLEN( filePrec, sNx, mythid )
63     OPEN(dUnit, file=fullName, status='unknown',
64 jmc 1.1 & form='unformatted')
65     c & access='direct', recl=length_of_rec )
66 jmc 1.2 WRITE(dUnit) ((( fld(i,j,k,bi,bj),
67 jmc 1.1 & i=1-Olx,sNx+Olx),
68     & j=1-Oly,sNy+Oly),
69     & k=1,kSize)
70 jmc 1.2 CLOSE(dUnit)
71 jmc 1.1
72 jmc 1.2 ENDDO
73 jmc 1.1 ENDDO
74 jmc 1.2
75     ELSE
76     C-- Write local array:
77     iG=biArg+(myXGlobalLo-1)/sNx
78     jG=bjArg+(myYGlobalLo-1)/sNy
79    
80     WRITE( fullName, '(2A,I10.10,2(A,I3.3),A)' )
81     & fnam(s1Lo:s1Hi),'.',myIter,'.',iG,'.',jG,'.bin'
82    
83     c length_of_rec=MDS_RECLEN( filePrec, sNx, mythid )
84     OPEN(dUnit, file=fullName, status='unknown',
85     & form='unformatted')
86     c & access='direct', recl=length_of_rec )
87     WRITE(dUnit) ((( fld(i,j,k,1,1),
88     & i=1-Olx,sNx+Olx),
89     & j=1-Oly,sNy+Oly),
90     & k=1,kSize)
91     CLOSE(dUnit)
92    
93     ENDIF
94 jmc 1.1
95     _END_MASTER( myThid )
96    
97     RETURN
98     END

  ViewVC Help
Powered by ViewVC 1.1.22