/[MITgcm]/MITgcm/pkg/ecco/ecco_readparms.F
ViewVC logotype

Diff of /MITgcm/pkg/ecco/ecco_readparms.F

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

revision 1.1 by heimbach, Mon May 14 22:10:37 2001 UTC revision 1.9 by heimbach, Mon May 23 19:28:45 2005 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2    
3  #include "CPP_OPTIONS.h"  #include "COST_CPPOPTIONS.h"
4    
5          subroutine ecco_readparms( mythid )
       subroutine ecco_readparms(  
      I                      mythid  
      &                    )  
6    
7  c     ==================================================================  c     ==================================================================
8  c     SUBROUTINE ecco_readparms  c     SUBROUTINE ecco_readparms
9  c     ==================================================================  c     ==================================================================
10  c  c
11  c     o Initialize the ECCO release of the MITgcmUV.  c     o This routine initialises the package cost.
12  c  c     started: Ralf Giering 18-Jan-2001
 c     started: Christian Eckert eckert@mit.edu 29-Feb-1999  
 c  
 c              - Introduced to create a package for the MITgcmUV.  
 c  
 c     changed: Christian Eckert eckert@mit.edu  
13  c  c
14  c     ==================================================================  c     ==================================================================
15  c     SUBROUTINE ecco_readparms  c     SUBROUTINE ecco_readparms
# Line 27  c     ================================== Line 19  c     ==================================
19    
20  c     == global variables ==  c     == global variables ==
21    
 #include "SIZE.h"  
22  #include "EEPARAMS.h"  #include "EEPARAMS.h"
23    #include "SIZE.h"
24    #include "GRID.h"
25  #include "PARAMS.h"  #include "PARAMS.h"
26  #include "ecco.h"  
27    #include "ecco_cost.h"
28    
29  c     == routine arguments ==  c     == routine arguments ==
30    
31        integer mythid        integer mythid
32    
33  c     == local variables ==  c     == local variables ==
34    C     msgBuf      - Informational/error meesage buffer
35        integer errio  C     iUnit       - Work variable for IO unit number
36        integer il        CHARACTER*(MAX_LEN_MBUF) msgBuf
37          INTEGER iUnit
       character*(max_len_prec) record  
   
 c     == external ==  
   
       integer  ilnblnk  
       external ilnblnk  
