/[MITgcm]/MITgcm/pkg/mnc/mnc_cw_udim.F
ViewVC logotype

Diff of /MITgcm/pkg/mnc/mnc_cw_udim.F

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

revision 1.3 by edhill, Mon Mar 29 03:33:51 2004 UTC revision 1.9 by edhill, Fri Mar 10 05:50:23 2006 UTC
# Line 4  C $Name$ Line 4  C $Name$
4  #include "MNC_OPTIONS.h"  #include "MNC_OPTIONS.h"
5                
6  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7  CBOP  CBOP 0
8  C !ROUTINE: MNC_CW_SET_UDIM  C !ROUTINE: MNC_CW_SET_UDIM
9    
10  C !INTERFACE:  C !INTERFACE:
# Line 15  C !INTERFACE: Line 15  C !INTERFACE:
15    
16  C     !DESCRIPTION:  C     !DESCRIPTION:
17  C     For a specified file group name, set the size of the NetCDF  C     For a specified file group name, set the size of the NetCDF
18  C     unlimited (or record) dimension.  C     unlimited (or record) dimension.  The options are:
19          C     \begin{equation}
20    C       \label{eq:yo}
21    C       \mbox{\bf nudim} = \left\{
22    C         \begin{array}[htb]{cl}
23    C           >0,  &  \mbox{\small use the specified value} \\
24    C           0,   &  \mbox{\small use the largest currently defined value} \\
25    C           -1,  &  \mbox{\small increment the largest value and then use it} \\
26    C         \end{array}
27    C         \right.
28    C     \end{equation}
29    
30  C     !USES:  C     !USES:
31        implicit none        implicit none
32  #include "mnc_common.h"  #include "mnc_common.h"
# Line 25  C     !USES: Line 35  C     !USES:
35  C     !INPUT PARAMETERS:  C     !INPUT PARAMETERS:
36        integer nudim, myThid        integer nudim, myThid
37        character*(*) fgname        character*(*) fgname
38    CEOP
39    
40  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
41        integer fgf,fgl, indfg        integer fgf,fgl, indfg
42        character*(MAX_LEN_MBUF) msgbuf        character*(MAX_LEN_MBUF) msgbuf
43  CEOP  
44  C     Functions  C     Functions
45        integer IFNBLNK, ILNBLNK        integer IFNBLNK, ILNBLNK
46    
# Line 39  C     Check that this name is not alread Line 50  C     Check that this name is not alread
50        CALL MNC_GET_IND(MNC_MAX_ID, fgname, mnc_cw_fgnm, indfg, myThid)        CALL MNC_GET_IND(MNC_MAX_ID, fgname, mnc_cw_fgnm, indfg, myThid)
51        IF (indfg .LT. 1) THEN        IF (indfg .LT. 1) THEN
52          CALL MNC_GET_NEXT_EMPTY_IND(          CALL MNC_GET_NEXT_EMPTY_IND(
53       &       MNC_MAX_ID, mnc_cw_fgnm, indfg, myThid)       &       MNC_MAX_ID, mnc_cw_fgnm, 'mnc_cw_fgnm', indfg, myThid)
54            mnc_cw_fgnm(indfg)(1:(fgl-fgf+1)) = fgname(fgf:fgl)
55            mnc_cw_fgud(indfg) = 0
56            mnc_cw_fgig(indfg) = 0
57          ENDIF
58          IF (nudim .GT. 0) THEN
59            mnc_cw_fgig(indfg) = 0
60            mnc_cw_fgud(indfg) = nudim
61            RETURN
62        ENDIF        ENDIF
63        mnc_cw_fgnm(indfg)(1:(fgl-fgf+1)) = fgname(fgf:fgl)        IF (nudim .EQ. 0) THEN
64        mnc_cw_fgud(indfg) = nudim          mnc_cw_fgig(indfg) = 0
65            RETURN
66          ENDIF
67          IF (nudim .EQ. -1) THEN
68            mnc_cw_fgig(indfg) = 1
69            mnc_cw_fgud(indfg) = mnc_cw_fgud(indfg) + 1
70            RETURN
71          ENDIF
72          write(msgbuf,'(3a,i,a)')
73         &     'MNC_CW_SET_UDIM ERROR: for file group name ''',
74         &     fgname(fgf:fgl), ''' the unlim dim ''', nudim,
75         &     ''' is not allowed'
76          CALL print_error(msgbuf, mythid)
77          STOP 'ABNORMAL END: S/R MNC_CW_SET_UDIM'
78    
79        RETURN        RETURN
80        END        END
81    
82  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
83  CBOP  CBOP 0
84  C !ROUTINE: MNC_CW_GET_UDIM  C !ROUTINE: MNC_CW_GET_UDIM
85    
86  C !INTERFACE:  C !INTERFACE:
# Line 69  C     !USES: Line 101  C     !USES:
101  C     !INPUT PARAMETERS:  C     !INPUT PARAMETERS:
102        integer nudim, myThid        integer nudim, myThid
103        character*(*) fgname        character*(*) fgname
104    CEOP
105    
106  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
107        integer fgf,fgl, indfg        integer fgf,fgl, indfg
108        character*(MAX_LEN_MBUF) msgbuf        character*(MAX_LEN_MBUF) msgbuf
109  CEOP  
110  C     Functions  C     Functions
111        integer IFNBLNK, ILNBLNK        integer IFNBLNK, ILNBLNK
112    
# Line 82  C     Functions Line 115  C     Functions
115        CALL MNC_GET_IND(MNC_MAX_ID, fgname, mnc_cw_fgnm, indfg, myThid)        CALL MNC_GET_IND(MNC_MAX_ID, fgname, mnc_cw_fgnm, indfg, myThid)
116        IF (indfg .LT. 1) THEN        IF (indfg .LT. 1) THEN
117          write(msgbuf,'(3a)')          write(msgbuf,'(3a)')
118       &       'MNC_CW_SET_UDIM ERROR: file group name ''',       &       'MNC_CW_GET_UDIM ERROR: file group name ''',
119       &       fgname(fgf:fgl), ''' is not defined'       &       fgname(fgf:fgl), ''' is not defined'
120          CALL print_error(msgbuf, mythid)          CALL print_error(msgbuf, mythid)
121          STOP 'ABNORMAL END: S/R MNC_CW_SET_UDIM'          STOP 'ABNORMAL END: S/R MNC_CW_GET_UDIM'
122        ENDIF        ENDIF
123        nudim = mnc_cw_fgud(indfg)        nudim = mnc_cw_fgud(indfg)
124    
# Line 93  C     Functions Line 126  C     Functions
126        END        END
127    
128  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
   

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

  ViewVC Help
Powered by ViewVC 1.1.22