/[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.9 - (show annotations) (download)
Mon Dec 13 04:05:15 2010 UTC (13 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
remove nml_filter.F (calls to nml_filter were removed ~5 years ago)

1 C $Header: /u/gcmpack/MITgcm/eesupp/src/nml_filter.F,v 1.8 2008/04/16 20:48:06 heimbach 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 #if defined (TARGET_BGL) || defined (TARGET_CRAYXT)
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