ROMS
Loading...
Searching...
No Matches
def_dim_mod::def_dim Interface Reference

Public Member Functions

integer function def_dim_nf90 (ng, model, ncid, ncname, dimname, dimsize, dimid)
 
integer function def_dim_pio (ng, model, piofile, ncname, dimname, dimsize, dimid)
 

Detailed Description

Definition at line 24 of file def_dim.F.

Member Function/Subroutine Documentation

◆ def_dim_nf90()

integer function def_dim_mod::def_dim::def_dim_nf90 ( integer, intent(in) ng,
integer, intent(in) model,
integer, intent(in) ncid,
character (len=*), intent(in) ncname,
character (len=*), intent(in) dimname,
integer, intent(in) dimsize,
integer, intent(out) dimid )

Definition at line 34 of file def_dim.F.

36!***********************************************************************
37! !
38! This function defines the requested NetCDF dimension when using the !
39! standard NetCDF-3 or NetCDF-4 library. !
40! !
41! On Input: !
42! !
43! ng Nested grid number (integer) !
44! model Calling model identifier (integer) !
45! ncid NetCDF file ID (integer) !
46! ncname NetCDF filename (string) !
47! DimName Dimension name (string) !
48! DimSize Dimension size (integer) !
49! !
50! On Output: !
51! !
52! status NetCDF error flag (integer) !
53! DimId NetCDF dimension ID (integer) !
54! !
55!***********************************************************************
56!
57 USE mod_netcdf
58
59#if !defined PARALLEL_IO && defined DISTRIBUTE
60!
61 USE distribute_mod, ONLY : mp_bcasti
62#endif
63!
64 implicit none
65!
66! Imported variable declarations.
67!
68 integer, intent (in) :: ng, model, ncid
69 integer, intent (in) :: DimSize
70 integer, intent (out) :: DimId
71!
72 character (len=*), intent(in) :: ncname
73 character (len=*), intent(in) :: DimName
74!
75! Local variable declarations.
76!
77 integer :: status
78
79#if !defined PARALLEL_IO && defined DISTRIBUTE
80 integer, dimension(3) :: ibuffer
81#endif
82!
83 character (len=*), parameter :: MyFile = &
84 & __FILE__//", def_dim_nf90"
85!
86 sourcefile=myfile
87!
88!-----------------------------------------------------------------------
89! Define requested NetCDF dimension.
90!-----------------------------------------------------------------------
91!
92 status=nf90_noerr
93!
94 IF (outthread) THEN
95 status=nf90_def_dim(ncid, trim(dimname), dimsize, dimid)
96 IF (founderror(status, nf90_noerr, __line__, myfile)) THEN
97 IF (master) WRITE (stdout,10) trim(dimname), trim(ncname)
98 exit_flag=3
99 ioerror=status
100 END IF
101 END IF
102
103#if !defined PARALLEL_IO && defined DISTRIBUTE
104!
105! Broadcast information to all threads in the group.
106!
107 ibuffer(1)=dimid
108 ibuffer(2)=status
109 ibuffer(3)=exit_flag
110 CALL mp_bcasti (ng, model, ibuffer)
111 dimid=ibuffer(1)
112 status=ibuffer(2)
113 exit_flag=ibuffer(3)
114#endif
115!
116 10 FORMAT (/,' DEF_DIM_NF90 - error while defining dimension: ',a, &
117 & /,16x,'in file: ',a)
118!
119 RETURN

References mod_scalars::exit_flag, strings_mod::founderror(), mod_iounits::ioerror, mod_parallel::master, mod_parallel::outthread, mod_iounits::sourcefile, and mod_iounits::stdout.

Here is the call graph for this function:

◆ def_dim_pio()

integer function def_dim_mod::def_dim::def_dim_pio ( integer, intent(in) ng,
integer, intent(in) model,
type (file_desc_t), intent(in) piofile,
character (len=*), intent(in) ncname,
character (len=*), intent(in) dimname,
integer, intent(in) dimsize,
integer, intent(out) dimid )

Definition at line 125 of file def_dim.F.

127!***********************************************************************
128! !
129! This function defines the requested NetCDF dimension when using the !
130! NCAR Parallel-IO library. !
131! !
132! On Input: !
133! !
134! ng Nested grid number (integer) !
135! model Calling model identifier (integer) !
136! pioFile PIO file descriptor structure, TYPE(file_desc_t) !
137! pioFile%fh file handler !
138! pioFile%iosystem IO system descriptor (struct) !
139! ncname PIO filename (string) !
140! DimName Dimension name (string) !
141! DimSize Dimension size (integer) !
142! !
143! On Output: !
144! !
145! status PIO error flag (integer) !
146! DimId PIO dimension ID (integer) !
147! !
148!***********************************************************************
149!
150 USE pio
151!
152! Imported variable declarations.
153!
154 integer, intent (in) :: ng, model
155 integer, intent (in) :: DimSize
156 integer, intent (out) :: DimId
157!
158 character (len=*), intent(in) :: ncname
159 character (len=*), intent(in) :: DimName
160!
161 TYPE (file_desc_t), intent(in) :: pioFile
162!
163! Local variable declarations.
164!
165 integer :: status
166!
167 character (len=*), parameter :: MyFile = &
168 & __FILE__//", def_dim_pio"
169!
170 sourcefile=myfile
171!
172!-----------------------------------------------------------------------
173! Define requested PIO dimension.
174!-----------------------------------------------------------------------
175!
176 status=pio_noerr
177!
178 status=pio_def_dim(piofile, trim(dimname), dimsize, dimid)
179 IF (founderror(status, pio_noerr, __line__, &
180 & __file__)) THEN
181 IF (master) WRITE (stdout,10) trim(dimname), trim(ncname)
182 exit_flag=3
183 ioerror=status
184 END IF
185!
186 10 FORMAT (/,' DEF_DIM_PIO - error while defining dimension: ',a, &
187 & /,15x,'in file: ',a)
188!
189 RETURN

References mod_scalars::exit_flag, strings_mod::founderror(), mod_iounits::ioerror, mod_parallel::master, mod_iounits::sourcefile, and mod_iounits::stdout.

Here is the call graph for this function:

The documentation for this interface was generated from the following file: