Changeset 766 for LMDZ4/trunk/libf/phylmd/iophy.F90
- Timestamp:
- Jun 4, 2007, 4:34:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk/libf/phylmd/iophy.F90
r629 r766 7 7 REAL,private,allocatable,dimension(:),save :: io_lat 8 8 REAL,private,allocatable,dimension(:),save :: io_lon 9 INTEGER, save :: phys_domain_id 9 10 10 11 INTERFACE histwrite_phy 11 12 MODULE PROCEDURE histwrite2d_phy,histwrite3d_phy 12 13 END INTERFACE 14 15 REAL,private,allocatable,save,dimension(:,:) :: buffer_omp 13 16 14 17 contains … … 16 19 subroutine init_iophy(lat,lon) 17 20 use dimphy 21 use ioipsl 18 22 implicit none 19 23 include 'dimensions90.h' 20 24 real,dimension(iim),intent(in) :: lon 21 25 real,dimension(jjm+1),intent(in) :: lat 22 26 27 INTEGER,DIMENSION(2) :: ddid 28 INTEGER,DIMENSION(2) :: dsg 29 INTEGER,DIMENSION(2) :: dsl 30 INTEGER,DIMENSION(2) :: dpf 31 INTEGER,DIMENSION(2) :: dpl 32 INTEGER,DIMENSION(2) :: dhs 33 INTEGER,DIMENSION(2) :: dhe 34 35 !$OMP MASTER 23 36 allocate(io_lat(jjm+1)) 24 37 io_lat(:)=lat(:) … … 31 44 ndex2d(:)=0 32 45 ndex3d(:)=0 46 allocate(buffer_omp(klon_mpi,klev)) 47 48 ddid=(/ 1,2 /) 49 dsg=(/ iim, jjm+1 /) 50 dsl=(/ iim, jjphy_nb /) 51 dpf=(/ 1,jjphy_begin /) 52 dpl=(/ iim, jjphy_end /) 53 dhs=(/ iiphy_begin-1,0 /) 54 if (phy_rank==phy_size-1) then 55 dhe=(/0,0/) 56 else 57 dhe=(/ iim-iiphy_end,0 /) 58 endif 59 60 call flio_dom_set(phy_size,phy_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, & 61 'APPLE',phys_domain_id) 33 62 63 !$OMP END MASTER 64 !$OMP FLUSH(buffer_omp) 65 34 66 end subroutine init_iophy 35 67 … … 47 79 integer,intent(out) :: nhori 48 80 integer,intent(out) :: nid_day 49 81 82 !$OMP MASTER 50 83 if (monocpu) then 51 84 call histbeg(name,iim,io_lon, jjphy_nb,io_lat(jjphy_begin:jjphy_end), & 52 85 1,iim,1,jjphy_nb,itau0, zjulian, dtime, nhori, nid_day) 53 86 else 54 call histbeg(name //'_'//trim(int2str(phy_rank)),iim,io_lon, jjphy_nb,io_lat(jjphy_begin:jjphy_end), &55 1,iim,1,jjphy_nb,itau0, zjulian, dtime, nhori, nid_day )87 call histbeg(name,iim,io_lon, jjphy_nb,io_lat(jjphy_begin:jjphy_end), & 88 1,iim,1,jjphy_nb,itau0, zjulian, dtime, nhori, nid_day,phys_domain_id) 56 89 endif 90 !$OMP END MASTER 57 91 58 92 end subroutine histbeg_phy … … 68 102 integer, intent(in) :: itau 69 103 real,dimension(klon),intent(in) :: field 70 71 CALL phy2dyn(field,tmp_tab2d,1) 104 105 CALL GatherField_omp(field,buffer_omp,1) 106 !$OMP MASTER 107 CALL phy2dyn(buffer_omp,tmp_tab2d,1) 72 108 CALL histwrite(nid,name,itau,tmp_tab2d,iim*jjphy_nb,ndex2d) 73 109 !$OMP END MASTER 74 110 end subroutine histwrite2d_phy 75 111 … … 85 121 real,dimension(klon,klev),intent(in) :: field 86 122 87 CALL phy2dyn(field,tmp_tab3d,klev) 123 CALL GatherField_omp(field,buffer_omp,klev) 124 !$OMP MASTER 125 CALL phy2dyn(buffer_omp,tmp_tab3d,klev) 88 126 CALL histwrite(nid,name,itau,tmp_tab3d,iim*jjphy_nb*klev,ndex3d) 89 127 !$OMP END MASTER 90 128 end subroutine histwrite3d_phy 91 129 … … 96 134 include 'dimensions90.h' 97 135 98 real,dimension(klon ,nlev),intent(in) :: field_phy136 real,dimension(klon_mpi,nlev),intent(in) :: field_phy 99 137 real,dimension(iim,jjphy_nb,nlev),intent(out) :: field_dyn 100 138 integer,intent(in) :: nlev … … 107 145 if (jjphy_begin==jjphy_end) then 108 146 field_dyn(:,1,l)=0. 109 field_dyn(iiphy_begin:iiphy_end,1,l)=field_phy(1:klon ,l)147 field_dyn(iiphy_begin:iiphy_end,1,l)=field_phy(1:klon_mpi,l) 110 148 else 111 149 … … 115 153 else 116 154 field_dyn(:,1,l)=0. 117 next=iim-iiphy_begin+ 1155 next=iim-iiphy_begin+2 118 156 field_dyn(iiphy_begin:iim,1,l)=field_phy(1:next-1,l) 119 157 endif … … 125 163 126 164 if (jjphy_end==jjm+1) then 127 field_dyn(:,jjphy_nb,l)=field_phy(klon ,l)165 field_dyn(:,jjphy_nb,l)=field_phy(klon_mpi,l) 128 166 else 129 167 field_dyn(:,jjphy_nb,l)=0.
Note: See TracChangeset
for help on using the changeset viewer.