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

Annotation of /trunk/misc/writefield.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 145 - (hide annotations)
Tue Jun 16 15:23:29 2015 UTC (8 years, 11 months ago) by guez
Original Path: trunk/Sources/misc/writefield.f
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 guez 108 module WriteField_m
2    
3 guez 110 use CreateNewField_m, only: CreateNewField, ncid, nbfield, MaxWriteField
4 guez 109 use GetFieldIndex_m, only: GetFieldIndex
5 guez 115 USE netcdf95, ONLY: nf95_put_var, nf95_sync
6 guez 108
7     implicit none
8    
9 guez 110 integer, save:: Record(MaxWriteField)
10    
11 guez 108 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 guez 109 character(len=*), intent(in):: name
23     real, intent(in):: Field(:)
24 guez 108
25 guez 109 ! 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 guez 110 Record(Index) = 1
36 guez 109 else
37     Record(Index)=Record(Index)+1
38     endif
39    
40 guez 110 call NF95_PUT_VAR(Ncid(Index), Varid = 1, values = Field, &
41 guez 109 start = (/1, Record(Index)/))
42 guez 115 call nf95_sync(Ncid(Index))
43 guez 109
44 guez 108 end subroutine WriteField1d
45    
46     !****************************************************************
47    
48     subroutine WriteField2d(name,Field)
49    
50 guez 109 character(len=*), intent(in):: name
51     real, intent(in):: Field(:, :)
52 guez 108
53 guez 109 ! Local:
54 guez 115 integer index
55 guez 109
56     !-------------------------------------------
57    
58     Index=GetFieldIndex(name)
59    
60     if (Index==-1) then
61     call CreateNewField(name, shape(field))
62     Index=nbfield
63 guez 110 Record(Index) = 1
64 guez 109 else
65     Record(Index)=Record(Index)+1
66     endif
67    
68 guez 110 call NF95_PUT_VAR(Ncid(Index), Varid = 1, values = Field, &
69 guez 109 start = (/1, 1, Record(Index)/))
70 guez 115 call nf95_sync(Ncid(Index))
71 guez 109
72 guez 108 end subroutine WriteField2d
73    
74     !****************************************************************
75    
76     subroutine WriteField3d(name,Field)
77    
78 guez 109 character(len=*), intent(in):: name
79     real, intent(in):: Field(:, :, :)
80 guez 108
81 guez 109 ! 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 guez 110 Record(Index) = 1
92 guez 109 else
93     Record(Index)=Record(Index)+1
94     endif
95    
96 guez 110 call NF95_PUT_VAR(Ncid(Index), Varid = 1, values = Field, &
97 guez 109 start = (/1, 1, 1, Record(Index)/))
98 guez 115 call nf95_sync(Ncid(Index))
99 guez 109
100 guez 108 end subroutine WriteField3d
101    
102     end module WriteField_m

  ViewVC Help
Powered by ViewVC 1.1.21