38    
39  c     == end of interface ==  c     == end of interface ==
40    
41  c--   ECCO parameters.  c--   Read the namelist input.
42        namelist /ECCO_PARMS/        namelist /ecco_cost_nml/
43       &                      expId       &                   data_errfile,
44             &                   tbarfile, sbarfile, psbarfile,
45        _BEGIN_MASTER( myThid )       &                   ubarfile, vbarfile, wbarfile,
46          open( unit=scrunit1, status='scratch' )       &                   tauxbarfile, tauybarfile,
47         &                   hfluxbarfile, sfluxbarfile,
48  c--     Next, read the ECCO data file.       &                   using_topex,
49          open( unit   = modeldataunit,       &                   topexstartdate1, topexstartdate2,
50       &        file   = 'data.ecco',       &                   topexperiod, topexfile, topexmeanfile,
51       &        status = 'old',       &                   using_ers,
52       &        iostat = errio)       &                   ersstartdate1, ersstartdate2,
53         &                   ersperiod, ersfile,
54          if ( errio .lt. 0 ) then       &                   scatstartdate1, scatstartdate2,
55            stop ' stopped in ecco_readparms.'       &                   scatperiod, scatxdatfile, scatydatfile,
56          endif       &                   scatx_errfile, scaty_errfile,
57         &                   ssh_errfile,
58          do while ( .true. )       &                   tmistartdate1, tmistartdate2, tmidatfile,
59            read(modeldataunit, fmt='(a)', end=1001) record       &                   sststartdate1, sststartdate2, sstdatfile,
60            il = max(ilnblnk(record),1)       &                   sssstartdate1, sssstartdate2, sssdatfile,
61            if ( record(1:1) .ne. commentcharacter )       &                   tdatfile, sdatfile,
62       &        write(unit=scrunit1, fmt='(a)') record(:il)       &                   ctdtfile, ctdsfile,
63          enddo       &                   ctdtclimfile, ctdsclimfile,
64   1001   continue       &                   xbtfile,
65          close( modeldataunit )       &                   argotstartdate1, argotstartdate2, argotfile,
66         &                   argosstartdate1, argosstartdate2, argosfile,
67          rewind( scrunit1 )       &                   udriftfile, vdriftfile,
68          read  ( unit = scrunit1, nml = ecco_parms)       &                   udrifterrfile, vdrifterrfile,
69          close ( scrunit1 )       &                   curmtrufile,curmtrvfile,
70         &                   salterrfile, temperrfile, velerrfile,
71  c-------------------------------- ECCO --------------------------------       &                   hflux_errfile, sflux_errfile,
72         &                   tauu_errfile, tauv_errfile,
73  #ifdef INCLUDE_ECCO_PACKAGE       &                   atemp_errfile, aqh_errfile,
74  C--   Initialise the ECCO State Estimation package.       &                   uwind_errfile, vwind_errfile,
75         &                   geoid_errfile, geoid_covariancefile,
76  #ifdef ALLOW_CALENDAR       &                   mult_hflux, mult_sflux, mult_tauu, mult_tauv,
77  C--   Initialise the calendar package.       &                   mult_atemp, mult_aqh, mult_uwind, mult_vwind,
78  #ifdef ALLOW_CAL_NENDITER       &                   mult_hmean, mult_h, mult_temp, mult_salt,
79        CALL cal_Init(       &                   mult_tmi, mult_sst, mult_sss,
80       I               startTime,       &                   mult_ctdt, mult_ctds,
81       I               endTime,       &                   mult_ctdtclim, mult_ctdsclim,
82       I               deltaTclock,       &                   mult_xbt, mult_drift,
83       I               nIter0,       &                   mult_argot, mult_argos,
84       I               nEndIter,       &                   mult_scatx, mult_scaty,
85       I               nTimeSteps,       &                   mult_sdrift, mult_tdrift, mult_wdrift,
86       I               myThid       &                   mult_temp0, mult_salt0,
87       &             )       &                   mult_obcsn, mult_obcss,
88  #else       &                   mult_obcsw, mult_obcse, mult_obcsvol,
89        CALL cal_Init(       &                   mult_curmtr, mult_ageos,
90       I               startTime,       &                   mult_ice,
91       I               endTime,       &                   mult_kapgm, mult_diffkr,
92       I               deltaTclock,       &                   costIceStart1, costIceStart2,
93       I               nIter0,       &                   costIceEnd1, costIceEnd2,
94       I               nTimeSteps,       &                   cost_ice_flag,
95       I               myThid       &                   cost_iprec, cost_yftype
      &             )  
 #endif  
       _BARRIER  
 #endif  
   
 C--   Custom routine to set forcing fields.  
 #ifdef INCLUDE_EXTERNAL_FORCING_PACKAGE  
       call exf_readparms  ( mythid )  
       call exf_init( mythid )  
 #endif /* INCLUDE_EXTERNAL_FORCING_PACKAGE */  
   
 #ifdef ALLOW_ECCO_OPTIMIZATION  
 c--   Initialise the optimization-related parts of the ECCO State  
 c--   Estimation package.  
       CALL optim_Init( myThid )  
       _BARRIER  
 #else  
 c--   Optimization not enabled.  
 #endif  
   
 #ifndef ALLOW_ECCO_FORWARD_RUN  
 C--   Initialise the cost function.  
       call cost_readparms( mythid )  
       call cost_init( myThid )  
       _BARRIER  
   
 C--   Initialise the control vector.  
       CALL ctrl_Init( myThid )  
       _BARRIER  
 #else  
 c     not needed for forward run only  
 #endif  
   
   
 #ifdef ALLOW_ECCO_GRADIENT_CHECK  
 c--   Initialise the gradient check for the TAMC generated adjoint  
 c--   model.  
       CALL grdchk_Init( myThid )  
       _BARRIER  
 #else  
 c--   Gradient check not enabled.  
 #endif  
