[1632] | 1 | module write_field_p |
---|
[5113] | 2 | IMPLICIT NONE |
---|
[1632] | 3 | |
---|
| 4 | interface WriteField_p |
---|
| 5 | module procedure Write_field3d_p,Write_Field2d_p,Write_Field1d_p |
---|
| 6 | end interface WriteField_p |
---|
| 7 | |
---|
[5119] | 8 | CONTAINS |
---|
[1632] | 9 | |
---|
[5103] | 10 | SUBROUTINE write_field1D_p(name,Field) |
---|
[1823] | 11 | USE parallel_lmdz |
---|
[5117] | 12 | USE lmdz_write_field |
---|
[5113] | 13 | IMPLICIT NONE |
---|
[1632] | 14 | |
---|
[5117] | 15 | INTEGER, parameter :: MaxDim=1 |
---|
[5116] | 16 | CHARACTER(LEN=*) :: name |
---|
[5117] | 17 | REAL, DIMENSION(:) :: Field |
---|
| 18 | REAL, DIMENSION(:),ALLOCATABLE :: New_Field |
---|
| 19 | INTEGER, DIMENSION(MaxDim) :: Dim |
---|
[1632] | 20 | |
---|
| 21 | |
---|
| 22 | Dim=shape(Field) |
---|
| 23 | allocate(New_Field(Dim(1))) |
---|
| 24 | New_Field(:)=Field(:) |
---|
[5101] | 25 | CALL Gather_Field(New_Field,dim(1),1,0) |
---|
[1632] | 26 | |
---|
[5117] | 27 | IF (MPI_Rank==0) CALL WriteField(name,New_Field) |
---|
[1632] | 28 | |
---|
[5103] | 29 | END SUBROUTINE write_field1D_p |
---|
[1632] | 30 | |
---|
[5103] | 31 | SUBROUTINE write_field2D_p(name,Field) |
---|
[1823] | 32 | USE parallel_lmdz |
---|
[5117] | 33 | USE lmdz_write_field |
---|
[5113] | 34 | IMPLICIT NONE |
---|
[1632] | 35 | |
---|
[5117] | 36 | INTEGER, parameter :: MaxDim=2 |
---|
[5116] | 37 | CHARACTER(LEN=*) :: name |
---|
[5117] | 38 | REAL, DIMENSION(:,:) :: Field |
---|
| 39 | REAL, DIMENSION(:,:),ALLOCATABLE :: New_Field |
---|
| 40 | INTEGER, DIMENSION(MaxDim) :: Dim |
---|
[1632] | 41 | |
---|
| 42 | Dim=shape(Field) |
---|
| 43 | allocate(New_Field(Dim(1),Dim(2))) |
---|
| 44 | New_Field(:,:)=Field(:,:) |
---|
[5101] | 45 | CALL Gather_Field(New_Field(1,1),dim(1)*dim(2),1,0) |
---|
[1632] | 46 | |
---|
[5117] | 47 | IF (MPI_Rank==0) CALL WriteField(name,New_Field) |
---|
[1632] | 48 | |
---|
| 49 | |
---|
[5103] | 50 | END SUBROUTINE write_field2D_p |
---|
[1632] | 51 | |
---|
[5103] | 52 | SUBROUTINE write_field3D_p(name,Field) |
---|
[1823] | 53 | USE parallel_lmdz |
---|
[5117] | 54 | USE lmdz_write_field |
---|
[5113] | 55 | IMPLICIT NONE |
---|
[1632] | 56 | |
---|
[5117] | 57 | INTEGER, parameter :: MaxDim=3 |
---|
[5116] | 58 | CHARACTER(LEN=*) :: name |
---|
[5117] | 59 | REAL, DIMENSION(:,:,:) :: Field |
---|
| 60 | REAL, DIMENSION(:,:,:),ALLOCATABLE :: New_Field |
---|
| 61 | INTEGER, DIMENSION(MaxDim) :: Dim |
---|
[1632] | 62 | |
---|
| 63 | Dim=shape(Field) |
---|
| 64 | allocate(New_Field(Dim(1),Dim(2),Dim(3))) |
---|
| 65 | New_Field(:,:,:)=Field(:,:,:) |
---|
[5101] | 66 | CALL Gather_Field(New_Field(1,1,1),dim(1)*dim(2),dim(3),0) |
---|
[1632] | 67 | |
---|
[5117] | 68 | IF (MPI_Rank==0) CALL WriteField(name,New_Field) |
---|
[1632] | 69 | |
---|
[5103] | 70 | END SUBROUTINE write_field3D_p |
---|
[1632] | 71 | |
---|
[5119] | 72 | END MODULE write_field_p |
---|
[1632] | 73 | |
---|