/[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.3.6.4 by heimbach, Tue Mar 4 01:25:20 2003 UTC revision 1.3.6.5 by heimbach, Fri Mar 7 03:06:41 2003 UTC
# Line 49  c     == global variables == Line 49  c     == global variables ==
49  #include "SIZE.h"  #include "SIZE.h"
50  #include "PARAMS.h"  #include "PARAMS.h"
51  #include "GRID.h"  #include "GRID.h"
 #include "cal.h"  
52  #include "ctrl.h"  #include "ctrl.h"
53    
54    #ifdef ALLOW_CALENDAR
55    #include "cal.h"
56    #endif
57  #ifdef ALLOW_OBCS_CONTROL  #ifdef ALLOW_OBCS_CONTROL
58  # include "OBCS.h"  # include "OBCS.h"
59  #endif  #endif
   
60  #ifdef ALLOW_ECCO_OPTIMIZATION  #ifdef ALLOW_ECCO_OPTIMIZATION
61  #include "optim.h"  #include "optim.h"
62  #endif  #endif
# Line 123  c--   Read the namelist input. Line 125  c--   Read the namelist input.
125       &  xx_obcsw_file,       &  xx_obcsw_file,
126       &  xx_obcswstartdate1,  xx_obcswstartdate2,  xx_obcswperiod,       &  xx_obcswstartdate1,  xx_obcswstartdate2,  xx_obcswperiod,
127       &  xx_obcse_file,       &  xx_obcse_file,
128       &  xx_obcsestartdate1,  xx_obcsestartdate2,  xx_obcseperiod       &  xx_obcsestartdate1,  xx_obcsestartdate2,  xx_obcseperiod,
129         &  xx_diffkr_file,
130         &  xx_kapgm_file,
131         &  xx_tr1_file,
132         &  xx_sst_file,
133         &  xx_sss_file,
134         &  xx_hfacc_file,
135         &  xx_efluxy_file,
136         &  xx_efluxp_file,
137         &  xx_bottomdrag_file
138    
139        namelist /ctrl_packnames/        namelist /ctrl_packnames/
140       &  yadmark,       &  yadmark, yctrlid,
141       &  ctrlname, costname, scalname, maskname, metaname       &  ctrlname, costname, scalname, maskname, metaname
142    
143        jtlo = mybylo(mythid)        jtlo = mybylo(mythid)
# Line 191  c--     Set default values. Line 202  c--     Set default values.
202          xx_obcsestartdate2  =   0          xx_obcsestartdate2  =   0
203          xx_obcseperiod      =   0. _d 0          xx_obcseperiod      =   0. _d 0
204          xx_obcse_file       = ' '          xx_obcse_file       = ' '
205          yadmark            = 'ad'          xx_diffkr_file      = ' '
206          ctrlname           = ' '          xx_kapgm_file       = ' '
207          costname           = ' '          xx_tr1_file         = ' '
208          scalname           = ' '          xx_sst_file         = ' '
209          maskname           = ' '          xx_sss_file         = ' '
210          metaname           = ' '          xx_hfacc_file       = ' '
211            xx_efluxy_file      = ' '
212            xx_efluxp_file      = ' '
213            xx_bottomdrag_file  = ' '
214    
215            yadmark             = 'ad'
216            yctrlid             = 'MIT_CE_000'
217            ctrlname            = ' '
218            costname            = ' '
219            scalname            = ' '
220            maskname            = ' '
221            metaname            = ' '
222    
223  c--     Check versions.  c--     Check versions.
224    
# Line 223  c--     Next, read the ecco data file. Line 245  c--     Next, read the ecco data file.
245          read(unit = scrunit1, nml = ctrl_packnames)          read(unit = scrunit1, nml = ctrl_packnames)
246          close( scrunit1 )          close( scrunit1 )
247    
248    #ifdef ALLOW_CALENDAR
249    
250  c--     Get the complete dates of the control variables.  c--     Get the complete dates of the control variables.
251  #if     (defined  (ALLOW_HFLUX_CONTROL))  #if     (defined  (ALLOW_HFLUX_CONTROL))
252  c--     The heat flux contribution.  c--     The heat flux contribution.
# Line 275  c--     Merid. wind speed contribution. Line 299  c--     Merid. wind speed contribution.
299       &                     xx_obcsestartdate,   mythid )       &                     xx_obcsestartdate,   mythid )
300  #endif  #endif
301    
302    #endif /* ALLOW_CALENDAR */
303    
304  c--     Set default values.  c--     Set default values.
305          do ivarindex = 1,maxcvars          do ivarindex = 1,maxcvars
306            ncvarindex(ivarindex) = -1            ncvarindex(ivarindex) = -1
# Line 318  cph    index 11-14 reserved for open bou Line 344  cph    index 11-14 reserved for open bou
344  cph    index 15-16 reserved for mixing coeff.  cph    index 15-16 reserved for mixing coeff.
345  cph    index 17    reserved for passive tracer TR1  cph    index 17    reserved for passive tracer TR1
346  cph    index 18,19 reserved for sst, sss  cph    index 18,19 reserved for sst, sss
347    cph    index 20             for hFacC
348    cph    index 21-22          for efluxy, efluxp
349    cph    index 23-24          for bottom drag
350  cph)  cph)
351    
352    c-------------------------------------------------------------------------------------------
353    c--
354  #ifdef ALLOW_THETA0_CONTROL  #ifdef ALLOW_THETA0_CONTROL
355  c--   Initial state temperature contribution.  c--   Initial state temperature contribution.
356    
# Line 335  c--   Initial state temperature contribu Line 366  c--   Initial state temperature contribu
366    
367  #endif /* ALLOW_THETA0_CONTROL */  #endif /* ALLOW_THETA0_CONTROL */
368    
369    c-------------------------------------------------------------------------------------------
370    c--
371  #ifdef ALLOW_SALT0_CONTROL  #ifdef ALLOW_SALT0_CONTROL
372  c--   Initial state salinity contribution.  c--   Initial state salinity contribution.
373    
# Line 354  c--   =========================== Line 387  c--   ===========================
387  c--   Surface flux contributions.  c--   Surface flux contributions.
388  c--   ===========================  c--   ===========================
389    
390    c-------------------------------------------------------------------------------------------
391    c--
392  #if (defined (ALLOW_HFLUX_CONTROL))  #if (defined (ALLOW_HFLUX_CONTROL))
393  c--   Heat flux.  c--   Heat flux.
394    
395        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
396    #ifdef ALLOW_CALENDAR
397          call cal_TimePassed( xx_hfluxstartdate, modelstartdate,          call cal_TimePassed( xx_hfluxstartdate, modelstartdate,
398       &                       difftime, mythid )       &                       difftime, mythid )
399          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 365  c--   Heat flux. Line 401  c--   Heat flux.
401       &                 xx_hfluxperiod) + 1       &                 xx_hfluxperiod) + 1
402          endrec   = int((modelend   - diffsecs - modelstep)/          endrec   = int((modelend   - diffsecs - modelstep)/
403       &                 xx_hfluxperiod) + 2       &                 xx_hfluxperiod) + 2
404    #else
405            startrec = 1
406            endrec   = 1
407    #endif
408          ivarindex                = 3          ivarindex                = 3
409          ncvarindex(ivarindex)    = 103          ncvarindex(ivarindex)    = 103
410          ncvarrecs(ivarindex)     = endrec - startrec + 1          ncvarrecs(ivarindex)     = endrec - startrec + 1
# Line 380  c--   Heat flux. Line 420  c--   Heat flux.
420  c--   Atmos. temperature  c--   Atmos. temperature
421    
422        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
423    #ifdef ALLOW_CALENDAR
424          call cal_TimePassed( xx_atempstartdate, modelstartdate,          call cal_TimePassed( xx_atempstartdate, modelstartdate,
425       &                       difftime, mythid )       &                       difftime, mythid )
426          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 387  c--   Atmos. temperature Line 428  c--   Atmos. temperature
428       &                 xx_atempperiod) + 1       &                 xx_atempperiod) + 1
429          endrec   = int((modelend   - diffsecs - modelstep)/          endrec   = int((modelend   - diffsecs - modelstep)/
430       &                 xx_atempperiod) + 2       &                 xx_atempperiod) + 2
431    #else
432            startrec = 1
433            endrec   = 1
434    #endif
435          ivarindex                = 7          ivarindex                = 7
436          ncvarindex(ivarindex)    = 107          ncvarindex(ivarindex)    = 107
437          ncvarrecs(ivarindex)     = endrec - startrec + 1          ncvarrecs(ivarindex)     = endrec - startrec + 1
# Line 398  c--   Atmos. temperature Line 443  c--   Atmos. temperature
443          ncvargrd(ivarindex)      = 'c'          ncvargrd(ivarindex)      = 'c'
444        _END_MASTER( mythid )        _END_MASTER( mythid )
445    
446    #elif (defined (ALLOW_HFLUX0_CONTROL))
447    c--   initial forcing only
448          _BEGIN_MASTER( mythid )
449            ncvarindex(3) = 103
450            ncvarrecs(3)  =   1
451            ncvarxmax(3)  = snx
452            ncvarymax(3)  = sny
453            ncvarnrmax(3) =   1
454            ncvargrd(3)   = 'c'
455          _END_MASTER( mythid )
456    
457  #endif /* ALLOW_HFLUX_CONTROL */  #endif /* ALLOW_HFLUX_CONTROL */
458    
459    c-------------------------------------------------------------------------------------------
460    c--
461  #if (defined (ALLOW_SFLUX_CONTROL))  #if (defined (ALLOW_SFLUX_CONTROL))
462  c--   Salt flux.  c--   Salt flux.
463    
464        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
465    #ifdef ALLOW_CALENDAR
466          call cal_TimePassed( xx_sfluxstartdate, modelstartdate,          call cal_TimePassed( xx_sfluxstartdate, modelstartdate,
467       &                       difftime, mythid )       &                       difftime, mythid )
468          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 411  c--   Salt flux. Line 470  c--   Salt flux.
470       &                 xx_sfluxperiod) + 1       &                 xx_sfluxperiod) + 1
471          endrec   = int((modelend   - diffsecs - modelstep)/          endrec   = int((modelend   - diffsecs - modelstep)/
472       &                 xx_sfluxperiod) + 2       &                 xx_sfluxperiod) + 2
473    #else
474            startrec = 1
475            endrec   = 1
476    #endif
477          ivarindex                = 4          ivarindex                = 4
478          ncvarindex(ivarindex)    = 104          ncvarindex(ivarindex)    = 104
479          ncvarrecs(ivarindex)     = endrec - startrec + 1          ncvarrecs(ivarindex)     = endrec - startrec + 1
# Line 426  c--   Salt flux. Line 489  c--   Salt flux.
489  c--   Atmos. humidity  c--   Atmos. humidity
490    
491        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
492    #ifdef ALLOW_CALENDAR
493          call cal_TimePassed( xx_aqhstartdate, modelstartdate,          call cal_TimePassed( xx_aqhstartdate, modelstartdate,
494       &                       difftime, mythid )       &                       difftime, mythid )
495          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 433  c--   Atmos. humidity Line 497  c--   Atmos. humidity
497       &                 xx_aqhperiod) + 1       &                 xx_aqhperiod) + 1
498          endrec   = int((modelend   - diffsecs - modelstep)/          endrec   = int((modelend   - diffsecs - modelstep)/
499       &                 xx_aqhperiod) + 2       &                 xx_aqhperiod) + 2
500    #else
501            startrec = 1
502            endrec   = 1
503    #endif
504          ivarindex                = 8          ivarindex                = 8
505          ncvarindex(ivarindex)    = 108          ncvarindex(ivarindex)    = 108
506          ncvarrecs(ivarindex)     = endrec - startrec + 1          ncvarrecs(ivarindex)     = endrec - startrec + 1
# Line 444  c--   Atmos. humidity Line 512  c--   Atmos. humidity
512          ncvargrd(ivarindex)      = 'c'          ncvargrd(ivarindex)      = 'c'
513        _END_MASTER( mythid )        _END_MASTER( mythid )
514    
515    #elif (defined (ALLOW_SFLUX0_CONTROL))
516    c--   initial forcing only
517          _BEGIN_MASTER( mythid )
518            ncvarindex(4) = 104
519            ncvarrecs(4)  =   1
520            ncvarxmax(4)  = snx
521            ncvarymax(4)  = sny
522            ncvarnrmax(4) =   1
523            ncvargrd(4)   = 'c'
524          _END_MASTER( mythid )
525    
526  #endif /* ALLOW_SFLUX_CONTROL */  #endif /* ALLOW_SFLUX_CONTROL */
527    
528    c-------------------------------------------------------------------------------------------
529    c--
530  #if (defined (ALLOW_USTRESS_CONTROL))  #if (defined (ALLOW_USTRESS_CONTROL))
531  c--   Zonal wind stress.  c--   Zonal wind stress.
532    
533        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
534    #ifdef ALLOW_CALENDAR
535          call cal_TimePassed( xx_tauustartdate, modelstartdate,          call cal_TimePassed( xx_tauustartdate, modelstartdate,
536       &                       difftime, mythid )       &                       difftime, mythid )
537          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 457  c--   Zonal wind stress. Line 539  c--   Zonal wind stress.
539       &                 xx_tauuperiod) + 1       &                 xx_tauuperiod) + 1
540          endrec   = int((modelend   - diffsecs - modelstep)/          endrec   = int((modelend   - diffsecs - modelstep)/
541       &                 xx_tauuperiod) + 2       &                 xx_tauuperiod) + 2
542    #else
543            startrec = 1
544            endrec   = 1
545    #endif
546          ivarindex                = 5          ivarindex                = 5
547          ncvarindex(ivarindex)    = 105          ncvarindex(ivarindex)    = 105
548          ncvarrecs(ivarindex)     = endrec - startrec + 1          ncvarrecs(ivarindex)     = endrec - startrec + 1
# Line 472  c--   Zonal wind stress. Line 558  c--   Zonal wind stress.
558  c--   Zonal wind speed.  c--   Zonal wind speed.
559    
560        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
561    #ifdef ALLOW_CALENDAR
562          call cal_TimePassed( xx_uwindstartdate, modelstartdate,          call cal_TimePassed( xx_uwindstartdate, modelstartdate,
563       &                       difftime, mythid )       &                       difftime, mythid )
564          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 479  c--   Zonal wind speed. Line 566  c--   Zonal wind speed.
566       &                 xx_uwindperiod) + 1       &                 xx_uwindperiod) + 1
567          endrec   = int((modelend   - diffsecs - modelstep)/          endrec   = int((modelend   - diffsecs - modelstep)/
568       &                 xx_uwindperiod) + 2       &                 xx_uwindperiod) + 2
569    #else
570            startrec = 1
571            endrec   = 1
572    #endif
573          ivarindex                = 9          ivarindex                = 9
574          ncvarindex(ivarindex)    = 109          ncvarindex(ivarindex)    = 109
575          ncvarrecs(ivarindex)     = endrec - startrec + 1          ncvarrecs(ivarindex)     = endrec - startrec + 1
# Line 490  c--   Zonal wind speed. Line 581  c--   Zonal wind speed.
581          ncvargrd(ivarindex)      = 'w'          ncvargrd(ivarindex)      = 'w'
582        _END_MASTER( mythid )        _END_MASTER( mythid )
583    
584    #elif (defined (ALLOW_TAUU0_CONTROL))
585    c--   initial forcing only
586          _BEGIN_MASTER( mythid )
587            ncvarindex(5) = 105
588            ncvarrecs(5)  =   1
589            ncvarxmax(5)  = snx
590            ncvarymax(5)  = sny
591            ncvarnrmax(5) =   1
592            ncvargrd(5)   = 'w'
593          _END_MASTER( mythid )
594    
595  #endif /* ALLOW_USTRESS_CONTROL */  #endif /* ALLOW_USTRESS_CONTROL */
596    
597    c-------------------------------------------------------------------------------------------
598    c--
599  #if (defined (ALLOW_VSTRESS_CONTROL))  #if (defined (ALLOW_VSTRESS_CONTROL))
600  c--   Meridional wind stress.  c--   Meridional wind stress.
601    
602        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
603    #ifdef ALLOW_CALENDAR
604          call cal_TimePassed( xx_tauvstartdate, modelstartdate,          call cal_TimePassed( xx_tauvstartdate, modelstartdate,
605       &                       difftime, mythid )       &                       difftime, mythid )
606          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 503  c--   Meridional wind stress. Line 608  c--   Meridional wind stress.
608       &                 xx_tauvperiod) + 1       &                 xx_tauvperiod) + 1
609          endrec   = int((modelend   - diffsecs - modelstep)/          endrec   = int((modelend   - diffsecs - modelstep)/
610       &                 xx_tauvperiod) + 2       &                 xx_tauvperiod) + 2
611    #else
612            startrec = 1
613            endrec   = 1
614    #endif
615          ivarindex                = 6          ivarindex                = 6
616          ncvarindex(ivarindex)    = 106          ncvarindex(ivarindex)    = 106
617          ncvarrecs(ivarindex)     = endrec - startrec + 1          ncvarrecs(ivarindex)     = endrec - startrec + 1
# Line 518  c--   Meridional wind stress. Line 627  c--   Meridional wind stress.
627  c--   Meridional wind speed.  c--   Meridional wind speed.
628    
629        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
630    #ifdef ALLOW_CALENDAR
631          call cal_TimePassed( xx_vwindstartdate, modelstartdate,          call cal_TimePassed( xx_vwindstartdate, modelstartdate,
632       &                       difftime, mythid )       &                       difftime, mythid )
633          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 525  c--   Meridional wind speed. Line 635  c--   Meridional wind speed.
635       &                 xx_vwindperiod) + 1       &                 xx_vwindperiod) + 1
636          endrec   = int((modelend   - diffsecs - modelstep)/          endrec   = int((modelend   - diffsecs - modelstep)/
637       &                 xx_vwindperiod) + 2       &                 xx_vwindperiod) + 2
638    #else
639            startrec = 1
640            endrec   = 1
641    #endif
642          ivarindex                = 10          ivarindex                = 10
643          ncvarindex(ivarindex)    = 110          ncvarindex(ivarindex)    = 110
644          ncvarrecs(ivarindex)     = endrec - startrec + 1          ncvarrecs(ivarindex)     = endrec - startrec + 1
# Line 536  c--   Meridional wind speed. Line 650  c--   Meridional wind speed.
650          ncvargrd(ivarindex)      = 's'          ncvargrd(ivarindex)      = 's'
651        _END_MASTER( mythid )        _END_MASTER( mythid )
652    
653    #elif (defined (ALLOW_TAUV0_CONTROL))
654    c--   initial forcing only
655          _BEGIN_MASTER( mythid )
656            ncvarindex(6) = 106
657            ncvarrecs(6)  =   1
658            ncvarxmax(6)  = snx
659            ncvarymax(6)  = sny
660            ncvarnrmax(6) =   1
661            ncvargrd(6)   = 's'
662          _END_MASTER( mythid )
663    
664  #endif /* ALLOW_VSTRESS_CONTROL */  #endif /* ALLOW_VSTRESS_CONTROL */
665    
666    c-------------------------------------------------------------------------------------------
667    c--
668  #ifdef ALLOW_OBCSN_CONTROL  #ifdef ALLOW_OBCSN_CONTROL
669  c--   Northern obc.  c--   Northern obc.
670    
671        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
672    #ifdef ALLOW_CALENDAR
673          call cal_TimePassed( xx_obcsnstartdate, modelstartdate,          call cal_TimePassed( xx_obcsnstartdate, modelstartdate,
674       &                       difftime, mythid )       &                       difftime, mythid )
675          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 549  c--   Northern obc. Line 677  c--   Northern obc.
677       &                 xx_obcsnperiod) + 1       &                 xx_obcsnperiod) + 1
678          endrec   = int((modelend   - diffsecs)/          endrec   = int((modelend   - diffsecs)/
679       &                 xx_obcsnperiod) + 2       &                 xx_obcsnperiod) + 2
680    #else
681            startrec = 1
682            endrec   = 1
683    #endif
684          ivarindex                = 11          ivarindex                = 11
685          ncvarindex(ivarindex)    = 111          ncvarindex(ivarindex)    = 111
686          ncvarrecs(ivarindex)     = (endrec - startrec + 1)*nobcs          ncvarrecs(ivarindex)     = (endrec - startrec + 1)*nobcs
# Line 565  c--   Northern obc. Line 697  c--   Northern obc.
697  #ifdef ALLOW_OBCSS_CONTROL  #ifdef ALLOW_OBCSS_CONTROL
698  c--   Southern obc.  c--   Southern obc.
699    
700    c-------------------------------------------------------------------------------------------
701    c--
702        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
703    #ifdef ALLOW_CALENDAR
704          call cal_TimePassed( xx_obcssstartdate, modelstartdate,          call cal_TimePassed( xx_obcssstartdate, modelstartdate,
705       &                       difftime, mythid )       &                       difftime, mythid )
706          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 573  c--   Southern obc. Line 708  c--   Southern obc.
708       &                 xx_obcssperiod) + 1       &                 xx_obcssperiod) + 1
709          endrec   = int((modelend   - diffsecs)/          endrec   = int((modelend   - diffsecs)/
710       &                 xx_obcssperiod) + 2       &                 xx_obcssperiod) + 2
711    #else
712            startrec = 1
713            endrec   = 1
714    #endif
715          ivarindex                = 12          ivarindex                = 12
716          ncvarindex(ivarindex)    = 112          ncvarindex(ivarindex)    = 112
717          ncvarrecs(ivarindex)     = (endrec - startrec + 1)*nobcs          ncvarrecs(ivarindex)     = (endrec - startrec + 1)*nobcs
# Line 586  c--   Southern obc. Line 725  c--   Southern obc.
725    
726  #endif /* ALLOW_OBCSS_CONTROL */  #endif /* ALLOW_OBCSS_CONTROL */
727    
728    c-------------------------------------------------------------------------------------------
729    c--
730  #ifdef ALLOW_OBCSW_CONTROL  #ifdef ALLOW_OBCSW_CONTROL
731  c--   Western obc.  c--   Western obc.
732    
733        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
734    #ifdef ALLOW_CALENDAR
735          call cal_TimePassed( xx_obcswstartdate, modelstartdate,          call cal_TimePassed( xx_obcswstartdate, modelstartdate,
736       &                       difftime, mythid )       &                       difftime, mythid )
737          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 597  c--   Western obc. Line 739  c--   Western obc.
739       &                 xx_obcswperiod) + 1       &                 xx_obcswperiod) + 1
740          endrec   = int((modelend   - diffsecs)/          endrec   = int((modelend   - diffsecs)/
741       &                 xx_obcswperiod) + 2       &                 xx_obcswperiod) + 2
742    #else
743            startrec = 1
744            endrec   = 1
745    #endif
746          ivarindex                = 13          ivarindex                = 13
747          ncvarindex(ivarindex)    = 113          ncvarindex(ivarindex)    = 113
748          ncvarrecs(ivarindex)     = (endrec - startrec + 1)*nobcs          ncvarrecs(ivarindex)     = (endrec - startrec + 1)*nobcs
# Line 610  c--   Western obc. Line 756  c--   Western obc.
756    
757  #endif /* ALLOW_OBCSW_CONTROL */  #endif /* ALLOW_OBCSW_CONTROL */
758    
759    c-------------------------------------------------------------------------------------------
760    c--
761  #ifdef ALLOW_OBCSE_CONTROL  #ifdef ALLOW_OBCSE_CONTROL
762  c--   Eastern obc.  c--   Eastern obc.
763    
764        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
765    #ifdef ALLOW_CALENDAR
766          call cal_TimePassed( xx_obcsestartdate, modelstartdate,          call cal_TimePassed( xx_obcsestartdate, modelstartdate,
767       &                       difftime, mythid )       &                       difftime, mythid )
768          call cal_ToSeconds ( difftime, diffsecs, mythid )          call cal_ToSeconds ( difftime, diffsecs, mythid )
# Line 621  c--   Eastern obc. Line 770  c--   Eastern obc.
770       &                 xx_obcseperiod) + 1       &                 xx_obcseperiod) + 1
771          endrec   = int((modelend   - diffsecs)/          endrec   = int((modelend   - diffsecs)/
772       &                 xx_obcseperiod) + 2       &                 xx_obcseperiod) + 2
773    #else
774            startrec = 1
775            endrec   = 1
776    #endif
777          ivarindex                = 14          ivarindex                = 14
778          ncvarindex(ivarindex)    = 114          ncvarindex(ivarindex)    = 114
779          ncvarrecs(ivarindex)     = (endrec - startrec + 1)*nobcs          ncvarrecs(ivarindex)     = (endrec - startrec + 1)*nobcs
# Line 634  c--   Eastern obc. Line 787  c--   Eastern obc.
787    
788  #endif /* ALLOW_OBCSE_CONTROL */  #endif /* ALLOW_OBCSE_CONTROL */
789    
790    c-------------------------------------------------------------------------------------------
791    c--
792  #ifdef ALLOW_DIFFKR_CONTROL  #ifdef ALLOW_DIFFKR_CONTROL
793        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
794          ivarindex                = 15          ivarindex                = 15
# Line 646  c--   Eastern obc. Line 801  c--   Eastern obc.
801        _END_MASTER( mythid )        _END_MASTER( mythid )
802  #endif /* ALLOW_DIFFKR_CONTROL */  #endif /* ALLOW_DIFFKR_CONTROL */
803    
804    c-------------------------------------------------------------------------------------------
805    c--
806  #ifdef ALLOW_KAPGM_CONTROL  #ifdef ALLOW_KAPGM_CONTROL
807        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
808          ivarindex                = 16          ivarindex                = 16
# Line 658  c--   Eastern obc. Line 815  c--   Eastern obc.
815        _END_MASTER( mythid )        _END_MASTER( mythid )
816  #endif /* ALLOW_KAPGM_CONTROL */  #endif /* ALLOW_KAPGM_CONTROL */
817    
818    c-------------------------------------------------------------------------------------------
819    c--
820  #ifdef ALLOW_TR10_CONTROL  #ifdef ALLOW_TR10_CONTROL
821        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
822          ivarindex                = 17          ivarindex                = 17
# Line 670  c--   Eastern obc. Line 829  c--   Eastern obc.
829        _END_MASTER( mythid )        _END_MASTER( mythid )
830  #endif /* ALLOW_TR10_CONTROL */  #endif /* ALLOW_TR10_CONTROL */
831    
832    c-------------------------------------------------------------------------------------------
833    c--
834    #ifdef ALLOW_SST0_CONTROL
835          _BEGIN_MASTER( mythid )
836            ivarindex                = 18
837            ncvarindex(ivarindex)    = 118
838            ncvarrecs (ivarindex)    =   1
839            ncvarxmax (ivarindex)    = snx
840            ncvarymax (ivarindex)    = sny
841            ncvarnrmax(ivarindex)    =   1
842            ncvargrd  (ivarindex)    = 'c'
843          _END_MASTER( mythid )
844    #endif /* ALLOW_SST0_CONTROL */
845    
846    c-------------------------------------------------------------------------------------------
847    c--
848    #ifdef ALLOW_SSS0_CONTROL
849          _BEGIN_MASTER( mythid )
850            ivarindex                = 19
851            ncvarindex(ivarindex)    = 119
852            ncvarrecs (ivarindex)    =   1
853            ncvarxmax (ivarindex)    = snx
854            ncvarymax (ivarindex)    = sny
855            ncvarnrmax(ivarindex)    =   1
856            ncvargrd  (ivarindex)    = 'c'
857          _END_MASTER( mythid )
858    #endif /* ALLOW_SSS0_CONTROL */
859    
860    c-------------------------------------------------------------------------------------------
861    c--
862    #ifdef ALLOW_HFACC_CONTROL
863          _BEGIN_MASTER( mythid )
864            ivarindex                = 20
865            ncvarindex(ivarindex)    = 120
866            ncvarrecs (ivarindex)    =   1
867            ncvarxmax (ivarindex)    = snx
868            ncvarymax (ivarindex)    = sny
869            ncvargrd  (ivarindex)    = 'c'
870    #ifdef ALLOW_HFACC3D_CONTROL
871            ncvarnrmax(ivarindex)    =  nr
872    #else
873            ncvarnrmax(ivarindex)    =   1
874    #endif /*ALLOW_HFACC3D_CONTROL*/
875          _END_MASTER( mythid )
876    #endif /* ALLOW_HFACC_CONTROL */
877    
878    c-------------------------------------------------------------------------------------------
879    c--
880  #ifdef ALLOW_EFLUXY0_CONTROL  #ifdef ALLOW_EFLUXY0_CONTROL
881        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
882          ivarindex                = 21          ivarindex                = 21
883          ncvarindex(ivarindex)    = 121          ncvarindex(ivarindex)    = 121
884          ncvarrecs(ivarindex)     =   1          ncvarrecs(ivarindex)     =   1
885          ncvarxmax(ivarindex)     = snx          ncvarxmax(ivarindex)     = snx
886            ncvarymax(ivarindex)     = sny
887          ncvarnrmax(ivarindex)    =  nr          ncvarnrmax(ivarindex)    =  nr
888          ncvargrd(ivarindex)      = 's'          ncvargrd(ivarindex)      = 's'
889        _END_MASTER( mythid )        _END_MASTER( mythid )
890  #endif /* ALLOW_EFLUXY0_CONTROL */  #endif /* ALLOW_EFLUXY0_CONTROL */
891    
892    c-------------------------------------------------------------------------------------------
893    c--
894  #ifdef ALLOW_EFLUXP0_CONTROL  #ifdef ALLOW_EFLUXP0_CONTROL
895        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
896          ivarindex                = 22          ivarindex                = 22
# Line 693  c--   Eastern obc. Line 903  c--   Eastern obc.
903        _END_MASTER( mythid )        _END_MASTER( mythid )
904  #endif /* ALLOW_EFLUXP0_CONTROL */  #endif /* ALLOW_EFLUXP0_CONTROL */
905    
906    c-------------------------------------------------------------------------------------------
907    c--
908    #ifdef ALLOW_BOTTOMDRAG_CONTROL
909          _BEGIN_MASTER( mythid )
910            ivarindex                = 23
911            ncvarindex(ivarindex)    = 123
912            ncvarrecs (ivarindex)    =   1
913            ncvarxmax (ivarindex)    = snx
914            ncvarymax (ivarindex)    = sny
915            ncvarnrmax(ivarindex)    =   1
916            ncvargrd  (ivarindex)    = 'c'
917          _END_MASTER( mythid )
918    #endif /* ALLOW_BOTTOMDRAG_CONTROL */
919    
920    c-------------------------------------------------------------------------------------------
921    c-------------------------------------------------------------------------------------------
922    c-------------------------------------------------------------------------------------------
923    
924  c--   Determine the number of wet points in each tile:  c--   Determine the number of wet points in each tile:
925  c--   maskc, masks, and maskw.  c--   maskc, masks, and maskw.
926    
# Line 758  c--             West mask. Line 986  c--             West mask.
986                  endif                  endif
987  #if (defined (ALLOW_EFLUXP0_CONTROL))  #if (defined (ALLOW_EFLUXP0_CONTROL))
988  c--             Vertical mask.  c--             Vertical mask.
989                  if (hFacV(i,j,k,bi,bj) .eq. 1.) then                  if (hFacV(i,j,k,bi,bj) .ne. 0.) then
990                    nwetvtile(bi,bj,k) = nwetvtile(bi,bj,k) + 1                    nwetvtile(bi,bj,k) = nwetvtile(bi,bj,k) + 1
991                  endif                  endif
992  #endif  #endif
# Line 880  cph( Line 1108  cph(
1108           nwetc3d = nwetc3d + nwetctile(1,1,k)           nwetc3d = nwetc3d + nwetctile(1,1,k)
1109        end do        end do
1110        print *, 'ph-wet 5: 3D wet points = ', nwetc3d        print *, 'ph-wet 5: 3D wet points = ', nwetc3d
1111        do i = 1, 14        do i = 1, maxcvars
1112           print *, 'ph-wet 6: no recs for i = ', i, ncvarrecs(i)           print *, 'ph-wet 6: no recs for i = ', i, ncvarrecs(i)
1113        end do        end do
1114        print *, 'ph-wet 7: ',        print *, 'ph-wet 7: ',
# Line 917  cph( Line 1145  cph(
1145  #endif  #endif
1146  cph)  cph)
1147                
 c     Summation of wet point counters  
 c  
