/[lmdze]/trunk/Sources/misc/writefield.f
ViewVC logotype

Contents of /trunk/Sources/misc/writefield.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 145 - (show annotations)
Tue Jun 16 15:23:29 2015 UTC (8 years, 10 months ago) by guez
File size: 2275 byte(s)
Renamed bibio to misc.

In procedure fxhyp, use the fact that xf is an odd function of xtild.

In procedure invert_zoom_x, replace linear search in xf by
bisection. Also, use result from previous loop iteration as initial
guess. Variable "it" cannot be equal to 2 * nmax after search.

Unused arguments: hm of cv3_feed; ph, qnk, tv,tvp of cv3_mixing; ppsol
of lw; rconst, temp of vdif_kcay; rconst, plev, temp, ustar, l_mix of
yamada.

1 module WriteField_m
2
3 use CreateNewField_m, only: CreateNewField, ncid, nbfield, MaxWriteField
4 use GetFieldIndex_m, only: GetFieldIndex
5 USE netcdf95, ONLY: nf95_put_var, nf95_sync
6
7 implicit none
8
9 integer, save:: Record(MaxWriteField)
10
11 interface WriteField
12 module procedure WriteField3d,WriteField2d,WriteField1d
13 end interface WriteField
14
15 private
16 public WriteField
17
18 contains
19
20 subroutine WriteField1d(name,Field)
21
22 character(len=*), intent(in):: name
23 real, intent(in):: Field(:)
24
25 ! Local:
26 integer index
27
28 !-------------------------------------------
29
30 Index=GetFieldIndex(name)
31
32 if (Index==-1) then
33 call CreateNewField(name, shape(field))
34 Index=nbfield
35 Record(Index) = 1
36 else
37 Record(Index)=Record(Index)+1
38 endif
39
40 call NF95_PUT_VAR(Ncid(Index), Varid = 1, values = Field, &
41 start = (/1, Record(Index)/))
42 call nf95_sync(Ncid(Index))
43
44 end subroutine WriteField1d
45
46 !****************************************************************
47
48 subroutine WriteField2d(name,Field)
49
50 character(len=*), intent(in):: name
51 real, intent(in):: Field(:, :)
52
53 ! Local:
54 integer index
55
56 !-------------------------------------------
57
58 Index=GetFieldIndex(name)
59
60 if (Index==-1) then
61 call CreateNewField(name, shape(field))
62 Index=nbfield
63 Record(Index) = 1
64 else
65 Record(Index)=Record(Index)+1
66 endif
67
68 call NF95_PUT_VAR(Ncid(Index), Varid = 1, values = Field, &
69 start = (/1, 1, Record(Index)/))
70 call nf95_sync(Ncid(Index))
71
72 end subroutine WriteField2d
73
74 !****************************************************************
75
76 subroutine WriteField3d(name,Field)
77
78 character(len=*), intent(in):: name
79 real, intent(in):: Field(:, :, :)
80
81 ! Local:
82 integer index
83
84 !-------------------------------------------
85
86 Index=GetFieldIndex(name)
87
88 if (Index==-1) then
89 call CreateNewField(name, shape(field))
90 Index=nbfield
91 Record(Index) = 1
92 else
93 Record(Index)=Record(Index)+1
94 endif
95
96 call NF95_PUT_VAR(Ncid(Index), Varid = 1, values = Field, &
97 start = (/1, 1, 1, Record(Index)/))
98 call nf95_sync(Ncid(Index))
99
100 end subroutine WriteField3d
101
102 end module WriteField_m

  ViewVC Help
Powered by ViewVC 1.1.21