36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
58
59#if !defined PARALLEL_IO && defined DISTRIBUTE
60
62#endif
63
64 implicit none
65
66
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
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
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
106
107 ibuffer(1)=dimid
108 ibuffer(2)=status
109 ibuffer(3)=exit_flag
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