1148        CALL GLOBAL_SUM_INT( nvarlength,  myThid )        CALL GLOBAL_SUM_INT( nvarlength,  myThid )
1149    
1150        print *, 'ph-wet 13: global nvarlength vor k=', k, nvarlength        print *, 'ph-wet 13: global nvarlength vor k=', k, nvarlength
# Line 937  c Line 1163  c
1163           CALL GLOBAL_SUM_INT( ntmp,  myThid )           CALL GLOBAL_SUM_INT( ntmp,  myThid )
1164           nWetcGlobal(k)=ntmp           nWetcGlobal(k)=ntmp
1165    
1166             print *, 'ph-wet 14a: global nWet... vor k=', k, ntmp
1167    
1168           ntmp=0           ntmp=0
1169           do bj=1,nSy           do bj=1,nSy
1170              do bi=1,nSx              do bi=1,nSx
# Line 946  c Line 1174  c
1174           CALL GLOBAL_SUM_INT( ntmp,  myThid )           CALL GLOBAL_SUM_INT( ntmp,  myThid )
1175           nWetsGlobal(k)=ntmp           nWetsGlobal(k)=ntmp
1176    
1177             print *, 'ph-wet 14b: global nWet... vor k=', k, ntmp
1178    
1179           ntmp=0           ntmp=0
1180           do bj=1,nSy           do bj=1,nSy
1181              do bi=1,nSx              do bi=1,nSx
# Line 955  c Line 1185  c
1185           CALL GLOBAL_SUM_INT( ntmp,  myThid )           CALL GLOBAL_SUM_INT( ntmp,  myThid )
1186           nWetwGlobal(k)=ntmp           nWetwGlobal(k)=ntmp
1187    
1188             print *, 'ph-wet 14c: global nWet... vor k=', k, ntmp
1189    
1190             ntmp=0
1191             do bj=1,nSy
1192                do bi=1,nSx
1193                   ntmp=ntmp+nWetvTile(bi,bj,k)
1194                enddo
1195             enddo
1196             CALL GLOBAL_SUM_INT( ntmp,  myThid )
1197             nWetvGlobal(k)=ntmp
1198    
1199             print *, 'ph-wet 14d: global nWet... vor k=', k, ntmp
1200    
1201  #ifdef ALLOW_OBCSN_CONTROL  #ifdef ALLOW_OBCSN_CONTROL
1202           do iobcs = 1, nobcs           do iobcs = 1, nobcs
1203              ntmp=0              ntmp=0
# Line 1010  c Line 1253  c
1253        print*, 'ctrl_init: control vector length:    ', nvarlength        print*, 'ctrl_init: control vector length:    ', nvarlength
1254        _END_MASTER( mythid )        _END_MASTER( mythid )
1255    
1256  c--   Unpack the control vector.  c     write masks and weights to files to be read by a master process
1257  cph   No longer needed here  c
1258          call active_write_xyz( 'hFacC', hFacC,   1, 0, mythid, dummy)
1259          call active_write_xyz( 'maskW', maskW,   1, 0, mythid, dummy)
1260          call active_write_xyz( 'maskS', maskS,   1, 0, mythid, dummy)
1261    #if (defined (ALLOW_EFLUXP0_CONTROL))
1262          call active_write_xyz( 'hFacV', hFacV,   1, 0, mythid, dummy)
1263    #endif
1264    
1265  c--   Summarize the control vector's setup.  c--   Summarize the control vector's setup.
1266        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
1267          call ctrl_Summary( mythid )  cph        call ctrl_Summary( mythid )
1268        _END_MASTER( mythid )        _END_MASTER( mythid )
1269    
1270        _BARRIER        _BARRIER

Legend:
Removed from v.1.3.6.4  
changed lines
  Added in v.1.3.6.5

  ViewVC Help
Powered by ViewVC 1.1.22