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

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

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


Revision 1.5 - (show annotations) (download)
Mon Apr 5 06:01:07 2004 UTC (20 years, 1 month ago) by edhill
Branch: MAIN
CVS Tags: checkpoint52n_post, checkpoint53d_post, checkpoint54a_pre, checkpoint55c_post, checkpoint54e_post, checkpoint54a_post, checkpoint53c_post, checkpoint55d_pre, checkpoint55h_post, checkpoint54b_post, checkpoint53b_pre, checkpoint55b_post, checkpoint54d_post, checkpoint52m_post, checkpoint55, checkpoint53a_post, checkpoint54, checkpoint54f_post, checkpoint53b_post, checkpoint55g_post, checkpoint55f_post, checkpoint53, checkpoint53g_post, checkpoint55e_post, checkpoint53f_post, checkpoint55a_post, checkpoint53d_pre, checkpoint54c_post, checkpoint55d_post
Changes since 1.4: +19 -4 lines
 o fix a serious memory-wasting bug in MNC_GRID_INIT_ALL()
 o give the "monitor" package the ability to write to NetCDF files
   - requested by JMC
   - tested and works but needs more run-time options

1 C $Header: /u/gcmpack/MITgcm/pkg/mnc/mnc_cw_udim.F,v 1.4 2004/04/02 16:12:48 edhill Exp $
2 C $Name: $
3
4 #include "MNC_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 CBOP 0
8 C !ROUTINE: MNC_CW_SET_UDIM
9
10 C !INTERFACE:
11 SUBROUTINE MNC_CW_SET_UDIM(
12 I fgname,
13 I nudim,
14 I myThid )
15
16 C !DESCRIPTION:
17 C For a specified file group name, set the size of the NetCDF
18 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:
31 implicit none
32 #include "mnc_common.h"
33 #include "EEPARAMS.h"
34
35 C !INPUT PARAMETERS:
36 integer nudim, myThid
37 character*(*) fgname
38 CEOP
39
40 C !LOCAL VARIABLES:
41 integer fgf,fgl, indfg
42 character*(MAX_LEN_MBUF) msgbuf
43
44 C Functions
45 integer IFNBLNK, ILNBLNK
46
47 C Check that this name is not already defined
48 fgf = IFNBLNK(fgname)
49 fgl = ILNBLNK(fgname)
50 CALL MNC_GET_IND(MNC_MAX_ID, fgname, mnc_cw_fgnm, indfg, myThid)
51 IF (indfg .LT. 1) THEN
52 CALL MNC_GET_NEXT_EMPTY_IND(
53 & MNC_MAX_ID, mnc_cw_fgnm, indfg, myThid)
54 mnc_cw_fgud(indfg) = 0
55 ENDIF
56 mnc_cw_fgnm(indfg)(1:(fgl-fgf+1)) = fgname(fgf:fgl)
57 IF (nudim .GT. 0) THEN
58 mnc_cw_fgud(indfg) = nudim
59 RETURN
60 ENDIF
61 IF (nudim .EQ. 0) RETURN
62 IF (nudim .EQ. -1) THEN
63 mnc_cw_fgud(indfg) = mnc_cw_fgud(indfg) + 1
64 RETURN
65 ENDIF
66 write(msgbuf,'(3a,i,a)')
67 & 'MNC_CW_SET_UDIM ERROR: for file group name ''',
68 & fgname(fgf:fgl), ''' the unlim dim ''', nudim,
69 & ''' is not allowed'
70 CALL print_error(msgbuf, mythid)
71 STOP 'ABNORMAL END: S/R MNC_CW_SET_UDIM'
72
73 RETURN
74 END
75
76 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
77 CBOP 0
78 C !ROUTINE: MNC_CW_GET_UDIM
79
80 C !INTERFACE:
81 SUBROUTINE MNC_CW_GET_UDIM(
82 I fgname,
83 O nudim,
84 I myThid )
85
86 C !DESCRIPTION:
87 C For a specified file group name, get the size of the NetCDF
88 C unlimited (or record) dimension.
89
90 C !USES:
91 implicit none
92 #include "mnc_common.h"
93 #include "EEPARAMS.h"
94
95 C !INPUT PARAMETERS:
96 integer nudim, myThid
97 character*(*) fgname
98 CEOP
99
100 C !LOCAL VARIABLES:
101 integer fgf,fgl, indfg
102 character*(MAX_LEN_MBUF) msgbuf
103
104 C Functions
105 integer IFNBLNK, ILNBLNK
106
107 fgf = IFNBLNK(fgname)
108 fgl = ILNBLNK(fgname)
109 CALL MNC_GET_IND(MNC_MAX_ID, fgname, mnc_cw_fgnm, indfg, myThid)
110 IF (indfg .LT. 1) THEN
111 write(msgbuf,'(3a)')
112 & 'MNC_CW_GET_UDIM ERROR: file group name ''',
113 & fgname(fgf:fgl), ''' is not defined'
114 CALL print_error(msgbuf, mythid)
115 STOP 'ABNORMAL END: S/R MNC_CW_GET_UDIM'
116 ENDIF
117 nudim = mnc_cw_fgud(indfg)
118
119 RETURN
120 END
121
122 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
123

  ViewVC Help
Powered by ViewVC 1.1.22