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

Annotation of /trunk/bibio/writefield.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 115 - (hide annotations)
Fri Sep 19 17:36:20 2014 UTC (9 years, 8 months ago) by guez
File size: 2275 byte(s)
Extracted code from tau2alpha for first call into new procedure
init_tau2alpha. dxdys, dxdyu, dxdyv are now local variables if guide
computed by init_tau2alpha. This allows us to remove terrible argument
type of tau2alpha: we just give to tau2alpha the right dxdy and
rlat.

In module conf_guide_m, changed default values of tau_min_*, because
0.02 is too small for the default daystep = 240, iperiod = 5. Changed
default values of guide_[uv] to false. Moved variable ok_guide from
conf_gcm_m to conf_guide_m, ok_guide is no longer an input parameter,
it is computed from guide_*. Had then to move test on ok_guide and
day_step from conf_gcm_m to conf_guide_m. Added checks on input
nudging parameters in procedure conf_guide. Upgraded variable factt to
module conf_guide_m in order to check nudging parameters. Bug fix:
variable guide_q was not in namelist conf_guide_nml.

Removed unused variables aire_min, aire_max of MODULE guide_m.

Moved the call to conf_guide from guide to gcm. This was needed to
define ok_guide before getting into guide (since ok_guide is no longer
in conf_gcm_m). Moved test on grossismx and grossismy from tau2alpha
to guide. It is clearer now that only tau_max is used for a regular
grid, and we do not have to repeat this test in each call to
tau2alpha. In guide, we only call writefield when alpha is not a
constant.

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