/[MITgcm]/MITgcm/pkg/obcs/obcs_prescribe_read.F
ViewVC logotype

Diff of /MITgcm/pkg/obcs/obcs_prescribe_read.F

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

revision 1.12 by dimitri, Thu Oct 11 10:30:34 2007 UTC revision 1.29 by jmc, Sun Apr 17 03:20:51 2011 UTC
# Line 3  C $Name$ Line 3  C $Name$
3    
4  # include "OBCS_OPTIONS.h"  # include "OBCS_OPTIONS.h"
5    
6        subroutine obcs_prescribe_read (  CBOP
7       I                      mycurrenttime  C     !ROUTINE: OBCS_PRESCRIBE_READ
8       I                    , mycurrentiter  C     !INTERFACE:
9       I                    , mythid        SUBROUTINE OBCS_PRESCRIBE_READ (
10       &                     )       I                          myTime, myIter, myThid )
11  c     |==================================================================|  
12  c     | SUBROUTINE obcs_prescribe_read                                   |  C     !DESCRIPTION: \bv
13  c     |==================================================================|  C     *============================================================*
14  c     | read open boundary conditions from file                          |  C     | SUBROUTINE OBCS_PRESCRIBE_READ
15  c     | N.B.: * uses exf and cal routines for file/record handling       |  C     *============================================================*
16  c     |       * uses ctrl routines for control variable handling         |  C     | read open boundary conditions from file                          
17  c     |==================================================================|  C     | N.B.: * uses exf and cal routines for file/record handling        
18    C     |       * uses ctrl routines for control variable handling          
19    C     *============================================================*
20    C     \ev
21    
22        implicit none  C     !USES:
23          IMPLICIT NONE
24    
25  c     == global variables ==  C     == global variables ==
   
 #include "EEPARAMS.h"  
