[631] | 1 | module write_field_p |
---|
| 2 | implicit none |
---|
| 3 | |
---|
| 4 | interface WriteField_p |
---|
| 5 | module procedure Write_field3d_p,Write_Field2d_p,Write_Field1d_p |
---|
| 6 | end interface |
---|
| 7 | |
---|
| 8 | contains |
---|
| 9 | |
---|
| 10 | subroutine write_field1D_p(name,Field) |
---|
| 11 | USE parallel |
---|
| 12 | USE write_field |
---|
| 13 | implicit none |
---|
| 14 | |
---|
| 15 | integer, parameter :: MaxDim=1 |
---|
| 16 | character(len=*) :: name |
---|
| 17 | real, dimension(:) :: Field |
---|
| 18 | real, dimension(:),allocatable :: New_Field |
---|
| 19 | integer, dimension(MaxDim) :: Dim |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | Dim=shape(Field) |
---|
| 23 | allocate(New_Field(Dim(1))) |
---|
| 24 | New_Field(:)=Field(:) |
---|
| 25 | call Gather_Field(New_Field,dim(1),1,0) |
---|
| 26 | |
---|
| 27 | if (MPI_Rank==0) call WriteField(name,New_Field) |
---|
| 28 | |
---|
| 29 | end subroutine write_field1D_p |
---|
| 30 | |
---|
| 31 | subroutine write_field2D_p(name,Field) |
---|
| 32 | USE parallel |
---|
| 33 | USE write_field |
---|
| 34 | implicit none |
---|
| 35 | |
---|
| 36 | integer, parameter :: MaxDim=2 |
---|
| 37 | character(len=*) :: name |
---|
| 38 | real, dimension(:,:) :: Field |
---|
| 39 | real, dimension(:,:),allocatable :: New_Field |
---|
| 40 | integer, dimension(MaxDim) :: Dim |
---|
| 41 | |
---|
| 42 | Dim=shape(Field) |
---|
| 43 | allocate(New_Field(Dim(1),Dim(2))) |
---|
| 44 | New_Field(:,:)=Field(:,:) |
---|
| 45 | call Gather_Field(New_Field(1,1),dim(1)*dim(2),1,0) |
---|
| 46 | |
---|
| 47 | if (MPI_Rank==0) call WriteField(name,New_Field) |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | end subroutine write_field2D_p |
---|
| 51 | |
---|
| 52 | subroutine write_field3D_p(name,Field) |
---|
| 53 | USE parallel |
---|
| 54 | USE write_field |
---|
| 55 | implicit none |
---|
| 56 | |
---|
| 57 | integer, parameter :: MaxDim=3 |
---|
| 58 | character(len=*) :: name |
---|
| 59 | real, dimension(:,:,:) :: Field |
---|
| 60 | real, dimension(:,:,:),allocatable :: New_Field |
---|
| 61 | integer, dimension(MaxDim) :: Dim |
---|
| 62 | |
---|
| 63 | Dim=shape(Field) |
---|
| 64 | allocate(New_Field(Dim(1),Dim(2),Dim(3))) |
---|
| 65 | New_Field(:,:,:)=Field(:,:,:) |
---|
| 66 | call Gather_Field(New_Field(1,1,1),dim(1)*dim(2),dim(3),0) |
---|
| 67 | |
---|
| 68 | if (MPI_Rank==0) call WriteField(name,New_Field) |
---|
| 69 | |
---|
| 70 | end subroutine write_field3D_p |
---|
| 71 | |
---|
| 72 | subroutine WriteField_phy_p(name,Field,ll) |
---|
| 73 | USE dimphy |
---|
| 74 | USE Write_Field |
---|
| 75 | implicit none |
---|
| 76 | character(len=*) :: name |
---|
| 77 | INTEGER :: ll |
---|
| 78 | real, dimension(klon,ll) :: Field |
---|
| 79 | real, dimension(klon2,ll):: New_Field |
---|
| 80 | |
---|
| 81 | CALL GatherField(Field,New_Field,ll) |
---|
| 82 | CALL WriteField_phy(name,New_Field,ll) |
---|
| 83 | |
---|
| 84 | end subroutine WriteField_phy_p |
---|
| 85 | |
---|
| 86 | end module write_field_p |
---|
| 87 | |
---|