1 |
module WriteField_m |
module WriteField_m |
2 |
|
|
3 |
USE write_field, ONLY: ncid, record, varid, nbfield |
use CreateNewField_m, only: CreateNewField, ncid, nbfield, MaxWriteField |
|
use CreateNewField_m, only: CreateNewField |
|
4 |
use GetFieldIndex_m, only: GetFieldIndex |
use GetFieldIndex_m, only: GetFieldIndex |
5 |
USE netcdf95, ONLY: nf95_put_var |
USE netcdf95, ONLY: nf95_put_var, nf95_sync |
6 |
|
|
7 |
implicit none |
implicit none |
8 |
|
|
9 |
|
integer, save:: Record(MaxWriteField) |
10 |
|
|
11 |
interface WriteField |
interface WriteField |
12 |
module procedure WriteField3d,WriteField2d,WriteField1d |
module procedure WriteField3d,WriteField2d,WriteField1d |
13 |
end interface WriteField |
end interface WriteField |
32 |
if (Index==-1) then |
if (Index==-1) then |
33 |
call CreateNewField(name, shape(field)) |
call CreateNewField(name, shape(field)) |
34 |
Index=nbfield |
Index=nbfield |
35 |
|
Record(Index) = 1 |
36 |
else |
else |
37 |
Record(Index)=Record(Index)+1 |
Record(Index)=Record(Index)+1 |
38 |
endif |
endif |
39 |
|
|
40 |
call NF95_PUT_VAR(Ncid(Index), Varid(Index), Field, & |
call NF95_PUT_VAR(Ncid(Index), Varid = 1, values = Field, & |
41 |
start = (/1, Record(Index)/)) |
start = (/1, Record(Index)/)) |
42 |
|
call nf95_sync(Ncid(Index)) |
43 |
|
|
44 |
end subroutine WriteField1d |
end subroutine WriteField1d |
45 |
|
|
60 |
if (Index==-1) then |
if (Index==-1) then |
61 |
call CreateNewField(name, shape(field)) |
call CreateNewField(name, shape(field)) |
62 |
Index=nbfield |
Index=nbfield |
63 |
|
Record(Index) = 1 |
64 |
else |
else |
65 |
Record(Index)=Record(Index)+1 |
Record(Index)=Record(Index)+1 |
66 |
endif |
endif |
67 |
|
|
68 |
call NF95_PUT_VAR(Ncid(Index), Varid(Index), Field, & |
call NF95_PUT_VAR(Ncid(Index), Varid = 1, values = Field, & |
69 |
start = (/1, 1, Record(Index)/)) |
start = (/1, 1, Record(Index)/)) |
70 |
|
call nf95_sync(Ncid(Index)) |
71 |
|
|
72 |
end subroutine WriteField2d |
end subroutine WriteField2d |
73 |
|
|
88 |
if (Index==-1) then |
if (Index==-1) then |
89 |
call CreateNewField(name, shape(field)) |
call CreateNewField(name, shape(field)) |
90 |
Index=nbfield |
Index=nbfield |
91 |
|
Record(Index) = 1 |
92 |
else |
else |
93 |
Record(Index)=Record(Index)+1 |
Record(Index)=Record(Index)+1 |
94 |
endif |
endif |
95 |
|
|
96 |
call NF95_PUT_VAR(Ncid(Index), Varid(Index), Field, & |
call NF95_PUT_VAR(Ncid(Index), Varid = 1, values = Field, & |
97 |
start = (/1, 1, 1, Record(Index)/)) |
start = (/1, 1, 1, Record(Index)/)) |
98 |
|
call nf95_sync(Ncid(Index)) |
99 |
|
|
100 |
end subroutine WriteField3d |
end subroutine WriteField3d |
101 |
|
|