/[MITgcm]/MITgcm/pkg/cal/cal_readparms.F
ViewVC logotype

Diff of /MITgcm/pkg/cal/cal_readparms.F

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

revision 1.2 by heimbach, Thu May 30 22:49:56 2002 UTC revision 1.9 by jmc, Mon Mar 20 15:14:27 2006 UTC
# Line 1  Line 1 
1    C $Header$
2    C $Name$
3    
4  #include "CAL_CPPOPTIONS.h"  #include "CAL_OPTIONS.h"
5    
6        subroutine cal_readparms( mythid )        subroutine cal_readparms( mythid )
7    
# Line 52  c     == global variables == Line 54  c     == global variables ==
54  #include "SIZE.h"  #include "SIZE.h"
55  #include "EEPARAMS.h"  #include "EEPARAMS.h"
56  #include "PARAMS.h"  #include "PARAMS.h"
57    #include "cal.h"
58    
59  c     == routine arguments ==  c     == routine arguments ==
60    
# Line 81  c     == local variables == Line 84  c     == local variables ==
84    
85  c     Variables related to the calendar tool.  c     Variables related to the calendar tool.
86        character*(9) TheCalendar        character*(9) TheCalendar
87        integer       startdate_1        integer       iUnit
       integer       startdate_2  
88    
89          character*(max_len_mbuf) msgbuf
90        character*(max_len_prec) record        character*(max_len_prec) record
91    
92  c     == external ==  c     == external ==
# Line 98  c     (version 0.1.3 >> START << ) Line 101  c     (version 0.1.3 >> START << )
101    
102        namelist /CAL_NML/        namelist /CAL_NML/
103       & TheCalendar,       & TheCalendar,
104       & startDate_1,startDate_2       & startDate_1,startDate_2,
105         & calendarDumps
106    
107  c     (version 0.1.3 >> END << )  c     (version 0.1.3 >> END << )
108    
109    
110        _BEGIN_MASTER(myThid)        _BEGIN_MASTER(myThid)
111    
112  #ifndef ALLOW_CAL_NENDITER  c       Initialise the calendar parameters
       print *, 'WARNING: ALLOW_CAL_NENDITER must be defined in CPP file'  
       STOP 'undef ALLOW_CAL_NENDITER no longer supported by cal package'  
 #endif  
   
 c       Initialise the calendar's parameters  
113          TheCalendar = ' '          TheCalendar = ' '
114          startdate_1 = 0          startdate_1 = 0
115          startdate_2 = 0          startdate_2 = 0
116          enddate_1   = 0          enddate_1   = 0
117          enddate_2   = 0          enddate_2   = 0
118            calendarDumps = .FALSE.
         open(unit=scrunit1,status='scratch')  
119    
120  c       Next, read the calendar data file.  c       Next, read the calendar data file.
121          open(unit = modeldataunit,file = 'data.cal',          WRITE(msgBuf,'(A)') 'CAL_READPARMS: opening data.cal'
122       &       status = 'old', iostat = errio)          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
123          if ( errio .lt. 0 ) then       &                    SQUEEZE_RIGHT , 1)
124            ierr = 1  
125            call cal_PrintError( ierr, mythid )          CALL OPEN_COPY_DATA_FILE(
126            stop ' stopped in cal_readparms.'       I                          'data.cal', 'CAL_READPARMS',
127          endif       O                          iUnit,
128         I                          myThid )
129          do while ( .true. )  
130            read(modeldataunit, fmt='(a)', end=1001) record          READ(unit = iUnit, nml = cal_nml)
131            il = max(ilnblnk(record),1)  
132            if ( record(1:1) .ne. commentcharacter )          WRITE(msgBuf,'(A)')
133       &        write(unit=scrunit1, fmt='(a)') record(:il)       &     'CAL_READPARMS: finished reading data.cal'
134          enddo          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
135   1001   continue       &                SQUEEZE_RIGHT , 1)
   
         close( modeldataunit )  
   
         rewind( scrunit1 )  
         read(unit = scrunit1, nml = cal_nml)  
         close( scrunit1 )  
136    
137            CLOSE( iUnit )
138    
139  c       Check consistency of the date specifications with the MITgcmUV's  c       Check consistency of the date specifications with the MITgcm
140  c       startTime, endTime, and nTimeSteps, then set all the calendar  c       startTime, endTime, and nTimeSteps, then set all the calendar
141  c       parameters.  c       parameters.
142    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22