66 |
#include "ctrl.h" |
#include "ctrl.h" |
67 |
|
|
68 |
#ifdef ALLOW_CALENDAR |
#ifdef ALLOW_CALENDAR |
69 |
#include "cal.h" |
# include "cal.h" |
70 |
#endif |
#endif |
71 |
#ifdef ALLOW_OBCS_CONTROL |
#ifdef ALLOW_OBCS_CONTROL |
72 |
# include "OBCS.h" |
# include "OBCS.h" |
73 |
#endif |
#endif |
74 |
#ifdef ALLOW_ECCO_OPTIMIZATION |
#ifdef ALLOW_ECCO_OPTIMIZATION |
75 |
#include "optim.h" |
# include "optim.h" |
76 |
#endif |
#endif |
77 |
|
|
78 |
c == routine arguments == |
c == routine arguments == |
112 |
|
|
113 |
c == end of interface == |
c == end of interface == |
114 |
|
|
115 |
c-- Read the namelist input. |
c-- Set loop ranges. |
|
namelist /ctrl_nml/ |
|
|
& xx_theta_file, |
|
|
& xx_salt_file, |
|
|
& xx_hflux_file, |
|
|
& xx_hfluxstartdate1, xx_hfluxstartdate2, xx_hfluxperiod, |
|
|
& xx_sflux_file, |
|
|
& xx_sfluxstartdate1, xx_sfluxstartdate2, xx_sfluxperiod, |
|
|
& xx_tauu_file, |
|
|
& xx_tauustartdate1, xx_tauustartdate2, xx_tauuperiod, |
|
|
& xx_tauv_file, |
|
|
& xx_tauvstartdate1, xx_tauvstartdate2, xx_tauvperiod, |
|
|
& xx_atemp_file, |
|
|
& xx_atempstartdate1, xx_atempstartdate2, xx_atempperiod, |
|
|
& xx_aqh_file, |
|
|
& xx_aqhstartdate1, xx_aqhstartdate2, xx_aqhperiod, |
|
|
& xx_uwind_file, |
|
|
& xx_uwindstartdate1, xx_uwindstartdate2, xx_uwindperiod, |
|
|
& xx_vwind_file, |
|
|
& xx_vwindstartdate1, xx_vwindstartdate2, xx_vwindperiod, |
|
|
& xx_obcsn_file, |
|
|
& xx_obcsnstartdate1, xx_obcsnstartdate2, xx_obcsnperiod, |
|
|
& xx_obcss_file, |
|
|
& xx_obcssstartdate1, xx_obcssstartdate2, xx_obcssperiod, |
|
|
& xx_obcsw_file, |
|
|
& xx_obcswstartdate1, xx_obcswstartdate2, xx_obcswperiod, |
|
|
& xx_obcse_file, |
|
|
& xx_obcsestartdate1, xx_obcsestartdate2, xx_obcseperiod, |
|
|
& xx_diffkr_file, |
|
|
& xx_kapgm_file, |
|
|
& xx_tr1_file, |
|
|
& xx_sst_file, |
|
|
& xx_sss_file, |
|
|
& xx_hfacc_file, |
|
|
& xx_efluxy_file, |
|
|
& xx_efluxp_file, |
|
|
& xx_bottomdrag_file |
|
|
|
|
|
namelist /ctrl_packnames/ |
|
|
& yadmark, yctrlid, |
|
|
& ctrlname, costname, scalname, maskname, metaname |
|
|
|
|
116 |
jtlo = mybylo(mythid) |
jtlo = mybylo(mythid) |
117 |
jthi = mybyhi(mythid) |
jthi = mybyhi(mythid) |
118 |
itlo = mybxlo(mythid) |
itlo = mybxlo(mythid) |
119 |
ithi = mybxhi(mythid) |
ithi = mybxhi(mythid) |
120 |
jmin = 1-oly |
jmin = 1 |
121 |
jmax = sny+oly |
jmax = sny |
122 |
imin = 1-olx |
imin = 1 |
123 |
imax = snx+olx |
imax = snx |
124 |
|
|
|
_BEGIN_MASTER( myThid ) |
|
125 |
|
|
126 |
c-- Set default values. |
_BEGIN_MASTER( myThid ) |
|
xx_theta_file = ' ' |
|
|
xx_salt_file = ' ' |
|
|
xx_hfluxstartdate1 = 0 |
|
|
xx_hfluxstartdate2 = 0 |
|
|
xx_hfluxperiod = 0. _d 0 |
|
|
xx_hflux_file = ' ' |
|
|
xx_sfluxstartdate1 = 0 |
|
|
xx_sfluxstartdate2 = 0 |
|
|
xx_sfluxperiod = 0. _d 0 |
|
|
xx_sflux_file = ' ' |
|
|
xx_tauustartdate1 = 0 |
|
|
xx_tauustartdate2 = 0 |
|
|
xx_tauuperiod = 0. _d 0 |
|
|
xx_tauu_file = ' ' |
|
|
xx_tauvstartdate1 = 0 |
|
|
xx_tauvstartdate2 = 0 |
|
|
xx_tauvperiod = 0. _d 0 |
|
|
xx_tauv_file = ' ' |
|
|
xx_atempstartdate1 = 0 |
|
|
xx_atempstartdate2 = 0 |
|
|
xx_atempperiod = 0. _d 0 |
|
|
xx_atemp_file = ' ' |
|
|
xx_aqhstartdate1 = 0 |
|
|
xx_aqhstartdate2 = 0 |
|
|
xx_aqhperiod = 0. _d 0 |
|
|
xx_aqh_file = ' ' |
|
|
xx_uwindstartdate1 = 0 |
|
|
xx_uwindstartdate2 = 0 |
|
|
xx_uwindperiod = 0. _d 0 |
|
|
xx_uwind_file = ' ' |
|
|
xx_vwindstartdate1 = 0 |
|
|
xx_vwindstartdate2 = 0 |
|
|
xx_vwindperiod = 0. _d 0 |
|
|
xx_vwind_file = ' ' |
|
|
xx_obcsnstartdate1 = 0 |
|
|
xx_obcsnstartdate2 = 0 |
|
|
xx_obcsnperiod = 0. _d 0 |
|
|
xx_obcsn_file = ' ' |
|
|
xx_obcssstartdate1 = 0 |
|
|
xx_obcssstartdate2 = 0 |
|
|
xx_obcssperiod = 0. _d 0 |
|
|
xx_obcss_file = ' ' |
|
|
xx_obcswstartdate1 = 0 |
|
|
xx_obcswstartdate2 = 0 |
|
|
xx_obcswperiod = 0. _d 0 |
|
|
xx_obcsw_file = ' ' |
|
|
xx_obcsestartdate1 = 0 |
|
|
xx_obcsestartdate2 = 0 |
|
|
xx_obcseperiod = 0. _d 0 |
|
|
xx_obcse_file = ' ' |
|
|
xx_diffkr_file = ' ' |
|
|
xx_kapgm_file = ' ' |
|
|
xx_tr1_file = ' ' |
|
|
xx_sst_file = ' ' |
|
|
xx_sss_file = ' ' |
|
|
xx_hfacc_file = ' ' |
|
|
xx_efluxy_file = ' ' |
|
|
xx_efluxp_file = ' ' |
|
|
xx_bottomdrag_file = ' ' |
|
|
|
|
|
yadmark = 'ad' |
|
|
yctrlid = 'MIT_CE_000' |
|
|
ctrlname = ' ' |
|
|
costname = ' ' |
|
|
scalname = ' ' |
|
|
maskname = ' ' |
|
|
metaname = ' ' |
|
|
|
|
|
c-- Check versions. |
|
|
|
|
|
open(unit=scrunit1,status='scratch') |
|
|
|
|
|
c-- Next, read the ecco data file. |
|
|
open(unit = modeldataunit,file = 'data.ctrl', |
|
|
& status = 'old', iostat = errio) |
|
|
if ( errio .lt. 0 ) then |
|
|
stop ' stopped in ctrl_init' |
|
|
endif |
|
|
|
|
|
do while ( .true. ) |
|
|
read(modeldataunit, fmt='(a)', end=1001) record |
|
|
il = max(ilnblnk(record),1) |
|
|
if ( record(1:1) .ne. commentcharacter ) |
|
|
& write(unit=scrunit1, fmt='(a)') record(:il) |
|
|
enddo |
|
|
1001 continue |
|
|
close( modeldataunit ) |
|
|
|
|
|
rewind( scrunit1 ) |
|
|
read(unit = scrunit1, nml = ctrl_nml) |
|
|
read(unit = scrunit1, nml = ctrl_packnames) |
|
|
close( scrunit1 ) |
|
127 |
|
|
128 |
#ifdef ALLOW_CALENDAR |
#ifdef ALLOW_CALENDAR |
129 |
|
|
229 |
cph index 23-24 for bottom drag |
cph index 23-24 for bottom drag |
230 |
cph) |
cph) |
231 |
|
|
232 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
233 |
c-- |
c-- |
234 |
#ifdef ALLOW_THETA0_CONTROL |
#ifdef ALLOW_THETA0_CONTROL |
235 |
c-- Initial state temperature contribution. |
c-- Initial state temperature contribution. |
246 |
|
|
247 |
#endif /* ALLOW_THETA0_CONTROL */ |
#endif /* ALLOW_THETA0_CONTROL */ |
248 |
|
|
249 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
250 |
c-- |
c-- |
251 |
#ifdef ALLOW_SALT0_CONTROL |
#ifdef ALLOW_SALT0_CONTROL |
252 |
c-- Initial state salinity contribution. |
c-- Initial state salinity contribution. |
267 |
c-- Surface flux contributions. |
c-- Surface flux contributions. |
268 |
c-- =========================== |
c-- =========================== |
269 |
|
|
270 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
271 |
c-- |
c-- |
272 |
#if (defined (ALLOW_HFLUX_CONTROL)) |
#if (defined (ALLOW_HFLUX_CONTROL)) |
273 |
c-- Heat flux. |
c-- Heat flux. |
336 |
|
|
337 |
#endif /* ALLOW_HFLUX_CONTROL */ |
#endif /* ALLOW_HFLUX_CONTROL */ |
338 |
|
|
339 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
340 |
c-- |
c-- |
341 |
#if (defined (ALLOW_SFLUX_CONTROL)) |
#if (defined (ALLOW_SFLUX_CONTROL)) |
342 |
c-- Salt flux. |
c-- Salt flux. |
405 |
|
|
406 |
#endif /* ALLOW_SFLUX_CONTROL */ |
#endif /* ALLOW_SFLUX_CONTROL */ |
407 |
|
|
408 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
409 |
c-- |
c-- |
410 |
#if (defined (ALLOW_USTRESS_CONTROL)) |
#if (defined (ALLOW_USTRESS_CONTROL)) |
411 |
c-- Zonal wind stress. |
c-- Zonal wind stress. |
474 |
|
|
475 |
#endif /* ALLOW_USTRESS_CONTROL */ |
#endif /* ALLOW_USTRESS_CONTROL */ |
476 |
|
|
477 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
478 |
c-- |
c-- |
479 |
#if (defined (ALLOW_VSTRESS_CONTROL)) |
#if (defined (ALLOW_VSTRESS_CONTROL)) |
480 |
c-- Meridional wind stress. |
c-- Meridional wind stress. |
543 |
|
|
544 |
#endif /* ALLOW_VSTRESS_CONTROL */ |
#endif /* ALLOW_VSTRESS_CONTROL */ |
545 |
|
|
546 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
547 |
c-- |
c-- |
548 |
#ifdef ALLOW_OBCSN_CONTROL |
#ifdef ALLOW_OBCSN_CONTROL |
549 |
c-- Northern obc. |
c-- Northern obc. |
553 |
call cal_TimePassed( xx_obcsnstartdate, modelstartdate, |
call cal_TimePassed( xx_obcsnstartdate, modelstartdate, |
554 |
& difftime, mythid ) |
& difftime, mythid ) |
555 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
556 |
startrec = int((modelstart + startTime - diffsecs)/ |
cgg O.B. future values are needed at the last timestep, so lets |
557 |
& xx_obcsnperiod) + 1 |
cgg take this into account. |
558 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
startrec = int((modelstart - diffsecs)/xx_obcsnperiod) + 1 |
559 |
& xx_obcsnperiod) + 2 |
endrec = int((modelend - diffsecs)/xx_obcsnperiod) + 2 |
560 |
#else |
#else |
561 |
startrec = 1 |
startrec = 1 |
562 |
endrec = 1 |
endrec = 1 |
563 |
#endif |
#endif |
564 |
ivarindex = 11 |
ivarindex = 11 |
565 |
ncvarindex(ivarindex) = 111 |
ncvarindex(ivarindex) = 111 |
566 |
|
cgg( Implement heimbach fix for nobcs. |
567 |
ncvarrecs(ivarindex) = (endrec - startrec + 1)*nobcs |
ncvarrecs(ivarindex) = (endrec - startrec + 1)*nobcs |
568 |
ncvarrecstart(ivarindex) = (startrec - 1)*nobcs + 1 |
ncvarrecstart(ivarindex) = (startrec - 1)*nobcs + 1 |
569 |
ncvarrecsend(ivarindex) = endrec*nobcs |
ncvarrecsend(ivarindex) = endrec*nobcs |
570 |
|
cgg) |
571 |
ncvarxmax(ivarindex) = snx |
ncvarxmax(ivarindex) = snx |
572 |
ncvarymax(ivarindex) = 1 |
ncvarymax(ivarindex) = 1 |
573 |
ncvarnrmax(ivarindex) = nr |
ncvarnrmax(ivarindex) = nr |
579 |
#ifdef ALLOW_OBCSS_CONTROL |
#ifdef ALLOW_OBCSS_CONTROL |
580 |
c-- Southern obc. |
c-- Southern obc. |
581 |
|
|
582 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
583 |
c-- |
c-- |
584 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
585 |
#ifdef ALLOW_CALENDAR |
#ifdef ALLOW_CALENDAR |
586 |
call cal_TimePassed( xx_obcssstartdate, modelstartdate, |
call cal_TimePassed( xx_obcssstartdate, modelstartdate, |
587 |
& difftime, mythid ) |
& difftime, mythid ) |
588 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
589 |
startrec = int((modelstart + startTime - diffsecs)/ |
cgg O.B. future values are needed at the last timestep, so lets |
590 |
& xx_obcssperiod) + 1 |
cgg take this into account. |
591 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
startrec = int((modelstart - diffsecs)/xx_obcssperiod) + 1 |
592 |
& xx_obcssperiod) + 2 |
endrec = int((modelend - diffsecs)/xx_obcssperiod) + 2 |
593 |
#else |
#else |
594 |
startrec = 1 |
startrec = 1 |
595 |
endrec = 1 |
endrec = 1 |
596 |
#endif |
#endif |
597 |
ivarindex = 12 |
ivarindex = 12 |
598 |
ncvarindex(ivarindex) = 112 |
ncvarindex(ivarindex) = 112 |
599 |
|
cgg( Implement heimbach fix for nobcs. |
600 |
ncvarrecs(ivarindex) = (endrec - startrec + 1)*nobcs |
ncvarrecs(ivarindex) = (endrec - startrec + 1)*nobcs |
601 |
ncvarrecstart(ivarindex) = (startrec - 1)*nobcs + 1 |
ncvarrecstart(ivarindex) = (startrec - 1)*nobcs + 1 |
602 |
ncvarrecsend(ivarindex) = endrec*nobcs |
ncvarrecsend(ivarindex) = endrec*nobcs |
603 |
|
cph) |
604 |
ncvarxmax(ivarindex) = snx |
ncvarxmax(ivarindex) = snx |
605 |
ncvarymax(ivarindex) = 1 |
ncvarymax(ivarindex) = 1 |
606 |
ncvarnrmax(ivarindex) = nr |
ncvarnrmax(ivarindex) = nr |
609 |
|
|
610 |
#endif /* ALLOW_OBCSS_CONTROL */ |
#endif /* ALLOW_OBCSS_CONTROL */ |
611 |
|
|
612 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
613 |
c-- |
c-- |
614 |
#ifdef ALLOW_OBCSW_CONTROL |
#ifdef ALLOW_OBCSW_CONTROL |
615 |
c-- Western obc. |
c-- Western obc. |
619 |
call cal_TimePassed( xx_obcswstartdate, modelstartdate, |
call cal_TimePassed( xx_obcswstartdate, modelstartdate, |
620 |
& difftime, mythid ) |
& difftime, mythid ) |
621 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
622 |
startrec = int((modelstart + startTime - diffsecs)/ |
startrec = int((modelstart - diffsecs)/xx_obcswperiod) + 1 |
623 |
& xx_obcswperiod) + 1 |
endrec = int((modelend - diffsecs)/xx_obcswperiod) + 2 |
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_obcswperiod) + 2 |
|
624 |
#else |
#else |
625 |
startrec = 1 |
startrec = 1 |
626 |
endrec = 1 |
endrec = 1 |
627 |
#endif |
#endif |
628 |
ivarindex = 13 |
ivarindex = 13 |
629 |
ncvarindex(ivarindex) = 113 |
ncvarindex(ivarindex) = 113 |
630 |
|
cgg( Implement heimbach fix for nobcs. |
631 |
ncvarrecs(ivarindex) = (endrec - startrec + 1)*nobcs |
ncvarrecs(ivarindex) = (endrec - startrec + 1)*nobcs |
632 |
ncvarrecstart(ivarindex) = (startrec - 1)*nobcs + 1 |
ncvarrecstart(ivarindex) = (startrec - 1)*nobcs + 1 |
633 |
ncvarrecsend(ivarindex) = endrec*nobcs |
ncvarrecsend(ivarindex) = endrec*nobcs |
634 |
|
cgg) |
635 |
ncvarxmax(ivarindex) = 1 |
ncvarxmax(ivarindex) = 1 |
636 |
ncvarymax(ivarindex) = sny |
ncvarymax(ivarindex) = sny |
637 |
ncvarnrmax(ivarindex) = nr |
ncvarnrmax(ivarindex) = nr |
640 |
|
|
641 |
#endif /* ALLOW_OBCSW_CONTROL */ |
#endif /* ALLOW_OBCSW_CONTROL */ |
642 |
|
|
643 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
644 |
c-- |
c-- |
645 |
#ifdef ALLOW_OBCSE_CONTROL |
#ifdef ALLOW_OBCSE_CONTROL |
646 |
c-- Eastern obc. |
c-- Eastern obc. |
650 |
call cal_TimePassed( xx_obcsestartdate, modelstartdate, |
call cal_TimePassed( xx_obcsestartdate, modelstartdate, |
651 |
& difftime, mythid ) |
& difftime, mythid ) |
652 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
653 |
startrec = int((modelstart + startTime - diffsecs)/ |
startrec = int((modelstart - diffsecs)/xx_obcseperiod) + 1 |
654 |
& xx_obcseperiod) + 1 |
endrec = int((modelend - diffsecs)/xx_obcseperiod) + 2 |
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_obcseperiod) + 2 |
|
655 |
#else |
#else |
656 |
startrec = 1 |
startrec = 1 |
657 |
endrec = 1 |
endrec = 1 |
658 |
#endif |
#endif |
659 |
ivarindex = 14 |
ivarindex = 14 |
660 |
ncvarindex(ivarindex) = 114 |
ncvarindex(ivarindex) = 114 |
661 |
|
cgg( Implement heimbach fix for nobcs. |
662 |
ncvarrecs(ivarindex) = (endrec - startrec + 1)*nobcs |
ncvarrecs(ivarindex) = (endrec - startrec + 1)*nobcs |
663 |
ncvarrecstart(ivarindex) = (startrec - 1)*nobcs + 1 |
ncvarrecstart(ivarindex) = (startrec - 1)*nobcs + 1 |
664 |
ncvarrecsend(ivarindex) = endrec*nobcs |
ncvarrecsend(ivarindex) = endrec*nobcs |
665 |
|
cgg) |
666 |
ncvarxmax(ivarindex) = 1 |
ncvarxmax(ivarindex) = 1 |
667 |
ncvarymax(ivarindex) = sny |
ncvarymax(ivarindex) = sny |
668 |
ncvarnrmax(ivarindex) = nr |
ncvarnrmax(ivarindex) = nr |
671 |
|
|
672 |
#endif /* ALLOW_OBCSE_CONTROL */ |
#endif /* ALLOW_OBCSE_CONTROL */ |
673 |
|
|
674 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
675 |
c-- |
c-- |
676 |
#ifdef ALLOW_DIFFKR_CONTROL |
#ifdef ALLOW_DIFFKR_CONTROL |
677 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
685 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
686 |
#endif /* ALLOW_DIFFKR_CONTROL */ |
#endif /* ALLOW_DIFFKR_CONTROL */ |
687 |
|
|
688 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
689 |
c-- |
c-- |
690 |
#ifdef ALLOW_KAPGM_CONTROL |
#ifdef ALLOW_KAPGM_CONTROL |
691 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
699 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
700 |
#endif /* ALLOW_KAPGM_CONTROL */ |
#endif /* ALLOW_KAPGM_CONTROL */ |
701 |
|
|
702 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
703 |
c-- |
c-- |
704 |
#ifdef ALLOW_TR10_CONTROL |
#ifdef ALLOW_TR10_CONTROL |
705 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
713 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
714 |
#endif /* ALLOW_TR10_CONTROL */ |
#endif /* ALLOW_TR10_CONTROL */ |
715 |
|
|
716 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
717 |
c-- |
c-- |
718 |
#ifdef ALLOW_SST0_CONTROL |
#ifdef ALLOW_SST0_CONTROL |
719 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
727 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
728 |
#endif /* ALLOW_SST0_CONTROL */ |
#endif /* ALLOW_SST0_CONTROL */ |
729 |
|
|
730 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
731 |
c-- |
c-- |
732 |
#ifdef ALLOW_SSS0_CONTROL |
#ifdef ALLOW_SSS0_CONTROL |
733 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
741 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
742 |
#endif /* ALLOW_SSS0_CONTROL */ |
#endif /* ALLOW_SSS0_CONTROL */ |
743 |
|
|
744 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
745 |
c-- |
c-- |
746 |
#ifdef ALLOW_HFACC_CONTROL |
#ifdef ALLOW_HFACC_CONTROL |
747 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
759 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
760 |
#endif /* ALLOW_HFACC_CONTROL */ |
#endif /* ALLOW_HFACC_CONTROL */ |
761 |
|
|
762 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
763 |
c-- |
c-- |
764 |
#ifdef ALLOW_EFLUXY0_CONTROL |
#ifdef ALLOW_EFLUXY0_CONTROL |
765 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
773 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
774 |
#endif /* ALLOW_EFLUXY0_CONTROL */ |
#endif /* ALLOW_EFLUXY0_CONTROL */ |
775 |
|
|
776 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
777 |
c-- |
c-- |
778 |
#ifdef ALLOW_EFLUXP0_CONTROL |
#ifdef ALLOW_EFLUXP0_CONTROL |
779 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
787 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
788 |
#endif /* ALLOW_EFLUXP0_CONTROL */ |
#endif /* ALLOW_EFLUXP0_CONTROL */ |
789 |
|
|
790 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
791 |
c-- |
c-- |
792 |
#ifdef ALLOW_BOTTOMDRAG_CONTROL |
#ifdef ALLOW_BOTTOMDRAG_CONTROL |
793 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
801 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
802 |
#endif /* ALLOW_BOTTOMDRAG_CONTROL */ |
#endif /* ALLOW_BOTTOMDRAG_CONTROL */ |
803 |
|
|
804 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
805 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
806 |
c------------------------------------------------------------------------------------------- |
c------------------------------------------------------------------------------- |
807 |
|
|
808 |
c-- Determine the number of wet points in each tile: |
c-- Determine the number of wet points in each tile: |
809 |
c-- maskc, masks, and maskw. |
c-- maskc, masks, and maskw. |
810 |
|
|
|
c-- Set loop ranges. |
|
|
jmin = 1 |
|
|
jmax = sny |
|
|
imin = 1 |
|
|
imax = snx |
|
|
|
|
811 |
c-- Initialise the counters. |
c-- Initialise the counters. |
812 |
do bj = jtlo,jthi |
do bj = jtlo,jthi |
813 |
do bi = itlo,ithi |
do bi = itlo,ithi |
878 |
c-- Count wet points at Northern boundary. |
c-- Count wet points at Northern boundary. |
879 |
c-- mask conventions are adopted from obcs_apply_ts, obcs_apply_uv |
c-- mask conventions are adopted from obcs_apply_ts, obcs_apply_uv |
880 |
ymaskobcs = 'maskobcsn' |
ymaskobcs = 'maskobcsn' |
881 |
call ctrl_mask_set_xz( |
call ctrl_mask_set_xz( 0, OB_Jn, nwetobcsn, ymaskobcs, mythid ) |
|
& 0, OB_Jn, nwetobcsn, ymaskobcs, mythid |
|
|
& ) |
|
882 |
#endif |
#endif |
883 |
|
|
884 |
#ifdef ALLOW_OBCSS_CONTROL |
#ifdef ALLOW_OBCSS_CONTROL |
885 |
c-- Count wet points at Northern boundary. |
c-- Count wet points at Southern boundary. |
886 |
c-- mask conventions are adopted from obcs_apply_ts, obcs_apply_uv |
c-- mask conventions are adopted from obcs_apply_ts, obcs_apply_uv |
887 |
ymaskobcs = 'maskobcss' |
ymaskobcs = 'maskobcss' |
888 |
call ctrl_mask_set_xz( |
call ctrl_mask_set_xz( 1, OB_Js, nwetobcss, ymaskobcs, mythid ) |
|
& 1, OB_Js, nwetobcss, ymaskobcs, mythid |
|
|
& ) |
|
889 |
#endif |
#endif |
890 |
|
|
891 |
#ifdef ALLOW_OBCSW_CONTROL |
#ifdef ALLOW_OBCSW_CONTROL |
892 |
c-- Count wet points at Northern boundary. |
c-- Count wet points at Western boundary. |
893 |
c-- mask conventions are adopted from obcs_apply_ts, obcs_apply_uv |
c-- mask conventions are adopted from obcs_apply_ts, obcs_apply_uv |
894 |
ymaskobcs = 'maskobcsw' |
ymaskobcs = 'maskobcsw' |
895 |
call ctrl_mask_set_yz( |
call ctrl_mask_set_yz( 1, OB_Iw, nwetobcsw, ymaskobcs, mythid ) |
|
& 1, OB_Iw, nwetobcsw, ymaskobcs, mythid |
|
|
& ) |
|
896 |
#endif |
#endif |
897 |
|
|
898 |
#ifdef ALLOW_OBCSE_CONTROL |
#ifdef ALLOW_OBCSE_CONTROL |
899 |
c-- Count wet points at Northern boundary. |
c-- Count wet points at Eastern boundary. |
900 |
c-- mask conventions are adopted from obcs_apply_ts, obcs_apply_uv |
c-- mask conventions are adopted from obcs_apply_ts, obcs_apply_uv |
901 |
ymaskobcs = 'maskobcse' |
ymaskobcs = 'maskobcse' |
902 |
call ctrl_mask_set_yz( |
call ctrl_mask_set_yz( 0, OB_Ie, nwetobcse, ymaskobcs, mythid ) |
|
& 0, OB_Ie, nwetobcse, ymaskobcs, mythid |
|
|
& ) |
|
903 |
#endif |
#endif |
904 |
|
|
905 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
928 |
else if ( ncvargrd(i) .eq. 'm' ) then |
else if ( ncvargrd(i) .eq. 'm' ) then |
929 |
#ifdef ALLOW_OBCS_CONTROL |
#ifdef ALLOW_OBCS_CONTROL |
930 |
do iobcs = 1, nobcs |
do iobcs = 1, nobcs |
931 |
|
cgg This overcounts the number of o.b. control points by a factor of "nobcs". |
932 |
|
cgg As an ad-hoc solution I've divided by nobcs everywhere. |
933 |
if ( i .eq. 11 ) then |
if ( i .eq. 11 ) then |
934 |
#ifdef ALLOW_OBCSN_CONTROL |
#ifdef ALLOW_OBCSN_CONTROL |
935 |
nvarlength = nvarlength + |
nvarlength = nvarlength + |
1034 |
enddo |
enddo |
1035 |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
1036 |
nWetcGlobal(k)=ntmp |
nWetcGlobal(k)=ntmp |
1037 |
|
print *, 'ph-wet 14a: global nWet... k=', k, ntmp |
|
print *, 'ph-wet 14a: global nWet... vor k=', k, ntmp |
|
1038 |
|
|
1039 |
ntmp=0 |
ntmp=0 |
1040 |
do bj=1,nSy |
do bj=1,nSy |
1044 |
enddo |
enddo |
1045 |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
1046 |
nWetsGlobal(k)=ntmp |
nWetsGlobal(k)=ntmp |
1047 |
|
print *, 'ph-wet 14b: global nWet... k=', k, ntmp |
|
print *, 'ph-wet 14b: global nWet... vor k=', k, ntmp |
|
1048 |
|
|
1049 |
ntmp=0 |
ntmp=0 |
1050 |
do bj=1,nSy |
do bj=1,nSy |
1054 |
enddo |
enddo |
1055 |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
1056 |
nWetwGlobal(k)=ntmp |
nWetwGlobal(k)=ntmp |
1057 |
|
print *, 'ph-wet 14c: global nWet... k=', k, ntmp |
|
print *, 'ph-wet 14c: global nWet... vor k=', k, ntmp |
|
1058 |
|
|
1059 |
ntmp=0 |
ntmp=0 |
1060 |
do bj=1,nSy |
do bj=1,nSy |
1064 |
enddo |
enddo |
1065 |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
1066 |
nWetvGlobal(k)=ntmp |
nWetvGlobal(k)=ntmp |
1067 |
|
print *, 'ph-wet 14d: global nWet... k=', k, ntmp |
|
print *, 'ph-wet 14d: global nWet... vor k=', k, ntmp |
|
1068 |
|
|
1069 |
#ifdef ALLOW_OBCSN_CONTROL |
#ifdef ALLOW_OBCSN_CONTROL |
1070 |
do iobcs = 1, nobcs |
do iobcs = 1, nobcs |
1076 |
enddo |
enddo |
1077 |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
1078 |
nwetobcsnglo(k,iobcs)=ntmp |
nwetobcsnglo(k,iobcs)=ntmp |
1079 |
|
print *, 'ph-wet 15a: global nWet... k=', k, iobcs, ntmp |
1080 |
enddo |
enddo |
1081 |
#endif |
#endif |
1082 |
#ifdef ALLOW_OBCSS_CONTROL |
#ifdef ALLOW_OBCSS_CONTROL |
1089 |
enddo |
enddo |
1090 |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
1091 |
nwetobcssglo(k,iobcs)=ntmp |
nwetobcssglo(k,iobcs)=ntmp |
1092 |
|
print *, 'ph-wet 15b: global nWet... k=', k, iobcs, ntmp |
1093 |
enddo |
enddo |
1094 |
#endif |
#endif |
1095 |
#ifdef ALLOW_OBCSW_CONTROL |
#ifdef ALLOW_OBCSW_CONTROL |
1102 |
enddo |
enddo |
1103 |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
1104 |
nwetobcswglo(k,iobcs)=ntmp |
nwetobcswglo(k,iobcs)=ntmp |
1105 |
|
print *, 'ph-wet 15c: global nWet... k=', k, iobcs, ntmp |
1106 |
enddo |
enddo |
1107 |
#endif |
#endif |
1108 |
#ifdef ALLOW_OBCSE_CONTROL |
#ifdef ALLOW_OBCSE_CONTROL |
1115 |
enddo |
enddo |
1116 |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
CALL GLOBAL_SUM_INT( ntmp, myThid ) |
1117 |
nwetobcseglo(k,iobcs)=ntmp |
nwetobcseglo(k,iobcs)=ntmp |
1118 |
|
print *, 'ph-wet 15d: global nWet... k=', k, iobcs, ntmp |
1119 |
enddo |
enddo |
1120 |
#endif |
#endif |
1121 |
|
|