26  #include "SIZE.h"  #include "SIZE.h"
27  #include "GRID.h"  #include "EEPARAMS.h"
28  #include "OBCS.h"  #include "PARAMS.h"
29  #ifdef ALLOW_EXF  c#include "OBCS.h"
30  # include "EXF_PARAM.h"  c#ifdef ALLOW_EXF
31  #endif  c# include "EXF_PARAM.h"
32  #if (defined (ALLOW_SEAICE) || defined (ALLOW_PTRACERS))  c#endif
33  # include "PARAMS.h"  c#ifdef ALLOW_PTRACERS
34  #endif  c# include "PTRACERS_SIZE.h"
35  #ifdef ALLOW_PTRACERS  c# include "OBCS_PTRACERS.h"
36  # include "PTRACERS_SIZE.h"  c#endif /* ALLOW_PTRACERS */
37  # include "PTRACERS.h"  
38  # include "OBCS_PTRACERS.h"  C     !INPUT/OUTPUT PARAMETERS:
39  #endif /* ALLOW_PTRACERS */  C     myTime :: Simulation time
40    C     myIter :: Simulation timestep number
41  c     == routine arguments ==  C     myThid :: my Thread Id. number
42          _RL     myTime
43        _RL     mycurrenttime        INTEGER myIter
44        integer mycurrentiter        INTEGER myThid
45        integer mythid  
46    #ifdef ALLOW_OBCS_PRESCRIBE
47  #if (defined (ALLOW_OBCS) && defined (ALLOW_OBCS_PRESCRIBE))  
48    C     !LOCAL VARIABLES:
49  c     == local variables ==  CEOP
50    
51  #ifdef ALLOW_EXF  # ifdef ALLOW_EXF
52        logical first, changed        IF ( useEXF ) THEN
53        integer count0, count1          CALL OBCS_EXF_LOAD( myTime, myIter, myThid )
       integer year0, year1  
       _RL     fac  
 #ifdef ALLOW_PTRACERS  
       integer iTracer, i,j,k  
 #endif /* ALLOW_PTRACERS */  
 #endif /* ALLOW_EXF */  
   
 c     == end of interface ==  
   
 #ifdef ALLOW_EXF  
 #ifdef ALLOW_OBCS_NORTH  
       call exf_getffieldrec(  
      I                       obcsNstartdate, obcsNperiod  
      I                     , obcsNstartdate1, obcsNstartdate2  
      I                     , .false.  
      O                     , fac, first, changed  
      O                     , count0, count1, year0, year1  
      I                     , mycurrenttime, mycurrentiter, mythid  
      &                     )  
   
       call exf_set_obcs_xz(  OBNu, OBNu0, OBNu1, OBNufile, 'u'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_xz(  OBNv, OBNv0, OBNv1, OBNvfile, 'v'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_xz(  OBNt, OBNt0, OBNt1, OBNtfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_xz(  OBNs, OBNs0, OBNs1, OBNsfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
 #ifdef ALLOW_SEAICE  
       IF (useSEAICE) THEN  
        call exf_set_obcs_x (  OBNa, OBNa0, OBNa1, OBNafile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
        call exf_set_obcs_x (  OBNh, OBNh0, OBNh1, OBNhfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       ENDIF  
 #endif /* ALLOW_SEAICE */  
 #ifdef ALLOW_PTRACERS  
       if ( usePTRACERS ) then  
        do itracer = 1, PTRACERS_numInUse  
         call exf_set_obcs_xz(  OBNptr (1-Olx,1,1,1,iTracer)  
      I                       , OBNptr0(1-Olx,1,1,1,iTracer)  
      I                       , OBNptr1(1-Olx,1,1,1,iTracer)  
      I                       , OBNptrFile(iTracer), 's'  
      I                       , fac, first, changed, count0, count1  
      I                       , mycurrenttime, mycurrentiter, mythid )  
        enddo  
       endif  
 #endif /* ALLOW_PTRACERS */  
 #endif /* ALLOW_OBCS_NORTH */  
   
 #ifdef ALLOW_OBCS_SOUTH  
       call exf_getffieldrec(  
      I                       obcsSstartdate, obcsSperiod  
      I                     , obcsSstartdate1, obcsSstartdate2  
      I                     , .false.  
      O                     , fac, first, changed  
      O                     , count0, count1, year0, year1  
      I                     , mycurrenttime, mycurrentiter, mythid  
      &                     )  
   
       call exf_set_obcs_xz(  OBSu, OBSu0, OBSu1, OBSufile, 'u'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_xz(  OBSv, OBSv0, OBSv1, OBSvfile, 'v'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_xz(  OBSt, OBSt0, OBSt1, OBStfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_xz(  OBSs, OBSs0, OBSs1, OBSsfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
 #ifdef ALLOW_SEAICE  
       IF (useSEAICE) THEN  
        call exf_set_obcs_x (  OBSa, OBSa0, OBSa1, OBSafile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
        call exf_set_obcs_x (  OBSh, OBSh0, OBSh1, OBShfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       ENDIF  
 #endif /* ALLOW_SEAICE */  
 #ifdef ALLOW_PTRACERS  
       if ( usePTRACERS ) then  
        do itracer = 1, PTRACERS_numInUse  
         call exf_set_obcs_xz(  OBSptr (1-Olx,1,1,1,iTracer)  
      I                       , OBSptr0(1-Olx,1,1,1,iTracer)  
      I                       , OBSptr1(1-Olx,1,1,1,iTracer)  
      I                       , OBSptrFile(iTracer), 's'  
      I                       , fac, first, changed, count0, count1  
      I                       , mycurrenttime, mycurrentiter, mythid )  
        enddo  
       endif  
 #endif /* ALLOW_PTRACERS */  
 #endif /* ALLOW_OBCS_SOUTH */  
   
 #ifdef ALLOW_OBCS_EAST  
       call exf_getffieldrec(  
      I                       obcsEstartdate, obcsEperiod  
      I                     , obcsEstartdate1, obcsEstartdate2  
      I                     , .false.  
      O                     , fac, first, changed  
      O                     , count0, count1, year0, year1  
      I                     , mycurrenttime, mycurrentiter, mythid  
      &                     )  
   
       call exf_set_obcs_yz(  OBEu, OBEu0, OBEu1, OBEufile, 'u'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_yz(  OBEv, OBEv0, OBEv1, OBEvfile, 'v'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_yz(  OBEt, OBEt0, OBEt1, OBEtfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_yz(  OBEs, OBEs0, OBEs1, OBEsfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
 #ifdef ALLOW_SEAICE  
       IF (useSEAICE) THEN  
        call exf_set_obcs_y (  OBEa, OBEa0, OBEa1, OBEafile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
        call exf_set_obcs_y (  OBEh, OBEh0, OBEh1, OBEhfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
54        ENDIF        ENDIF
55  #endif /* ALLOW_SEAICE */  # endif /* ALLOW_EXF */
56  #ifdef ALLOW_PTRACERS  
57        if ( usePTRACERS ) then        IF ( .NOT. useEXF ) THEN
58         do itracer = 1, PTRACERS_numInUse  cph#ifndef ALLOW_AUTODIFF_TAMC
59          call exf_set_obcs_yz(  OBEptr (1-Oly,1,1,1,iTracer)         CALL OBCS_FIELDS_LOAD( myTime, myIter, myThid )
60       I                       , OBEptr0(1-Oly,1,1,1,iTracer)  cph#else
61       I                       , OBEptr1(1-Oly,1,1,1,iTracer)  cph       STOP 'PH HAS DISABLED THIS RUNTIME OPTION FOR ALLOW_EXF'
62       I                       , OBEptrFile(iTracer), 's'  cph#endif
      I                       , fac, first, changed, count0, count1  
      I                       , mycurrenttime, mycurrentiter, mythid )  
        enddo  
       endif  
 #endif /* ALLOW_PTRACERS */  
 #endif /* ALLOW_OBCS_EAST */  
   
 #ifdef ALLOW_OBCS_WEST  
       call exf_getffieldrec(  
      I                       obcsWstartdate, obcsWperiod  
      I                     , obcsWstartdate1, obcsWstartdate2  
      I                     , .false.  
      O                     , fac, first, changed  
      O                     , count0, count1, year0, year1  
      I                     , mycurrenttime, mycurrentiter, mythid  
      &                     )  
   
       call exf_set_obcs_yz(  OBWu, OBWu0, OBWu1, OBWufile, 'u'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_yz(  OBWv, OBWv0, OBWv1, OBWvfile, 'v'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_yz(  OBWt, OBWt0, OBWt1, OBWtfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
       call exf_set_obcs_yz(  OBWs, OBWs0, OBWs1, OBWsfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
 #ifdef ALLOW_SEAICE  
       IF (useSEAICE) THEN  
        call exf_set_obcs_y (  OBWa, OBWa0, OBWa1, OBWafile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
        call exf_set_obcs_y (  OBWh, OBWh0, OBWh1, OBWhfile, 's'  
      I                     , fac, first, changed, count0, count1  
      I                     , mycurrenttime, mycurrentiter, mythid )  
63        ENDIF        ENDIF
 #endif /* ALLOW_SEAICE */  
 #ifdef ALLOW_PTRACERS  
       if ( usePTRACERS ) then  
        do itracer = 1, PTRACERS_numInUse  
         call exf_set_obcs_yz(  OBWptr (1-Oly,1,1,1,iTracer)  
      I                       , OBWptr0(1-Oly,1,1,1,iTracer)  
      I                       , OBWptr1(1-Oly,1,1,1,iTracer)  
      I                       , OBWptrFile(iTracer), 's'  
      I                       , fac, first, changed, count0, count1  
      I                       , mycurrenttime, mycurrentiter, mythid )  
        enddo  
       endif  
 #endif /* ALLOW_PTRACERS */  
 #endif /* ALLOW_OBCS_WEST */  
   
 #ifdef ALLOW_OBCS_CONTROL  
 cgg   WARNING: Assuming North Open Boundary exists and has same  
 cgg    calendar information as other boundaries.  
       call ctrl_obcsbal ( mycurrenttime,mycurrentiter,mythid )  
 #endif  
   
 #ifdef ALLOW_OBCSN_CONTROL  
       call ctrl_getobcsn ( mycurrenttime, mycurrentiter, mythid )  
 #endif  
   
 #ifdef ALLOW_OBCSS_CONTROL  
       call ctrl_getobcss ( mycurrenttime, mycurrentiter, mythid )  
 #endif  
   
 #ifdef ALLOW_OBCSW_CONTROL  
       call ctrl_getobcsw ( mycurrenttime, mycurrentiter, mythid )  
 #endif  
   
 #ifdef ALLOW_OBCSE_CONTROL  
       call ctrl_getobcse ( mycurrenttime, mycurrentiter, mythid )  
 #endif  
   
 #else /* not ALLOW_EXF */  
       CALL OBCS_EXTERNAL_FIELDS_LOAD(  
      &     myCurrentTime, myCurrentIter, myThid )  
 #endif /*  ALLOw_EXF */  
64    
65  #endif /* ALLOW_OBCS */  # ifdef ALLOW_OBCSN_CONTROL
66          CALL CTRL_GETOBCSN ( myTime, myIter, mythid )
67    # endif
68    
69    # ifdef ALLOW_OBCSS_CONTROL
70          CALL CTRL_GETOBCSS ( myTime, myIter, mythid )
71    # endif
72    
73    # ifdef ALLOW_OBCSW_CONTROL
74          CALL CTRL_GETOBCSW ( myTime, myIter, myThid )
75    # endif
76    
77    # ifdef ALLOW_OBCSE_CONTROL
78          CALL CTRL_GETOBCSE ( myTime, myIter, myThid )
79    # endif
80    
81    #endif /* ALLOW_OBCS_PRESCRIBE */
82    
83        RETURN        RETURN
84        END        END

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.22