/[MITgcm]/MITgcm/eesupp/src/nml_filter.F
ViewVC logotype

Contents of /MITgcm/eesupp/src/nml_filter.F

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


Revision 1.7 - (show annotations) (download)
Fri Aug 5 23:44:28 2005 UTC (18 years, 9 months ago) by ce107
Branch: MAIN
CVS Tags: checkpoint57s_post, checkpoint58b_post, checkpoint57y_post, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint58f_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint58y_post, checkpoint58t_post, checkpoint57t_post, checkpoint57v_post, checkpoint57x_post, checkpoint58w_post, checkpoint57y_pre, checkpoint58o_post, checkpoint58p_post, checkpoint58q_post, checkpoint58e_post, mitgcm_mapl_00, checkpoint58m_post, checkpoint58r_post, checkpoint58n_post, checkpoint59p, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpint57u_post, checkpoint57q_post, checkpoint58k_post, checkpoint58v_post, checkpoint58l_post, checkpoint58g_post, checkpoint58x_post, checkpoint59j, checkpoint58h_post, checkpoint58j_post, checkpoint57w_post, checkpoint58i_post, checkpoint58c_post, checkpoint58u_post, checkpoint58s_post
Changes since 1.6: +5 -1 lines
Changed SCRATCH files to named files to avoid mysterious runtime error on
Blue Gene/L. Linux/PPC64 also complains at runtime but completes execution.
Introduce TARGET_BGL to avoid scraping scratch files.

1 C $Header: /u/gcmpack/MITgcm/eesupp/src/nml_filter.F,v 1.6 2004/03/27 03:51:51 edhill Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 #define FTN_NML_F90
7
8 CBOP
9
10 C !ROUTINE: NML_FILTER
11
12 C !INTERFACE:
13 SUBROUTINE NML_FILTER(
14 I fName
15 O , outUnit
16 I , myThid
17 & )
18 IMPLICIT NONE
19
20 C !DESCRIPTION:
21 C *=================================================================*
22 C | SUBROUTINE NML\_FILTER
23 C | o Remove comments from namelist.
24 C *=================================================================*
25 C |
26 C | Started: Ralf.Giering@FastOpt.de 15-Mai-2000
27 C |
28 C | - remove comments from namelist file
29 c | - usage
30 C |
31 C | CALL NML\_FILTER( 'datafile', iUnit, myThid )
32 C | READ ( UNIT = iunit, NML = the\_namelist )
33 C | CLOSE ( iUnit )
34 C |
35 C *=================================================================*
36
37 C !USES:
38 C == Global variables ==
39 #include "EEPARAMS.h"
40 INTEGER ILNBLNK
41 EXTERNAL ILNBLNK
42
43 C !INPUT/OUTPUT PARAMETERS:
44 C == Routine arguments ==
45 CHARACTER*(*) fName
46 INTEGER outUnit
47 INTEGER myThid
48
49 C !LOCAL VARIABLES:
50 C == Local variables ==
51 INTEGER errIo
52 INTEGER il
53 INTEGER inUnit
54 CHARACTER*(MAX_LEN_MBUF) msgBuf
55 CHARACTER*(MAX_LEN_PREC) record
56 CEOP
57
58 C-- Open the data file
59
60 CALL mdsFindUnit( inunit, mythid )
61
62 open( unit = inunit
63 & , file = fname
64 & , status = 'old'
65 & , iostat = errio
66 & )
67
68 c-- open the filtered data file
69 call mdsfindunit( outunit, mythid )
70 #ifdef TARGET_BGL
71 open( unit=outunit, file='scratch3', status='unknown' )
72 #else
73 open( unit=outunit, status='scratch' )
74 #endif
75
76 if ( errio .lt. 0 ) then
77 write(msgBuf,'(A)') 'S/R nml_filter'
78 call PRINT_ERROR( msgBuf , 1)
79 write(msgBuf,'(A)') 'Unable to open execution environment'
80 call PRINT_ERROR( msgBuf , 1)
81 write(msgBuf,'(3a)') 'namelist file "', fname, '"'
82 call PRINT_ERROR( msgBuf , 1)
83 close(outunit)
84 outunit = 0
85 stop ' stopped in nml_filter'
86 else
87 write(msgBuf,'(3a)') 'Processing namelist file ', fname, ' ...'
88 call PRINT_MESSAGE(msgBuf,standardMessageUnit,
89 & SQUEEZE_RIGHT,myThid)
90 endif
91
92 do while ( .true. )
93 read(inunit, fmt='(a)', iostat=errio) record
94 if ( errio .ne. 0 ) then
95 goto 1001
96 end if
97 il = max(ilnblnk(record),1)
98 if ( record(1:1) .eq. commentcharacter ) then
99 else if ( record(1:1) .eq. '/' ) then
100 #ifdef FTN_NML_F90
101 write(outunit, fmt='(a)') record(:il)
102 #else
103 write(outunit, fmt='(a)') ' &'
104 #endif
105 else if ( record(1:2) .eq. ' /' ) then
106 #ifdef FTN_NML_F90
107 write(outunit, fmt='(a)') record(:il)
108 #else
109 write(outunit, fmt='(a)') ' &'
110 #endif
111 else
112 CALL NML_SET_TERMINATOR( RECORD )
113 write(outunit, fmt='(a)') record(:il)
114 end if
115 enddo
116 1001 continue
117 close( inunit )
118
119 rewind( outunit )
120
121 end
122

  ViewVC Help
Powered by ViewVC 1.1.22