/[MITgcm]/MITgcm/pkg/ctrl/ctrl_init.F
ViewVC logotype

Diff of /MITgcm/pkg/ctrl/ctrl_init.F

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

revision 1.39 by mlosch, Tue May 10 07:30:14 2011 UTC revision 1.40 by jmc, Tue May 24 20:56:54 2011 UTC
# Line 1  Line 1 
 C  
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
# Line 72  c     == global variables == Line 71  c     == global variables ==
71  #ifdef ALLOW_CAL  #ifdef ALLOW_CAL
72  # include "cal.h"  # include "cal.h"
73  #endif  #endif
 #ifdef ALLOW_OBCS_CONTROL  
 # include "OBCS.h"  
 #endif  
74  #ifdef ALLOW_DIC_CONTROL  #ifdef ALLOW_DIC_CONTROL
75  # include "DIC_CTRL.h"  # include "DIC_CTRL.h"
76  #endif  #endif
# Line 168  c--------------------------------------- Line 164  c---------------------------------------
164  c--  c--
165  #ifdef ALLOW_THETA0_CONTROL  #ifdef ALLOW_THETA0_CONTROL
166  c--   Initial state temperature contribution.  c--   Initial state temperature contribution.
167        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
168       &     xx_theta_file, 1, 101, 1, 1, 1,       &     xx_theta_file, 1, 101, 1, 1, 1,
169       &     snx, sny, nr, 'c', '3d', mythid )       &     snx, sny, nr, 'c', '3d', mythid )
170  #endif /* ALLOW_THETA0_CONTROL */  #endif /* ALLOW_THETA0_CONTROL */
171    
# Line 177  c--------------------------------------- Line 173  c---------------------------------------
173  c--  c--
174  #ifdef ALLOW_SALT0_CONTROL  #ifdef ALLOW_SALT0_CONTROL
175  c--   Initial state salinity contribution.  c--   Initial state salinity contribution.
176        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
177       &     xx_salt_file, 2, 102, 1, 1, 1,       &     xx_salt_file, 2, 102, 1, 1, 1,
178       &     snx, sny, nr, 'c', '3d', mythid )       &     snx, sny, nr, 'c', '3d', mythid )
179  #endif /* ALLOW_SALT0_CONTROL */  #endif /* ALLOW_SALT0_CONTROL */
# Line 190  c--------------------------------------- Line 186  c---------------------------------------
186  c--  c--
187  #if (defined (ALLOW_HFLUX_CONTROL))  #if (defined (ALLOW_HFLUX_CONTROL))
188  c--   Heat flux.  c--   Heat flux.
189        call ctrl_init_rec (        call ctrl_init_rec (
190       I     xx_hfluxstartdate1, xx_hfluxstartdate2, xx_hfluxperiod, 1,       I     xx_hfluxstartdate1, xx_hfluxstartdate2, xx_hfluxperiod, 1,
191       O     xx_hfluxstartdate, diffrec, startrec, endrec,       O     xx_hfluxstartdate, diffrec, startrec, endrec,
192       I     mythid )       I     mythid )
193        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
194       &     xx_hflux_file, 3, 103, diffrec, startrec, endrec,       &     xx_hflux_file, 3, 103, diffrec, startrec, endrec,
195       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
196    
197  #elif (defined (ALLOW_ATEMP_CONTROL))  #elif (defined (ALLOW_ATEMP_CONTROL))
198  c--   Atmos. temperature  c--   Atmos. temperature
199        call ctrl_init_rec (        call ctrl_init_rec (
200       I     xx_atempstartdate1, xx_atempstartdate2, xx_atempperiod, 1,       I     xx_atempstartdate1, xx_atempstartdate2, xx_atempperiod, 1,
201       O     xx_atempstartdate, diffrec, startrec, endrec,       O     xx_atempstartdate, diffrec, startrec, endrec,
202       I     mythid )       I     mythid )
203        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
204       &     xx_atemp_file, 7, 107, diffrec, startrec, endrec,       &     xx_atemp_file, 7, 107, diffrec, startrec, endrec,
205       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
206          
207  #elif (defined (ALLOW_HFLUX0_CONTROL))  #elif (defined (ALLOW_HFLUX0_CONTROL))
208  c--   initial forcing only  c--   initial forcing only
209        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
210       &     xx_hflux_file, 3, 103, 1, 1, 1,       &     xx_hflux_file, 3, 103, 1, 1, 1,
211       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
212    
213  #endif /* ALLOW_HFLUX_CONTROL */  #endif /* ALLOW_HFLUX_CONTROL */
# Line 220  c--------------------------------------- Line 216  c---------------------------------------
216  c--  c--
217  #if (defined (ALLOW_SFLUX_CONTROL))  #if (defined (ALLOW_SFLUX_CONTROL))
218  c--   Salt flux.  c--   Salt flux.
219        call ctrl_init_rec (        call ctrl_init_rec (
220       I     xx_sfluxstartdate1, xx_sfluxstartdate2, xx_sfluxperiod, 1,       I     xx_sfluxstartdate1, xx_sfluxstartdate2, xx_sfluxperiod, 1,
221       O     xx_sfluxstartdate, diffrec, startrec, endrec,       O     xx_sfluxstartdate, diffrec, startrec, endrec,
222       I     mythid )       I     mythid )
223        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
224       &     xx_sflux_file, 4, 104, diffrec, startrec, endrec,       &     xx_sflux_file, 4, 104, diffrec, startrec, endrec,
225       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
226    
227  #elif (defined (ALLOW_AQH_CONTROL))  #elif (defined (ALLOW_AQH_CONTROL))
228  c--   Atmos. humidity  c--   Atmos. humidity
229        call ctrl_init_rec (        call ctrl_init_rec (
230       I     xx_aqhstartdate1, xx_aqhstartdate2, xx_aqhperiod, 1,       I     xx_aqhstartdate1, xx_aqhstartdate2, xx_aqhperiod, 1,
231       O     xx_aqhstartdate, diffrec, startrec, endrec,       O     xx_aqhstartdate, diffrec, startrec, endrec,
232       I     mythid )       I     mythid )
233        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
234       &     xx_aqh_file, 8, 108, diffrec, startrec, endrec,       &     xx_aqh_file, 8, 108, diffrec, startrec, endrec,
235       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
236    
237  #elif (defined (ALLOW_SFLUX0_CONTROL))  #elif (defined (ALLOW_SFLUX0_CONTROL))
238  c--   initial forcing only  c--   initial forcing only
239        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
240       &     xx_sflux_file, 4, 104, 1, 1, 1,       &     xx_sflux_file, 4, 104, 1, 1, 1,
241       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
242    
243  #endif /* ALLOW_SFLUX_CONTROL */  #endif /* ALLOW_SFLUX_CONTROL */
# Line 250  c--------------------------------------- Line 246  c---------------------------------------
246  c--  c--
247  #if (defined (ALLOW_USTRESS_CONTROL))  #if (defined (ALLOW_USTRESS_CONTROL))
248  c--   Zonal wind stress.  c--   Zonal wind stress.
249        call ctrl_init_rec (        call ctrl_init_rec (
250       I     xx_tauustartdate1, xx_tauustartdate2, xx_tauuperiod, 1,       I     xx_tauustartdate1, xx_tauustartdate2, xx_tauuperiod, 1,
251       O     xx_tauustartdate, diffrec, startrec, endrec,       O     xx_tauustartdate, diffrec, startrec, endrec,
252       I     mythid )       I     mythid )
253        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
254       &     xx_tauu_file, 5, 105, diffrec, startrec, endrec,       &     xx_tauu_file, 5, 105, diffrec, startrec, endrec,
255  #ifndef ALLOW_ROTATE_UV_CONTROLS  #ifndef ALLOW_ROTATE_UV_CONTROLS
256       &     snx, sny, 1, 'w', 'xy', mythid )       &     snx, sny, 1, 'w', 'xy', mythid )
# Line 264  c--   Zonal wind stress. Line 260  c--   Zonal wind stress.
260    
261  #elif (defined (ALLOW_UWIND_CONTROL))  #elif (defined (ALLOW_UWIND_CONTROL))
262  c--   Zonal wind speed.  c--   Zonal wind speed.
263        call ctrl_init_rec (        call ctrl_init_rec (
264       I     xx_uwindstartdate1, xx_uwindstartdate2, xx_uwindperiod, 1,       I     xx_uwindstartdate1, xx_uwindstartdate2, xx_uwindperiod, 1,
265       O     xx_uwindstartdate, diffrec, startrec, endrec,       O     xx_uwindstartdate, diffrec, startrec, endrec,
266       I     mythid )       I     mythid )
267        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
268       &     xx_uwind_file, 9, 109, diffrec, startrec, endrec,       &     xx_uwind_file, 9, 109, diffrec, startrec, endrec,
269       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
270    
271  #elif (defined (ALLOW_TAUU0_CONTROL))  #elif (defined (ALLOW_TAUU0_CONTROL))
272  c--   initial forcing only  c--   initial forcing only
273        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
274       &     xx_tauu_file, 5, 105, 1, 1, 1,       &     xx_tauu_file, 5, 105, 1, 1, 1,
275       &     snx, sny, 1, 'w', 'xy', mythid )       &     snx, sny, 1, 'w', 'xy', mythid )
276    
# Line 284  c--------------------------------------- Line 280  c---------------------------------------
280  c--  c--
281  #if (defined (ALLOW_VSTRESS_CONTROL))  #if (defined (ALLOW_VSTRESS_CONTROL))
282  c--   Meridional wind stress.  c--   Meridional wind stress.
283        call ctrl_init_rec (        call ctrl_init_rec (
284       I     xx_tauvstartdate1, xx_tauvstartdate2, xx_tauvperiod, 1,       I     xx_tauvstartdate1, xx_tauvstartdate2, xx_tauvperiod, 1,
285       O     xx_tauvstartdate, diffrec, startrec, endrec,       O     xx_tauvstartdate, diffrec, startrec, endrec,
286       I     mythid )       I     mythid )
287        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
288       &     xx_tauv_file, 6, 106, diffrec, startrec, endrec,       &     xx_tauv_file, 6, 106, diffrec, startrec, endrec,
289  #ifndef ALLOW_ROTATE_UV_CONTROLS  #ifndef ALLOW_ROTATE_UV_CONTROLS
290       &     snx, sny, 1, 's', 'xy', mythid )       &     snx, sny, 1, 's', 'xy', mythid )
291  #else      #else
292       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
293  #endif  #endif
294    
295  #elif (defined (ALLOW_VWIND_CONTROL))  #elif (defined (ALLOW_VWIND_CONTROL))
296  c--   Meridional wind speed.  c--   Meridional wind speed.
297        call ctrl_init_rec (        call ctrl_init_rec (
298       I     xx_vwindstartdate1, xx_vwindstartdate2, xx_vwindperiod, 1,       I     xx_vwindstartdate1, xx_vwindstartdate2, xx_vwindperiod, 1,
299       O     xx_vwindstartdate, diffrec, startrec, endrec,       O     xx_vwindstartdate, diffrec, startrec, endrec,
300       I     mythid )       I     mythid )
301        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
302       &     xx_vwind_file, 10, 110, diffrec, startrec, endrec,       &     xx_vwind_file, 10, 110, diffrec, startrec, endrec,
303       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
304    
305  #elif (defined (ALLOW_TAUV0_CONTROL))  #elif (defined (ALLOW_TAUV0_CONTROL))
306  c--   initial forcing only  c--   initial forcing only
307        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
308       &     xx_tauv_file, 6, 106, 1, 1, 1,       &     xx_tauv_file, 6, 106, 1, 1, 1,
309       &     snx, sny, 1, 's', 'xy', mythid )       &     snx, sny, 1, 's', 'xy', mythid )
310    
# Line 322  c--------------------------------------- Line 318  c---------------------------------------
318  c--  c--
319  #ifdef ALLOW_OBCSN_CONTROL  #ifdef ALLOW_OBCSN_CONTROL
320  c--   Northern obc.  c--   Northern obc.
321        call ctrl_init_rec (        call ctrl_init_rec (
322       I     xx_obcsnstartdate1, xx_obcsnstartdate2, xx_obcsnperiod, 4,       I     xx_obcsnstartdate1, xx_obcsnstartdate2, xx_obcsnperiod, 4,
323       O     xx_obcsnstartdate, diffrec, startrec, endrec,       O     xx_obcsnstartdate, diffrec, startrec, endrec,
324       I     mythid )       I     mythid )
325        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
326       &     xx_obcsn_file, 11, 111, diffrec, startrec, endrec,       &     xx_obcsn_file, 11, 111, diffrec, startrec, endrec,
327       &     snx, 1, nr, 'm', 'xz', mythid )       &     snx, 1, nr, 'm', 'xz', mythid )
328  #endif /* ALLOW_OBCSN_CONTROL */  #endif /* ALLOW_OBCSN_CONTROL */
# Line 335  c--------------------------------------- Line 331  c---------------------------------------
331  c--  c--
332  #ifdef ALLOW_OBCSS_CONTROL  #ifdef ALLOW_OBCSS_CONTROL
333  c--   Southern obc.  c--   Southern obc.
334        call ctrl_init_rec (        call ctrl_init_rec (
335       I     xx_obcssstartdate1, xx_obcssstartdate2, xx_obcssperiod, 4,       I     xx_obcssstartdate1, xx_obcssstartdate2, xx_obcssperiod, 4,
336       O     xx_obcssstartdate, diffrec, startrec, endrec,       O     xx_obcssstartdate, diffrec, startrec, endrec,
337       I     mythid )       I     mythid )
338        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
339       &     xx_obcss_file, 12, 112, diffrec, startrec, endrec,       &     xx_obcss_file, 12, 112, diffrec, startrec, endrec,
340       &     snx, 1, nr, 'm', 'xz', mythid )       &     snx, 1, nr, 'm', 'xz', mythid )
341  #endif /* ALLOW_OBCSS_CONTROL */  #endif /* ALLOW_OBCSS_CONTROL */
# Line 348  c--------------------------------------- Line 344  c---------------------------------------
344  c--  c--
345  #ifdef ALLOW_OBCSW_CONTROL  #ifdef ALLOW_OBCSW_CONTROL
346  c--   Western obc.  c--   Western obc.
347        call ctrl_init_rec (        call ctrl_init_rec (
348       I     xx_obcswstartdate1, xx_obcswstartdate2, xx_obcswperiod, 4,       I     xx_obcswstartdate1, xx_obcswstartdate2, xx_obcswperiod, 4,
349       O     xx_obcswstartdate, diffrec, startrec, endrec,       O     xx_obcswstartdate, diffrec, startrec, endrec,
350       I     mythid )       I     mythid )
351        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
352       &     xx_obcsw_file, 13, 113, diffrec, startrec, endrec,       &     xx_obcsw_file, 13, 113, diffrec, startrec, endrec,
353       &     1, sny, nr, 'm', 'yz', mythid )       &     1, sny, nr, 'm', 'yz', mythid )
354  #endif  /* ALLOW_OBCSW_CONTROL */  #endif  /* ALLOW_OBCSW_CONTROL */
# Line 361  c--------------------------------------- Line 357  c---------------------------------------
357  c--  c--
358  #ifdef ALLOW_OBCSE_CONTROL  #ifdef ALLOW_OBCSE_CONTROL
359  c--   Eastern obc.  c--   Eastern obc.
360        call ctrl_init_rec (        call ctrl_init_rec (
361       I     xx_obcsestartdate1, xx_obcsestartdate2, xx_obcseperiod, 4,       I     xx_obcsestartdate1, xx_obcsestartdate2, xx_obcseperiod, 4,
362       O     xx_obcsestartdate, diffrec, startrec, endrec,       O     xx_obcsestartdate, diffrec, startrec, endrec,
363       I     mythid )       I     mythid )
364        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
365       &     xx_obcse_file, 14, 114, diffrec, startrec, endrec,       &     xx_obcse_file, 14, 114, diffrec, startrec, endrec,
366       &     1, sny, nr, 'm', 'yz', mythid )       &     1, sny, nr, 'm', 'yz', mythid )
367  #endif /* ALLOW_OBCSE_CONTROL */  #endif /* ALLOW_OBCSE_CONTROL */
# Line 385  c     run-time option and also define fi Line 381  c     run-time option and also define fi
381          end do          end do
382          CLOSE( dUnit )          CLOSE( dUnit )
383  CMM  double precision modesv is size [NR,NR,NR]  CMM  double precision modesv is size [NR,NR,NR]
384  c     dim one is z-space      c     dim one is z-space
385  c     dim two is mode space  c     dim two is mode space
386  c     dim three is the total depth for which this set of modes applies  c     dim three is the total depth for which this set of modes applies
387  c     so for example modesv(:,2,nr) will be the second mode  c     so for example modesv(:,2,nr) will be the second mode
388  c     in z-space for the full model depth  c     in z-space for the full model depth
389  c    The modes are to be orthogonal when weighted by dz.    c    The modes are to be orthogonal when weighted by dz.
390  c     i.e. if f_i(z) = mode i, sum_j(f_i(z_j)*f_j(z_j)*dz_j = delta_ij  c     i.e. if f_i(z) = mode i, sum_j(f_i(z_j)*f_j(z_j)*dz_j = delta_ij
391  c    first mode should also be constant in depth...barotropic  c    first mode should also be constant in depth...barotropic
392  c    For a matlab code example how to construct the orthonormal modes,  c    For a matlab code example how to construct the orthonormal modes,
393  c     which are ideally the solution of planetary vertical mode equation  c     which are ideally the solution of planetary vertical mode equation
394  c     using model mean dRho/dz, see  c     using model mean dRho/dz, see
395  c     MITgcm/verification/obcs_ctrl/input/gendata.m  c     MITgcm/verification/obcs_ctrl/input/gendata.m
396  c    This code is compatible with partial cells  c    This code is compatible with partial cells
397  #endif  #endif
# Line 403  c    This code is compatible with partia Line 399  c    This code is compatible with partia
399  c----------------------------------------------------------------------  c----------------------------------------------------------------------
400  c--  c--
401  #ifdef ALLOW_DIFFKR_CONTROL  #ifdef ALLOW_DIFFKR_CONTROL
402        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
403       &     xx_diffkr_file, 15, 115, 1, 1, 1,       &     xx_diffkr_file, 15, 115, 1, 1, 1,
404       &     snx, sny, nr, 'c', '3d', mythid )       &     snx, sny, nr, 'c', '3d', mythid )
405  #endif /* ALLOW_DIFFKR_CONTROL */  #endif /* ALLOW_DIFFKR_CONTROL */
# Line 411  c-- Line 407  c--
407  c----------------------------------------------------------------------  c----------------------------------------------------------------------
408  c--  c--
409  #ifdef ALLOW_KAPGM_CONTROL  #ifdef ALLOW_KAPGM_CONTROL
410        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
411       &     xx_kapgm_file, 16, 116, 1, 1, 1,       &     xx_kapgm_file, 16, 116, 1, 1, 1,
412       &     snx, sny, nr, 'c', '3d', mythid )       &     snx, sny, nr, 'c', '3d', mythid )
413  #endif /* ALLOW_KAPGM_CONTROL */  #endif /* ALLOW_KAPGM_CONTROL */
# Line 419  c-- Line 415  c--
415  c----------------------------------------------------------------------  c----------------------------------------------------------------------
416  c--  c--
417  #ifdef ALLOW_TR10_CONTROL  #ifdef ALLOW_TR10_CONTROL
418        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
419       &     xx_tr1_file, 17, 117, 1, 1, 1,       &     xx_tr1_file, 17, 117, 1, 1, 1,
420       &     snx, sny, nr, 'c', '3d', mythid )       &     snx, sny, nr, 'c', '3d', mythid )
421  #endif /* ALLOW_TR10_CONTROL */  #endif /* ALLOW_TR10_CONTROL */
# Line 427  c-- Line 423  c--
423  c----------------------------------------------------------------------  c----------------------------------------------------------------------
424  c--  c--
425  #if (defined (ALLOW_SST_CONTROL))  #if (defined (ALLOW_SST_CONTROL))
426        call ctrl_init_rec (        call ctrl_init_rec (
427       I     xx_sststartdate1, xx_sststartdate2, xx_sstperiod, 1,       I     xx_sststartdate1, xx_sststartdate2, xx_sstperiod, 1,
428       O     xx_sststartdate, diffrec, startrec, endrec,       O     xx_sststartdate, diffrec, startrec, endrec,
429       I     mythid )       I     mythid )
430        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
431       &     xx_sst_file, 18, 118, diffrec, startrec, endrec,       &     xx_sst_file, 18, 118, diffrec, startrec, endrec,
432       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
433    
434  #elif (defined (ALLOW_SST0_CONTROL))  #elif (defined (ALLOW_SST0_CONTROL))
435        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
436       &     xx_sst_file, 18, 118, 1, 1, 1,       &     xx_sst_file, 18, 118, 1, 1, 1,
437       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
438    
# Line 445  c-- Line 441  c--
441  c----------------------------------------------------------------------  c----------------------------------------------------------------------
442  c--  c--
443  #if (defined (ALLOW_SSS_CONTROL))  #if (defined (ALLOW_SSS_CONTROL))
444        call ctrl_init_rec (        call ctrl_init_rec (
445       I     xx_sssstartdate1, xx_sssstartdate2, xx_sssperiod, 1,       I     xx_sssstartdate1, xx_sssstartdate2, xx_sssperiod, 1,
446       O     xx_sssstartdate, diffrec, startrec, endrec,       O     xx_sssstartdate, diffrec, startrec, endrec,
447       I     mythid )       I     mythid )
448        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
449       &     xx_sss_file, 19, 119, diffrec, startrec, endrec,       &     xx_sss_file, 19, 119, diffrec, startrec, endrec,
450       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
451    
452  #elif (defined (ALLOW_SSS0_CONTROL))  #elif (defined (ALLOW_SSS0_CONTROL))
453        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
454       &     xx_sss_file, 19, 119, 1, 1, 1,       &     xx_sss_file, 19, 119, 1, 1, 1,
455       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
456          
457  #endif /* ALLOW_SSS0_CONTROL */  #endif /* ALLOW_SSS0_CONTROL */
458    
459  c----------------------------------------------------------------------  c----------------------------------------------------------------------
460  c--  c--
461  #ifdef ALLOW_DEPTH_CONTROL  #ifdef ALLOW_DEPTH_CONTROL
462          call ctrl_init_ctrlvar (          call ctrl_init_ctrlvar (
463       &       xx_depth_file, 20, 120, 1, 1, 1,       &       xx_depth_file, 20, 120, 1, 1, 1,
464       &       snx, sny,  1, 'c', 'xy', mythid )       &       snx, sny,  1, 'c', 'xy', mythid )
465  #endif /* ALLOW_DEPTH_CONTROL */  #endif /* ALLOW_DEPTH_CONTROL */
# Line 471  c-- Line 467  c--
467  c----------------------------------------------------------------------  c----------------------------------------------------------------------
468  c--  c--
469  #ifdef ALLOW_EFLUXY0_CONTROL  #ifdef ALLOW_EFLUXY0_CONTROL
470          call ctrl_init_ctrlvar (          call ctrl_init_ctrlvar (
471       &       xx_efluxy_file, 21, 121, 1, 1, 1,       &       xx_efluxy_file, 21, 121, 1, 1, 1,
472       &       snx, sny, nr, 's', '3d', mythid )       &       snx, sny, nr, 's', '3d', mythid )
473  #endif /* ALLOW_EFLUXY0_CONTROL */  #endif /* ALLOW_EFLUXY0_CONTROL */
# Line 479  c-- Line 475  c--
475  c----------------------------------------------------------------------  c----------------------------------------------------------------------
476  c--  c--
477  #ifdef ALLOW_EFLUXP0_CONTROL  #ifdef ALLOW_EFLUXP0_CONTROL
478          call ctrl_init_ctrlvar (          call ctrl_init_ctrlvar (
479       &       xx_efluxp_file, 22, 122, 1, 1, 1,       &       xx_efluxp_file, 22, 122, 1, 1, 1,
480       &       snx, sny, nr, 'v', '3d', mythid )       &       snx, sny, nr, 'v', '3d', mythid )
481  #endif /* ALLOW_EFLUXP0_CONTROL */  #endif /* ALLOW_EFLUXP0_CONTROL */
# Line 487  c-- Line 483  c--
483  c----------------------------------------------------------------------  c----------------------------------------------------------------------
484  c--  c--
485  #ifdef ALLOW_BOTTOMDRAG_CONTROL  #ifdef ALLOW_BOTTOMDRAG_CONTROL
486          call ctrl_init_ctrlvar (          call ctrl_init_ctrlvar (
487       &       xx_bottomdrag_file, 23, 123, 1, 1, 1,       &       xx_bottomdrag_file, 23, 123, 1, 1, 1,
488       &       snx, sny, 1, 'c', 'xy', mythid )       &       snx, sny, 1, 'c', 'xy', mythid )
489  #endif /* ALLOW_BOTTOMDRAG_CONTROL */  #endif /* ALLOW_BOTTOMDRAG_CONTROL */
# Line 556  c--------------------------------------- Line 552  c---------------------------------------
552  c--  c--
553  #ifdef ALLOW_PRECIP_CONTROL  #ifdef ALLOW_PRECIP_CONTROL
554  c--   Atmos. precipitation  c--   Atmos. precipitation
555        call ctrl_init_rec (        call ctrl_init_rec (
556       I     xx_precipstartdate1, xx_precipstartdate2, xx_precipperiod,1,       I     xx_precipstartdate1, xx_precipstartdate2, xx_precipperiod,1,
557       O     xx_precipstartdate, diffrec, startrec, endrec,       O     xx_precipstartdate, diffrec, startrec, endrec,
558       I     mythid )       I     mythid )
559        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
560       &     xx_precip_file, 32, 132, diffrec, startrec, endrec,       &     xx_precip_file, 32, 132, diffrec, startrec, endrec,
561       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
562    
# Line 570  c--------------------------------------- Line 566  c---------------------------------------
566  c--  c--
567  #ifdef ALLOW_SWFLUX_CONTROL  #ifdef ALLOW_SWFLUX_CONTROL
568  c--   Atmos. swflux  c--   Atmos. swflux
569        call ctrl_init_rec (        call ctrl_init_rec (
570       I     xx_swfluxstartdate1, xx_swfluxstartdate2, xx_swfluxperiod, 1,       I     xx_swfluxstartdate1, xx_swfluxstartdate2, xx_swfluxperiod, 1,
571       O     xx_swfluxstartdate, diffrec, startrec, endrec,       O     xx_swfluxstartdate, diffrec, startrec, endrec,
572       I     mythid )       I     mythid )
573        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
574       &     xx_swflux_file, 33, 133, diffrec, startrec, endrec,       &     xx_swflux_file, 33, 133, diffrec, startrec, endrec,
575       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
576    
# Line 584  c--------------------------------------- Line 580  c---------------------------------------
580  c--  c--
581  #ifdef ALLOW_SWDOWN_CONTROL  #ifdef ALLOW_SWDOWN_CONTROL
582  c--   Atmos. swdown  c--   Atmos. swdown
583        call ctrl_init_rec (        call ctrl_init_rec (
584       I     xx_swdownstartdate1, xx_swdownstartdate2, xx_swdownperiod, 1,       I     xx_swdownstartdate1, xx_swdownstartdate2, xx_swdownperiod, 1,
585       O     xx_swdownstartdate, diffrec, startrec, endrec,       O     xx_swdownstartdate, diffrec, startrec, endrec,
586       I     mythid )       I     mythid )
587        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
588       &     xx_swdown_file, 34, 134, diffrec, startrec, endrec,       &     xx_swdown_file, 34, 134, diffrec, startrec, endrec,
589       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
590    
# Line 598  c--------------------------------------- Line 594  c---------------------------------------
594  c--  c--
595  #ifdef ALLOW_LWFLUX_CONTROL  #ifdef ALLOW_LWFLUX_CONTROL
596  c--   Atmos. lwflux  c--   Atmos. lwflux
597        call ctrl_init_rec (        call ctrl_init_rec (
598       I     xx_lwfluxstartdate1, xx_lwfluxstartdate2, xx_lwfluxperiod, 1,       I     xx_lwfluxstartdate1, xx_lwfluxstartdate2, xx_lwfluxperiod, 1,
599       O     xx_lwfluxstartdate, diffrec, startrec, endrec,       O     xx_lwfluxstartdate, diffrec, startrec, endrec,
600       I     mythid )       I     mythid )
601        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
602       &     xx_lwflux_file, 35, 135, diffrec, startrec, endrec,       &     xx_lwflux_file, 35, 135, diffrec, startrec, endrec,
603       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
604    
# Line 612  c--------------------------------------- Line 608  c---------------------------------------
608  c--  c--
609  #ifdef ALLOW_LWDOWN_CONTROL  #ifdef ALLOW_LWDOWN_CONTROL
610  c--   Atmos. lwdown  c--   Atmos. lwdown
611        call ctrl_init_rec (        call ctrl_init_rec (
612       I     xx_lwdownstartdate1, xx_lwdownstartdate2, xx_lwdownperiod, 1,       I     xx_lwdownstartdate1, xx_lwdownstartdate2, xx_lwdownperiod, 1,
613       O     xx_lwdownstartdate, diffrec, startrec, endrec,       O     xx_lwdownstartdate, diffrec, startrec, endrec,
614       I     mythid )       I     mythid )
615        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
616       &     xx_lwdown_file, 36, 136, diffrec, startrec, endrec,       &     xx_lwdown_file, 36, 136, diffrec, startrec, endrec,
617       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
618    
# Line 626  c--------------------------------------- Line 622  c---------------------------------------
622  c--  c--
623  #ifdef ALLOW_EVAP_CONTROL  #ifdef ALLOW_EVAP_CONTROL
624  c--   Atmos. evap  c--   Atmos. evap
625        call ctrl_init_rec (        call ctrl_init_rec (
626       I     xx_evapstartdate1, xx_evapstartdate2, xx_evapperiod, 1,       I     xx_evapstartdate1, xx_evapstartdate2, xx_evapperiod, 1,
627       O     xx_evapstartdate, diffrec, startrec, endrec,       O     xx_evapstartdate, diffrec, startrec, endrec,
628       I     mythid )       I     mythid )
629        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
630       &     xx_evap_file, 37, 137, diffrec, startrec, endrec,       &     xx_evap_file, 37, 137, diffrec, startrec, endrec,
631       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
632    
# Line 640  c--------------------------------------- Line 636  c---------------------------------------
636  c--  c--
637  #ifdef ALLOW_SNOWPRECIP_CONTROL  #ifdef ALLOW_SNOWPRECIP_CONTROL
638  c--   Atmos. snowprecip  c--   Atmos. snowprecip
639        call ctrl_init_rec (        call ctrl_init_rec (
640       I     xx_snowprecipstartdate1, xx_snowprecipstartdate2,       I     xx_snowprecipstartdate1, xx_snowprecipstartdate2,
641       I     xx_snowprecipperiod, 1,       I     xx_snowprecipperiod, 1,
642       O     xx_snowprecipstartdate, diffrec, startrec, endrec,       O     xx_snowprecipstartdate, diffrec, startrec, endrec,
643       I     mythid )       I     mythid )
644        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
645       &     xx_snowprecip_file, 38, 138, diffrec, startrec, endrec,       &     xx_snowprecip_file, 38, 138, diffrec, startrec, endrec,
646       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
647    
# Line 655  c--------------------------------------- Line 651  c---------------------------------------
651  c--  c--
652  #ifdef ALLOW_APRESSURE_CONTROL  #ifdef ALLOW_APRESSURE_CONTROL
653  c--   Atmos. apressure  c--   Atmos. apressure
654        call ctrl_init_rec (        call ctrl_init_rec (
655       I     xx_apressurestartdate1, xx_apressurestartdate2,       I     xx_apressurestartdate1, xx_apressurestartdate2,
656       I     xx_apressureperiod, 1,       I     xx_apressureperiod, 1,
657       O     xx_apressurestartdate, diffrec, startrec, endrec,       O     xx_apressurestartdate, diffrec, startrec, endrec,
658       I     mythid )       I     mythid )
659        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
660       &     xx_apressure_file, 39, 139, diffrec, startrec, endrec,       &     xx_apressure_file, 39, 139, diffrec, startrec, endrec,
661       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
662    
# Line 670  c--------------------------------------- Line 666  c---------------------------------------
666  c--  c--
667  #ifdef ALLOW_RUNOFF_CONTROL  #ifdef ALLOW_RUNOFF_CONTROL
668  c--   Atmos. runoff  c--   Atmos. runoff
669        call ctrl_init_rec (        call ctrl_init_rec (
670       I     xx_runoffstartdate1, xx_runoffstartdate2, xx_runoffperiod, 1,       I     xx_runoffstartdate1, xx_runoffstartdate2, xx_runoffperiod, 1,
671       O     xx_runoffstartdate, diffrec, startrec, endrec,       O     xx_runoffstartdate, diffrec, startrec, endrec,
672       I     mythid )       I     mythid )
673        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
674       &     xx_runoff_file, 40, 140, diffrec, startrec, endrec,       &     xx_runoff_file, 40, 140, diffrec, startrec, endrec,
675       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
676  #endif /* ALLOW_RUNOFF_CONTROL */  #endif /* ALLOW_RUNOFF_CONTROL */
# Line 683  c--------------------------------------- Line 679  c---------------------------------------
679  c--  c--
680  #ifdef ALLOW_SIAREA_CONTROL  #ifdef ALLOW_SIAREA_CONTROL
681  C--   so far there are no xx_siareastartdate1, etc., so we need to fudge it.  C--   so far there are no xx_siareastartdate1, etc., so we need to fudge it.
682  CML      call ctrl_init_rec (  CML      call ctrl_init_rec (
683  CML     I     xx_siareastartdate1, xx_siareastartdate2, xx_siareaperiod, 1,  CML     I     xx_siareastartdate1, xx_siareastartdate2, xx_siareaperiod, 1,
684  CML     O     xx_siareastartdate, diffrec, startrec, endrec,  CML     O     xx_siareastartdate, diffrec, startrec, endrec,
685  CML     I     mythid )  CML     I     mythid )
686        startrec = 1        startrec = 1
687        endrec   = 1        endrec   = 1
688        diffrec  = endrec - startrec + 1        diffrec  = endrec - startrec + 1
689        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
690       &     xx_siarea_file, 41, 141, diffrec, startrec, endrec,       &     xx_siarea_file, 41, 141, diffrec, startrec, endrec,
691       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
692  #endif /* ALLOW_siarea_CONTROL */  #endif /* ALLOW_siarea_CONTROL */
# Line 699  c--------------------------------------- Line 695  c---------------------------------------
695  c--  c--
696  #ifdef ALLOW_SIHEFF_CONTROL  #ifdef ALLOW_SIHEFF_CONTROL
697  C--   so far there are no xx_siheffstartdate1, etc., so we need to fudge it.  C--   so far there are no xx_siheffstartdate1, etc., so we need to fudge it.
698  CML      call ctrl_init_rec (  CML      call ctrl_init_rec (
699  CML     I     xx_siheffstartdate1, xx_siheffstartdate2, xx_siheffperiod, 1,  CML     I     xx_siheffstartdate1, xx_siheffstartdate2, xx_siheffperiod, 1,
700  CML     O     xx_siheffstartdate, diffrec, startrec, endrec,  CML     O     xx_siheffstartdate, diffrec, startrec, endrec,
701  CML     I     mythid )  CML     I     mythid )
702        startrec = 1        startrec = 1
703        endrec   = 1        endrec   = 1
704        diffrec  = endrec - startrec + 1        diffrec  = endrec - startrec + 1
705        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
706       &     xx_siheff_file, 42, 142, diffrec, startrec, endrec,       &     xx_siheff_file, 42, 142, diffrec, startrec, endrec,
707       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
708  #endif /* ALLOW_siheff_CONTROL */  #endif /* ALLOW_siheff_CONTROL */
# Line 715  c--------------------------------------- Line 711  c---------------------------------------
711  c--  c--
712  #ifdef ALLOW_SIHSNOW_CONTROL  #ifdef ALLOW_SIHSNOW_CONTROL
713  C--   so far there are no xx_sihsnowstartdate1, etc., so we need to fudge it.  C--   so far there are no xx_sihsnowstartdate1, etc., so we need to fudge it.
714  CML      call ctrl_init_rec (  CML      call ctrl_init_rec (
715  CML     I     xx_sihsnowstartdate1, xx_sihsnowstartdate2, xx_sihsnowperiod, 1,  CML     I     xx_sihsnowstartdate1, xx_sihsnowstartdate2, xx_sihsnowperiod, 1,
716  CML     O     xx_sihsnowstartdate, diffrec, startrec, endrec,  CML     O     xx_sihsnowstartdate, diffrec, startrec, endrec,
717  CML     I     mythid )  CML     I     mythid )
718        startrec = 1        startrec = 1
719        endrec   = 1        endrec   = 1
720        diffrec  = endrec - startrec + 1        diffrec  = endrec - startrec + 1
721        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
722       &     xx_sihsnow_file, 43, 143, diffrec, startrec, endrec,       &     xx_sihsnow_file, 43, 143, diffrec, startrec, endrec,
723       &     snx, sny, 1, 'c', 'xy', mythid )       &     snx, sny, 1, 'c', 'xy', mythid )
724  #endif /* ALLOW_sihsnow_CONTROL */  #endif /* ALLOW_sihsnow_CONTROL */
# Line 731  CML     I     mythid ) Line 727  CML     I     mythid )
727  c----------------------------------------------------------------------  c----------------------------------------------------------------------
728  c--  c--
729  #ifdef ALLOW_KAPREDI_CONTROL  #ifdef ALLOW_KAPREDI_CONTROL
730        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
731       &     xx_kapredi_file, 44, 144, 1, 1, 1,       &     xx_kapredi_file, 44, 144, 1, 1, 1,
732       &     snx, sny, nr, 'c', '3d', mythid )       &     snx, sny, nr, 'c', '3d', mythid )
733  #endif /* ALLOW_KAPREDI_CONTROL */  #endif /* ALLOW_KAPREDI_CONTROL */
# Line 741  c--------------------------------------- Line 737  c---------------------------------------
737    
738  #ifdef ALLOW_SHIFWFLX_CONTROL  #ifdef ALLOW_SHIFWFLX_CONTROL
739  c--   freshwater flux underneath ice-shelves  c--   freshwater flux underneath ice-shelves
740        call ctrl_init_rec (        call ctrl_init_rec (
741       I     xx_shifwflxstartdate1, xx_shifwflxstartdate2,       I     xx_shifwflxstartdate1, xx_shifwflxstartdate2,
742       I     xx_shifwflxperiod, 1,       I     xx_shifwflxperiod, 1,
743       O     xx_shifwflxstartdate, diffrec, startrec, endrec,       O     xx_shifwflxstartdate, diffrec, startrec, endrec,
744       I     mythid )       I     mythid )
745        call ctrl_init_ctrlvar (        call ctrl_init_ctrlvar (
746       &     xx_shifwflx_file, 45, 145, diffrec, startrec, endrec,       &     xx_shifwflx_file, 45, 145, diffrec, startrec, endrec,
747       &     snx, sny, 1, 'i', 'xy', mythid )       &     snx, sny, 1, 'i', 'xy', mythid )
748  #endif /* ALLOW_SHIFWFLX_CONTROL */  #endif /* ALLOW_SHIFWFLX_CONTROL */
# Line 755  c--------------------------------------- Line 751  c---------------------------------------
751  c----------------------------------------------------------------------  c----------------------------------------------------------------------
752    
753        call ctrl_init_wet( mythid )        call ctrl_init_wet( mythid )
754          
755  c----------------------------------------------------------------------  c----------------------------------------------------------------------
756  c----------------------------------------------------------------------  c----------------------------------------------------------------------
757    
# Line 798  c--------------------------------------- Line 794  c---------------------------------------
794          enddo          enddo
795         enddo         enddo
796        enddo        enddo
797    
798        return        return
799        end        end
800    
801        subroutine ctrl_init_rec(        subroutine ctrl_init_rec(
802       I     fldstartdate1, fldstartdate2, fldperiod, nfac,       I     fldstartdate1, fldstartdate2, fldperiod, nfac,
803       O     fldstartdate, diffrec, startrec, endrec,       O     fldstartdate, diffrec, startrec, endrec,
804       I     mythid )       I     mythid )
805    
# Line 811  c     ================================== Line 807  c     ==================================
807  c     SUBROUTINE ctrl_init_rec  c     SUBROUTINE ctrl_init_rec
808  c     ==================================================================  c     ==================================================================
809  c  c
810  c     helper routine to compute the first and last record of a  c     helper routine to compute the first and last record of a
811  c     time dependent control variable  c     time dependent control variable
812  c  c
813  c     Martin.Losch@awi.de, 2011-Mar-15  c     Martin.Losch@awi.de, 2011-Mar-15
# Line 820  c     ================================== Line 816  c     ==================================
816  c     SUBROUTINE ctrl_init_rec  c     SUBROUTINE ctrl_init_rec
817  c     ==================================================================  c     ==================================================================
818    
819        implicit none        implicit none
820    
821  c     == global variables ==  c     == global variables ==
822  #include "SIZE.h"  #include "SIZE.h"
# Line 829  c     == global variables == Line 825  c     == global variables ==
825  #ifdef ALLOW_CAL  #ifdef ALLOW_CAL
826  # include "cal.h"  # include "cal.h"
827  #endif  #endif
828          
829  c     == input variables ==  c     == input variables ==
830  c     fldstartdate1/2 : start time (date/time) of fld  c     fldstartdate1/2 : start time (date/time) of fld
831  c     fldperod        : sampling interval of fld  c     fldperod        : sampling interval of fld
# Line 841  c     mythid          : thread ID of thi Line 837  c     mythid          : thread ID of thi
837        _RL     fldperiod        _RL     fldperiod
838        integer nfac        integer nfac
839        integer mythid        integer mythid
840          
841  c     == output variables ==  c     == output variables ==
842  c     fldstartdate : full date from fldstartdate1 and 2  c     fldstartdate : full date from fldstartdate1 and 2
843  c     startrec     : first record of ctrl variable  c     startrec     : first record of ctrl variable
# Line 853  c     diffrec      : difference between Line 849  c     diffrec      : difference between
849        integer diffrec        integer diffrec
850    
851  c     == local variables ==  c     == local variables ==
852        integer i        integer i
853  #ifdef ALLOW_CAL  #ifdef ALLOW_CAL
854        integer difftime(4)        integer difftime(4)
855        _RL     diffsecs        _RL     diffsecs
# Line 864  c     initialise some output Line 860  c     initialise some output
860         fldstartdate(i) = 0         fldstartdate(i) = 0
861        end do        end do
862        startrec = 0        startrec = 0
863        endrec   = 0        endrec   = 0
864        diffrec  = 0        diffrec  = 0
865  # ifdef ALLOW_CAL  # ifdef ALLOW_CAL
866        call cal_FullDate( fldstartdate1, fldstartdate2,        call cal_FullDate( fldstartdate1, fldstartdate2,

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.22