Changeset 1543 for trunk/LMDZ.COMMON/libf/dynphy_lonlat
- Timestamp:
- Apr 22, 2016, 9:02:11 AM (9 years ago)
- Location:
- trunk/LMDZ.COMMON/libf/dynphy_lonlat
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/dynphy_lonlat/calfis_p.F
r1459 r1543 29 29 ! Ehouarn: if using (parallelized) physics 30 30 USE dimphy 31 USE mod_phys_lmdz_para, mpi_root_xx=>mpi_root 31 USE mod_phys_lmdz_mpi_data, mpi_root_xx=>mpi_master 32 USE mod_phys_lmdz_omp_data, ONLY: klon_omp, klon_omp_begin 33 USE mod_const_mpi, ONLY: COMM_LMDZ 32 34 USE mod_interface_dyn_phys 33 35 ! USE IOPHY -
trunk/LMDZ.COMMON/libf/dynphy_lonlat/mod_interface_dyn_phys.F90
r1403 r1543 1 1 ! 2 ! $Id: mod_interface_dyn_phys.F90 1615 2012-02-10 15:42:26Z emillour $2 ! $Id: mod_interface_dyn_phys.F90 2351 2015-08-25 15:14:59Z emillour $ 3 3 ! 4 4 MODULE mod_interface_dyn_phys … … 7 7 8 8 9 #ifdef CPP_PHYS10 ! Interface with parallel physics,11 9 CONTAINS 12 10 11 #ifdef CPP_PARA 12 ! Interface with parallel physics, 13 13 SUBROUTINE Init_interface_dyn_phys 14 USE mod_phys_lmdz_mpi_data, ONLY: klon_mpi, is_north_pole, is_south_pole, & 15 ii_begin, jj_begin, ii_end, jj_end 14 USE mod_phys_lmdz_mpi_data 16 15 IMPLICIT NONE 17 16 include 'dimensions.h' … … 55 54 56 55 END SUBROUTINE Init_interface_dyn_phys 56 #else 57 SUBROUTINE Init_interface_dyn_phys 58 ! dummy routine for seq case 59 END SUBROUTINE Init_interface_dyn_phys 57 60 #endif 58 ! of #ifdef CPP_P HYS61 ! of #ifdef CPP_PARA 59 62 END MODULE mod_interface_dyn_phys -
trunk/LMDZ.COMMON/libf/dynphy_lonlat/phytitan/iniphysiq_mod.F90
r1525 r1543 6 6 CONTAINS 7 7 8 SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep, & 9 rlatu,rlatv,rlonu,rlonv,aire,cu,cv, & 8 SUBROUTINE iniphysiq(iim,jjm,nlayer, & 9 nbp, communicator, & 10 punjours, pdayref,ptimestep, & 11 rlatu,rlatv,rlonu,rlonv,aire,cu,cv, & 10 12 prad,pg,pr,pcpp,iflag_phys) 11 USE dimphy, ONLY: klev ! number of atmospheric levels 12 USE mod_grid_phy_lmdz, ONLY: klon_glo ! number of atmospheric columns 13 ! (on full grid) 13 USE dimphy, ONLY: init_dimphy 14 USE mod_grid_phy_lmdz, ONLY: klon_glo, & ! number of atmospheric columns (on full grid) 15 regular_lonlat, & ! regular longitude-latitude grid type 16 nbp_lon, nbp_lat, nbp_lev 14 17 USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid) 15 18 klon_omp_begin, & ! start index of local omp subgrid … … 17 20 klon_mpi_begin ! start indes of columns (on local mpi grid) 18 21 USE control_mod, ONLY: nday 19 USE comgeomphy, ONLY: initcomgeomphy, & 20 airephy, & ! physics grid area (m2) 21 cuphy, & ! cu coeff. (u_covariant = cu * u) 22 cvphy, & ! cv coeff. (v_covariant = cv * v) 23 rlond, & ! longitudes 24 rlatd ! latitudes 22 USE geometry_mod, ONLY : init_geometry 23 ! USE comgeomphy, ONLY: initcomgeomphy, & 24 ! airephy, & ! physics grid area (m2) 25 ! cuphy, & ! cu coeff. (u_covariant = cu * u) 26 ! cvphy, & ! cv coeff. (v_covariant = cv * v) 27 ! rlond, & ! longitudes 28 ! rlatd ! latitudes 25 29 USE temps_mod, ONLY: annee_ref, day_ref, day_ini, day_end 26 30 USE time_phylmdz_mod, ONLY: init_time 31 USE physics_distribution_mod, ONLY : init_physics_distribution 27 32 USE regular_lonlat_mod, ONLY : init_regular_lonlat, & 28 33 east, west, north, south, & 29 34 north_east, north_west, & 30 35 south_west, south_east 36 USE mod_interface_dyn_phys, ONLY : init_interface_dyn_phys 31 37 USE nrtype, ONLY: pi 32 38 IMPLICIT NONE … … 48 54 INTEGER, INTENT (IN) :: iim ! number of atmospheric columns along longitudes 49 55 INTEGER, INTENT (IN) :: jjm ! number of atompsheric columns along latitudes 56 INTEGER, INTENT(IN) :: nbp ! number of physics columns for this MPI process 57 INTEGER, INTENT(IN) :: communicator ! MPI communicator 50 58 REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid 51 59 REAL, INTENT (IN) :: rlatv(jjm) ! latitude boundaries of the physics grid … … 60 68 61 69 INTEGER :: ibegin, iend, offset 62 INTEGER :: i,j 70 INTEGER :: i,j,k 63 71 CHARACTER (LEN=20) :: modname = 'iniphysiq' 64 72 CHARACTER (LEN=80) :: abort_message … … 70 78 71 79 ! global array, on full physics grid: 72 REAL,ALLOCATABLE :: latfi(:) 73 REAL,ALLOCATABLE :: lonfi(:) 74 REAL,ALLOCATABLE :: cufi(:) 75 REAL,ALLOCATABLE :: cvfi(:) 76 REAL,ALLOCATABLE :: airefi(:) 77 78 IF (nlayer/=klev) THEN 79 WRITE (lunout, *) 'STOP in ', trim(modname) 80 WRITE (lunout, *) 'Problem with dimensions :' 81 WRITE (lunout, *) 'nlayer = ', nlayer 82 WRITE (lunout, *) 'klev = ', klev 83 abort_message = '' 84 CALL abort_gcm(modname, 'Problem with dimensions', 1) 85 END IF 86 87 !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/)) 80 REAL,ALLOCATABLE :: latfi_glo(:) 81 REAL,ALLOCATABLE :: lonfi_glo(:) 82 REAL,ALLOCATABLE :: cufi_glo(:) 83 REAL,ALLOCATABLE :: cvfi_glo(:) 84 REAL,ALLOCATABLE :: airefi_glo(:) 85 REAL,ALLOCATABLE :: boundslonfi_glo(:,:) 86 REAL,ALLOCATABLE :: boundslatfi_glo(:,:) 87 88 ! local arrays, on given MPI/OpenMP domain: 89 REAL,ALLOCATABLE,SAVE :: latfi(:) 90 REAL,ALLOCATABLE,SAVE :: lonfi(:) 91 REAL,ALLOCATABLE,SAVE :: cufi(:) 92 REAL,ALLOCATABLE,SAVE :: cvfi(:) 93 REAL,ALLOCATABLE,SAVE :: airefi(:) 94 REAL,ALLOCATABLE,SAVE :: boundslonfi(:,:) 95 REAL,ALLOCATABLE,SAVE :: boundslatfi(:,:) 96 !$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi) 97 98 ! Initialize Physics distibution and parameters and interface with dynamics 99 IF (iim*jjm>1) THEN ! general 3D case 100 CALL init_physics_distribution(regular_lonlat,4, & 101 nbp,iim,jjm+1,nlayer,communicator) 102 ELSE ! For 1D model 103 CALL init_physics_distribution(regular_lonlat,4, & 104 1,1,1,nlayer,communicator) 105 ENDIF 106 CALL init_interface_dyn_phys 88 107 89 108 ! init regular global longitude-latitude grid points and boundaries … … 110 129 111 130 ! Generate global arrays on full physics grid 112 ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo)) 113 ALLOCATE(airefi(klon_glo)) 131 ALLOCATE(latfi_glo(klon_glo),lonfi_glo(klon_glo)) 132 ALLOCATE(cufi_glo(klon_glo),cvfi_glo(klon_glo)) 133 ALLOCATE(airefi_glo(klon_glo)) 134 ALLOCATE(boundslonfi_glo(klon_glo,4)) 135 ALLOCATE(boundslatfi_glo(klon_glo,4)) 114 136 115 137 IF (klon_glo>1) THEN ! general case 116 138 ! North pole 117 latfi(1)=rlatu(1) 118 lonfi(1)=0. 119 cufi(1) = cu(1) 120 cvfi(1) = cv(1) 139 latfi_glo(1)=rlatu(1) 140 lonfi_glo(1)=0. 141 cufi_glo(1) = cu(1) 142 cvfi_glo(1) = cv(1) 143 boundslonfi_glo(1,north_east)=0 144 boundslatfi_glo(1,north_east)=PI/2 145 boundslonfi_glo(1,north_west)=2*PI 146 boundslatfi_glo(1,north_west)=PI/2 147 boundslonfi_glo(1,south_west)=2*PI 148 boundslatfi_glo(1,south_west)=rlatv(1) 149 boundslonfi_glo(1,south_east)=0 150 boundslatfi_glo(1,south_east)=rlatv(1) 121 151 DO j=2,jjm 122 152 DO i=1,iim 123 latfi((j-2)*iim+1+i)= rlatu(j) 124 lonfi((j-2)*iim+1+i)= rlonv(i) 125 cufi((j-2)*iim+1+i) = cu((j-1)*(iim+1)+i) 126 cvfi((j-2)*iim+1+i) = cv((j-1)*(iim+1)+i) 153 k=(j-2)*iim+1+i 154 latfi_glo(k)= rlatu(j) 155 lonfi_glo(k)= rlonv(i) 156 cufi_glo(k) = cu((j-1)*(iim+1)+i) 157 cvfi_glo(k) = cv((j-1)*(iim+1)+i) 158 boundslonfi_glo(k,north_east)=rlonu(i) 159 boundslatfi_glo(k,north_east)=rlatv(j-1) 160 boundslonfi_glo(k,north_west)=rlonu(i+1) 161 boundslatfi_glo(k,north_west)=rlatv(j-1) 162 boundslonfi_glo(k,south_west)=rlonu(i+1) 163 boundslatfi_glo(k,south_west)=rlatv(j) 164 boundslonfi_glo(k,south_east)=rlonu(i) 165 boundslatfi_glo(k,south_east)=rlatv(j) 127 166 ENDDO 128 167 ENDDO 129 168 ! South pole 130 latfi(klon_glo)= rlatu(jjm+1) 131 lonfi(klon_glo)= 0. 132 cufi(klon_glo) = cu((iim+1)*jjm+1) 133 cvfi(klon_glo) = cv((iim+1)*jjm-iim) 169 latfi_glo(klon_glo)= rlatu(jjm+1) 170 lonfi_glo(klon_glo)= 0. 171 cufi_glo(klon_glo) = cu((iim+1)*jjm+1) 172 cvfi_glo(klon_glo) = cv((iim+1)*jjm-iim) 173 boundslonfi_glo(klon_glo,north_east)= 0 174 boundslatfi_glo(klon_glo,north_east)= rlatv(jjm) 175 boundslonfi_glo(klon_glo,north_west)= 2*PI 176 boundslatfi_glo(klon_glo,north_west)= rlatv(jjm) 177 boundslonfi_glo(klon_glo,south_west)= 2*PI 178 boundslatfi_glo(klon_glo,south_west)= -PI/2 179 boundslonfi_glo(klon_glo,south_east)= 0 180 boundslatfi_glo(klon_glo,south_east)= -Pi/2 134 181 135 182 ! build airefi(), mesh area on physics grid 136 CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi )183 CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi_glo) 137 184 ! Poles are single points on physics grid 138 airefi (1)=sum(aire(1:iim,1))139 airefi (klon_glo)=sum(aire(1:iim,jjm+1))185 airefi_glo(1)=sum(aire(1:iim,1)) 186 airefi_glo(klon_glo)=sum(aire(1:iim,jjm+1)) 140 187 141 188 ! Sanity check: do total planet area match between physics and dynamics? 142 189 total_area_dyn=sum(aire(1:iim,1:jjm+1)) 143 total_area_phy=sum(airefi (1:klon_glo))190 total_area_phy=sum(airefi_glo(1:klon_glo)) 144 191 IF (total_area_dyn/=total_area_phy) THEN 145 192 WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!' … … 154 201 ELSE ! klon_glo==1, running the 1D model 155 202 ! just copy over input values 156 latfi(1)=rlatu(1) 157 lonfi(1)=rlonv(1) 158 cufi(1)=cu(1) 159 cvfi(1)=cv(1) 160 airefi(1)=aire(1,1) 203 latfi_glo(1)=rlatu(1) 204 lonfi_glo(1)=rlonv(1) 205 cufi_glo(1)=cu(1) 206 cvfi_glo(1)=cv(1) 207 airefi_glo(1)=aire(1,1) 208 boundslonfi_glo(1,north_east)=rlonu(1) 209 boundslatfi_glo(1,north_east)=PI/2 210 boundslonfi_glo(1,north_west)=rlonu(2) 211 boundslatfi_glo(1,north_west)=PI/2 212 boundslonfi_glo(1,south_west)=rlonu(2) 213 boundslatfi_glo(1,south_west)=rlatv(1) 214 boundslonfi_glo(1,south_east)=rlonu(1) 215 boundslatfi_glo(1,south_east)=rlatv(1) 161 216 ENDIF ! of IF (klon_glo>1) 162 217 163 218 !$OMP PARALLEL 164 ! Now generate local lon/lat/cu/cv/area arrays 165 CALL initcomgeomphy 219 ! Now generate local lon/lat/cu/cv/area/bounds arrays 220 ALLOCATE(latfi(klon_omp),lonfi(klon_omp),cufi(klon_omp),cvfi(klon_omp)) 221 ALLOCATE(airefi(klon_omp)) 222 ALLOCATE(boundslonfi(klon_omp,4)) 223 ALLOCATE(boundslatfi(klon_omp,4)) 224 ! CALL initcomgeomphy 166 225 167 226 offset = klon_mpi_begin - 1 168 airephy(1:klon_omp) = airefi(offset+klon_omp_begin:offset+klon_omp_end) 169 cuphy(1:klon_omp) = cufi(offset+klon_omp_begin:offset+klon_omp_end) 170 cvphy(1:klon_omp) = cvfi(offset+klon_omp_begin:offset+klon_omp_end) 171 rlond(1:klon_omp) = lonfi(offset+klon_omp_begin:offset+klon_omp_end) 172 rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end) 227 airefi(1:klon_omp) = airefi_glo(offset+klon_omp_begin:offset+klon_omp_end) 228 cufi(1:klon_omp) = cufi_glo(offset+klon_omp_begin:offset+klon_omp_end) 229 cvfi(1:klon_omp) = cvfi_glo(offset+klon_omp_begin:offset+klon_omp_end) 230 lonfi(1:klon_omp) = lonfi_glo(offset+klon_omp_begin:offset+klon_omp_end) 231 latfi(1:klon_omp) = latfi_glo(offset+klon_omp_begin:offset+klon_omp_end) 232 boundslonfi(1:klon_omp,:) = boundslonfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:) 233 boundslatfi(1:klon_omp,:) = boundslatfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:) 234 235 ! copy over local grid longitudes and latitudes 236 CALL init_geometry(klon_omp,lonfi,latfi,boundslonfi,boundslatfi, & 237 airefi,cufi,cvfi) 173 238 174 239 ! Initialize some physical constants … … 177 242 ! Initialize some "temporal and calendar" related variables 178 243 CALL init_time(annee_ref,day_ref,day_ini,day_end,nday,ptimestep) 244 245 ! Initialize dimphy module 246 CALL Init_dimphy(klon_omp,nlayer) 179 247 180 248 !$OMP END PARALLEL -
trunk/LMDZ.COMMON/libf/dynphy_lonlat/phyvenus/iniphysiq_mod.F90
r1524 r1543 6 6 CONTAINS 7 7 8 SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep, & 9 rlatu,rlatv,rlonu,rlonv,aire,cu,cv, & 8 SUBROUTINE iniphysiq(iim,jjm,nlayer, & 9 nbp, communicator, & 10 punjours, pdayref,ptimestep, & 11 rlatu,rlatv,rlonu,rlonv,aire,cu,cv, & 10 12 prad,pg,pr,pcpp,iflag_phys) 11 USE dimphy, ONLY: klev ! number of atmospheric levels 12 USE mod_grid_phy_lmdz, ONLY: klon_glo ! number of atmospheric columns 13 ! (on full grid) 13 USE dimphy, ONLY: init_dimphy 14 USE mod_grid_phy_lmdz, ONLY: klon_glo, & ! number of atmospheric columns (on full grid) 15 regular_lonlat, & ! regular longitude-latitude grid type 16 nbp_lon, nbp_lat, nbp_lev 14 17 USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid) 15 18 klon_omp_begin, & ! start index of local omp subgrid 16 19 klon_omp_end, & ! end index of local omp subgrid 17 20 klon_mpi_begin ! start indes of columns (on local mpi grid) 18 USE comgeomphy, ONLY: initcomgeomphy, & 19 airephy, & ! physics grid area (m2) 20 cuphy, & ! cu coeff. (u_covariant = cu * u) 21 cvphy, & ! cv coeff. (v_covariant = cv * v) 22 rlond, & ! longitudes 23 rlatd ! latitudes 21 USE geometry_mod, ONLY : init_geometry 22 ! USE comgeomphy, ONLY: initcomgeomphy, & 23 ! airephy, & ! physics grid area (m2) 24 ! cuphy, & ! cu coeff. (u_covariant = cu * u) 25 ! cvphy, & ! cv coeff. (v_covariant = cv * v) 26 ! rlond, & ! longitudes 27 ! rlatd ! latitudes 24 28 USE temps_mod, ONLY: annee_ref, day_ref, day_ini, day_end 25 29 USE time_phylmdz_mod, ONLY: init_time 30 USE physics_distribution_mod, ONLY : init_physics_distribution 26 31 USE regular_lonlat_mod, ONLY : init_regular_lonlat, & 27 32 east, west, north, south, & 28 33 north_east, north_west, & 29 34 south_west, south_east 35 USE mod_interface_dyn_phys, ONLY : init_interface_dyn_phys 30 36 USE nrtype, ONLY: pi 31 37 IMPLICIT NONE … … 47 53 INTEGER, INTENT (IN) :: iim ! number of atmospheric columns along longitudes 48 54 INTEGER, INTENT (IN) :: jjm ! number of atompsheric columns along latitudes 55 INTEGER, INTENT(IN) :: nbp ! number of physics columns for this MPI process 56 INTEGER, INTENT(IN) :: communicator ! MPI communicator 49 57 REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid 50 58 REAL, INTENT (IN) :: rlatv(jjm) ! latitude boundaries of the physics grid … … 59 67 60 68 INTEGER :: ibegin, iend, offset 61 INTEGER :: i,j 69 INTEGER :: i,j,k 62 70 CHARACTER (LEN=20) :: modname = 'iniphysiq' 63 71 CHARACTER (LEN=80) :: abort_message … … 69 77 70 78 ! global array, on full physics grid: 71 REAL,ALLOCATABLE :: latfi(:) 72 REAL,ALLOCATABLE :: lonfi(:) 73 REAL,ALLOCATABLE :: cufi(:) 74 REAL,ALLOCATABLE :: cvfi(:) 75 REAL,ALLOCATABLE :: airefi(:) 76 77 IF (nlayer/=klev) THEN 78 WRITE (lunout, *) 'STOP in ', trim(modname) 79 WRITE (lunout, *) 'Problem with dimensions :' 80 WRITE (lunout, *) 'nlayer = ', nlayer 81 WRITE (lunout, *) 'klev = ', klev 82 abort_message = '' 83 CALL abort_gcm(modname, 'Problem with dimensions', 1) 84 END IF 85 86 !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/)) 79 REAL,ALLOCATABLE :: latfi_glo(:) 80 REAL,ALLOCATABLE :: lonfi_glo(:) 81 REAL,ALLOCATABLE :: cufi_glo(:) 82 REAL,ALLOCATABLE :: cvfi_glo(:) 83 REAL,ALLOCATABLE :: airefi_glo(:) 84 REAL,ALLOCATABLE :: boundslonfi_glo(:,:) 85 REAL,ALLOCATABLE :: boundslatfi_glo(:,:) 86 87 ! local arrays, on given MPI/OpenMP domain: 88 REAL,ALLOCATABLE,SAVE :: latfi(:) 89 REAL,ALLOCATABLE,SAVE :: lonfi(:) 90 REAL,ALLOCATABLE,SAVE :: cufi(:) 91 REAL,ALLOCATABLE,SAVE :: cvfi(:) 92 REAL,ALLOCATABLE,SAVE :: airefi(:) 93 REAL,ALLOCATABLE,SAVE :: boundslonfi(:,:) 94 REAL,ALLOCATABLE,SAVE :: boundslatfi(:,:) 95 !$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi) 96 97 ! Initialize Physics distibution and parameters and interface with dynamics 98 IF (iim*jjm>1) THEN ! general 3D case 99 CALL init_physics_distribution(regular_lonlat,4, & 100 nbp,iim,jjm+1,nlayer,communicator) 101 ELSE ! For 1D model 102 CALL init_physics_distribution(regular_lonlat,4, & 103 1,1,1,nlayer,communicator) 104 ENDIF 105 CALL init_interface_dyn_phys 87 106 88 107 ! init regular global longitude-latitude grid points and boundaries … … 109 128 110 129 ! Generate global arrays on full physics grid 111 ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo)) 112 ALLOCATE(airefi(klon_glo)) 130 ALLOCATE(latfi_glo(klon_glo),lonfi_glo(klon_glo)) 131 ALLOCATE(cufi_glo(klon_glo),cvfi_glo(klon_glo)) 132 ALLOCATE(airefi_glo(klon_glo)) 133 ALLOCATE(boundslonfi_glo(klon_glo,4)) 134 ALLOCATE(boundslatfi_glo(klon_glo,4)) 113 135 114 136 IF (klon_glo>1) THEN ! general case 115 137 ! North pole 116 latfi(1)=rlatu(1) 117 lonfi(1)=0. 118 cufi(1) = cu(1) 119 cvfi(1) = cv(1) 138 latfi_glo(1)=rlatu(1) 139 lonfi_glo(1)=0. 140 cufi_glo(1) = cu(1) 141 cvfi_glo(1) = cv(1) 142 boundslonfi_glo(1,north_east)=0 143 boundslatfi_glo(1,north_east)=PI/2 144 boundslonfi_glo(1,north_west)=2*PI 145 boundslatfi_glo(1,north_west)=PI/2 146 boundslonfi_glo(1,south_west)=2*PI 147 boundslatfi_glo(1,south_west)=rlatv(1) 148 boundslonfi_glo(1,south_east)=0 149 boundslatfi_glo(1,south_east)=rlatv(1) 120 150 DO j=2,jjm 121 151 DO i=1,iim 122 latfi((j-2)*iim+1+i)= rlatu(j) 123 lonfi((j-2)*iim+1+i)= rlonv(i) 124 cufi((j-2)*iim+1+i) = cu((j-1)*(iim+1)+i) 125 cvfi((j-2)*iim+1+i) = cv((j-1)*(iim+1)+i) 152 k=(j-2)*iim+1+i 153 latfi_glo(k)= rlatu(j) 154 lonfi_glo(k)= rlonv(i) 155 cufi_glo(k) = cu((j-1)*(iim+1)+i) 156 cvfi_glo(k) = cv((j-1)*(iim+1)+i) 157 boundslonfi_glo(k,north_east)=rlonu(i) 158 boundslatfi_glo(k,north_east)=rlatv(j-1) 159 boundslonfi_glo(k,north_west)=rlonu(i+1) 160 boundslatfi_glo(k,north_west)=rlatv(j-1) 161 boundslonfi_glo(k,south_west)=rlonu(i+1) 162 boundslatfi_glo(k,south_west)=rlatv(j) 163 boundslonfi_glo(k,south_east)=rlonu(i) 164 boundslatfi_glo(k,south_east)=rlatv(j) 126 165 ENDDO 127 166 ENDDO 128 167 ! South pole 129 latfi(klon_glo)= rlatu(jjm+1) 130 lonfi(klon_glo)= 0. 131 cufi(klon_glo) = cu((iim+1)*jjm+1) 132 cvfi(klon_glo) = cv((iim+1)*jjm-iim) 168 latfi_glo(klon_glo)= rlatu(jjm+1) 169 lonfi_glo(klon_glo)= 0. 170 cufi_glo(klon_glo) = cu((iim+1)*jjm+1) 171 cvfi_glo(klon_glo) = cv((iim+1)*jjm-iim) 172 boundslonfi_glo(klon_glo,north_east)= 0 173 boundslatfi_glo(klon_glo,north_east)= rlatv(jjm) 174 boundslonfi_glo(klon_glo,north_west)= 2*PI 175 boundslatfi_glo(klon_glo,north_west)= rlatv(jjm) 176 boundslonfi_glo(klon_glo,south_west)= 2*PI 177 boundslatfi_glo(klon_glo,south_west)= -PI/2 178 boundslonfi_glo(klon_glo,south_east)= 0 179 boundslatfi_glo(klon_glo,south_east)= -Pi/2 133 180 134 181 ! build airefi(), mesh area on physics grid 135 CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi )182 CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi_glo) 136 183 ! Poles are single points on physics grid 137 airefi (1)=sum(aire(1:iim,1))138 airefi (klon_glo)=sum(aire(1:iim,jjm+1))184 airefi_glo(1)=sum(aire(1:iim,1)) 185 airefi_glo(klon_glo)=sum(aire(1:iim,jjm+1)) 139 186 140 187 ! Sanity check: do total planet area match between physics and dynamics? 141 188 total_area_dyn=sum(aire(1:iim,1:jjm+1)) 142 total_area_phy=sum(airefi (1:klon_glo))189 total_area_phy=sum(airefi_glo(1:klon_glo)) 143 190 IF (total_area_dyn/=total_area_phy) THEN 144 191 WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!' … … 153 200 ELSE ! klon_glo==1, running the 1D model 154 201 ! just copy over input values 155 latfi(1)=rlatu(1) 156 lonfi(1)=rlonv(1) 157 cufi(1)=cu(1) 158 cvfi(1)=cv(1) 159 airefi(1)=aire(1,1) 202 latfi_glo(1)=rlatu(1) 203 lonfi_glo(1)=rlonv(1) 204 cufi_glo(1)=cu(1) 205 cvfi_glo(1)=cv(1) 206 airefi_glo(1)=aire(1,1) 207 boundslonfi_glo(1,north_east)=rlonu(1) 208 boundslatfi_glo(1,north_east)=PI/2 209 boundslonfi_glo(1,north_west)=rlonu(2) 210 boundslatfi_glo(1,north_west)=PI/2 211 boundslonfi_glo(1,south_west)=rlonu(2) 212 boundslatfi_glo(1,south_west)=rlatv(1) 213 boundslonfi_glo(1,south_east)=rlonu(1) 214 boundslatfi_glo(1,south_east)=rlatv(1) 160 215 ENDIF ! of IF (klon_glo>1) 161 216 162 217 !$OMP PARALLEL 163 ! Now generate local lon/lat/cu/cv/area arrays 164 CALL initcomgeomphy 218 ! Now generate local lon/lat/cu/cv/area/bounds arrays 219 ALLOCATE(latfi(klon_omp),lonfi(klon_omp),cufi(klon_omp),cvfi(klon_omp)) 220 ALLOCATE(airefi(klon_omp)) 221 ALLOCATE(boundslonfi(klon_omp,4)) 222 ALLOCATE(boundslatfi(klon_omp,4)) 223 ! CALL initcomgeomphy 165 224 166 225 offset = klon_mpi_begin - 1 167 airephy(1:klon_omp) = airefi(offset+klon_omp_begin:offset+klon_omp_end) 168 cuphy(1:klon_omp) = cufi(offset+klon_omp_begin:offset+klon_omp_end) 169 cvphy(1:klon_omp) = cvfi(offset+klon_omp_begin:offset+klon_omp_end) 170 rlond(1:klon_omp) = lonfi(offset+klon_omp_begin:offset+klon_omp_end) 171 rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end) 226 airefi(1:klon_omp) = airefi_glo(offset+klon_omp_begin:offset+klon_omp_end) 227 cufi(1:klon_omp) = cufi_glo(offset+klon_omp_begin:offset+klon_omp_end) 228 cvfi(1:klon_omp) = cvfi_glo(offset+klon_omp_begin:offset+klon_omp_end) 229 lonfi(1:klon_omp) = lonfi_glo(offset+klon_omp_begin:offset+klon_omp_end) 230 latfi(1:klon_omp) = latfi_glo(offset+klon_omp_begin:offset+klon_omp_end) 231 boundslonfi(1:klon_omp,:) = boundslonfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:) 232 boundslatfi(1:klon_omp,:) = boundslatfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:) 233 234 ! copy over local grid longitudes and latitudes 235 CALL init_geometry(klon_omp,lonfi,latfi,boundslonfi,boundslatfi, & 236 airefi,cufi,cvfi) 172 237 173 238 ! Initialize some physical constants … … 176 241 ! Initialize some "temporal and calendar" related variables 177 242 CALL init_time(annee_ref,day_ref,day_ini,day_end,ptimestep) 243 244 ! Initialize dimphy module 245 CALL Init_dimphy(klon_omp,nlayer) 178 246 179 247 !$OMP END PARALLEL
Note: See TracChangeset
for help on using the changeset viewer.