96    
97          _BEGIN_MASTER( myThid )
98    
99  #ifdef ALLOW_ECCO_DIAGNOSTICS_RUN  c--     Set default values.
100  c--   Initialise the ECCO diagnostics package.          data_errfile          =    ' '
101        CALL diagnos_Init( myThid )          tbarfile              =    'tbar'
102        _BARRIER          sbarfile              =    'sbar'
103  #else          psbarfile             =    'psbar'
104  c--   Diagnostics not enabled.          ubarfile              =    'ubar'
105            vbarfile              =    'vbar'
106            wbarfile              =    'wbar'
107            tauxbarfile           =    'tauxbar'
108            tauybarfile           =    'tauybar'
109            hfluxbarfile          =    'hfluxbar'
110            sfluxbarfile          =    'sfluxbar'
111            using_topex           = .false.
112            topexstartdate1       =      0
113            topexstartdate2       =      0
114            topexperiod           =      0. _d 0
115            topexfile             =    ' '
116            topexmeanfile         =    ' '
117            using_ers             = .false.
118            ersstartdate1         =      0
119            ersstartdate2         =      0
120            ersperiod             =      0. _d 0
121            ersfile               =    ' '
122            scatstartdate1        =      0
123            scatstartdate2        =      0
124            scatperiod            =      0. _d 0
125            scatxdatfile          =    ' '
126            scatydatfile          =    ' '
127            ssh_errfile           =    ' '
128            scatx_errfile         =    ' '
129            scaty_errfile         =    ' '
130            tmistartdate1         =      0
131            tmistartdate2         =      0
132            tmidatfile            =    ' '
133            sststartdate1         =      0
134            sststartdate2         =      0
135            sstdatfile            =    ' '
136            sssstartdate1         =      0
137            sssstartdate2         =      0
138            sssdatfile            =    ' '
139            tdatfile              =    ' '
140            sdatfile              =    ' '
141            ctdtfile              =    ' '
142            ctdsfile              =    ' '
143            ctdtclimfile          =    ' '
144            ctdsclimfile          =    ' '
145            curmtrufile           =    ' '
146            curmtrvfile           =    ' '
147            xbtfile               =    ' '
148            argotstartdate1       =      0
149            argotstartdate2       =      0
150            argotfile             =    ' '
151            argosstartdate1       =      0
152            argosstartdate2       =      0
153            argosfile             =    ' '
154            udriftfile            =    ' '
155            vdriftfile            =    ' '
156            udrifterrfile         =    ' '
157            vdrifterrfile         =    ' '
158            salterrfile           =    ' '
159            temperrfile           =    ' '
160            velerrfile            =    ' '
161            hflux_errfile         =    ' '
162            sflux_errfile         =    ' '
163            tauu_errfile          =    ' '
164            tauv_errfile          =    ' '
165            atemp_errfile         =    ' '
166            aqh_errfile           =    ' '
167            uwind_errfile         =    ' '
168            vwind_errfile         =    ' '
169            geoid_errfile         =    ' '
170            geoid_covariancefile  =    ' '
171            mult_hflux            =      0. _d 0
172            mult_sflux            =      0. _d 0
173            mult_tauu             =      0. _d 0
174            mult_tauv             =      0. _d 0
175            mult_atemp            =      0. _d 0
176            mult_aqh              =      0. _d 0
177            mult_uwind            =      0. _d 0
178            mult_vwind            =      0. _d 0
179            mult_hmean            =      0. _d 0
180            mult_h                =      0. _d 0
181            mult_temp             =      0. _d 0
182            mult_salt             =      0. _d 0
183            mult_temp0            =      0. _d 0
184            mult_salt0            =      0. _d 0
185            mult_tmi              =      0. _d 0
186            mult_sst              =      0. _d 0
187            mult_sss              =      0. _d 0
188            mult_ctdt             =      0. _d 0
189            mult_ctds             =      0. _d 0
190            mult_ctdtclim         =      0. _d 0
191            mult_ctdsclim         =      0. _d 0
192            mult_xbt              =      0. _d 0
193            mult_argot            =      0. _d 0
194            mult_argos            =      0. _d 0
195            mult_drift            =      0. _d 0
196            mult_tdrift           =      0. _d 0
197            mult_sdrift           =      0. _d 0
198            mult_wdrift           =      0. _d 0
199            mult_scatx            =      0. _d 0
200            mult_scaty            =      0. _d 0
201            mult_obcsn            =      0. _d 0
202            mult_obcss            =      0. _d 0
203            mult_obcsw            =      0. _d 0
204            mult_obcse            =      0. _d 0
205            mult_obcsvol          =      0. _d 0
206            mult_ageos            =      0. _d 0
207            mult_curmtr           =      0. _d 0
208            mult_ice              =      0. _d 0
209            mult_kapgm            =      0. _d 0
210            mult_diffkr           =      0. _d 0
211            costIceStart1         =      0
212            costIceStart2         =      0
213            costIceEnd1           =      0
214            costIceEnd2           =      0
215            cost_ice_flag         =      1
216    
217    c--     Next, read the cost data file.
218            WRITE(msgBuf,'(A)') 'ECCO_READPARMS: opening data.ecco'
219            CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
220         &                    SQUEEZE_RIGHT , 1)
221    
222            CALL OPEN_COPY_DATA_FILE(
223         I                          'data.ecco', 'ECCO_READPARMS',
224         O                          iUnit,
225         I                          myThid )
226    
227            READ(  iUnit, nml = ecco_cost_nml )
228    
229            WRITE(msgBuf,'(A)') 'ECCO_READPARMS: finished reading data.ecco'
230            CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
231         &                  SQUEEZE_RIGHT , 1)
232    
233            CLOSE( iUnit )
234    
235    #ifdef ALLOW_CAL
236    c--     Get the complete dates of the ...
237    c--     ... SST data.
238            call cal_FullDate( sststartdate1,   sststartdate2,
239         &                     sststartdate,    mythid )
240    c--     ... TMI data.
241            call cal_FullDate( tmistartdate1,   tmistartdate2,
242         &                     tmistartdate,    mythid )
243    c--     ... SSS data.
244            call cal_FullDate( sssstartdate1,   sssstartdate2,
245         &                     sssstartdate,    mythid )    
246    c--     ... T/P data.
247            call cal_FullDate( topexstartdate1, topexstartdate2,
248         &                     topexstartdate,  mythid )
249    c--     ... ERS data.
250            call cal_FullDate( ersstartdate1,   ersstartdate2,
251         &                     ersstartdate,    mythid )
252    c--     ... SCAT data.
253            call cal_FullDate( scatstartdate1,   scatstartdate2,
254         &                     scatxstartdate,    mythid )
255            call cal_FullDate( scatstartdate1,   scatstartdate2,  
256         &                     scatystartdate,    mythid )
257  #endif  #endif
258    
 #endif /* INCLUDE_ECCO_PACKAGE */  
   
 c-------------------------------- ECCO --------------------------------  
   
 c--     Summarize the setup of the ECCO release.  
 c        call ecco_Summary( mythid )  
259        _END_MASTER( mythid )        _END_MASTER( mythid )
260    
 c--   Everyone else must wait for the parameters to be loaded and  
 c--   the setup to be completed.  
261        _BARRIER        _BARRIER
262    
263        end        end

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

  ViewVC Help
Powered by ViewVC 1.1.22