- Timestamp:
- 2015-11-29T20:44:49+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NERC/dev_r5589_is_oce_cpl/NEMOGCM/NEMO/OPA_SRC/DOM/iscplhsb.F90
r5920 r5945 70 70 REAL(wp), DIMENSION(:), ALLOCATABLE :: zlon, zlat 71 71 REAL(wp), DIMENSION(:), ALLOCATABLE :: zcorr_vol, zcorr_tem, zcorr_sal 72 INTEGER , DIMENSION(:), ALLOCATABLE :: ixpts, iypts, izpts, vnpts72 INTEGER , DIMENSION(:), ALLOCATABLE :: ixpts, iypts, izpts, inpts 73 73 INTEGER :: jpts, npts 74 74 … … 131 131 & + e12t(jim1,jj ) * tmask(jim1,jj ,jk) + e12t(jip1,jj ) * tmask(jip1,jj ,jk) 132 132 133 IF ( zsum .NE.0._wp ) THEN133 IF ( zsum /= 0._wp ) THEN 134 134 zjip1_ratio = e12t(jip1,jj ) * tmask(jip1,jj ,jk) / zsum 135 135 zjim1_ratio = e12t(jim1,jj ) * tmask(jim1,jj ,jk) / zsum … … 155 155 pts_flx (ji,jj,jk,jp_tem) = 0._wp 156 156 157 ELSE IF (zsum .EQ.0._wp ) THEN157 ELSE IF (zsum == 0._wp ) THEN 158 158 ! case where we close a cell and no adjacent cell open 159 159 ! check if the cell beneath is wet 160 IF ( tmask(ji,jj,jk+1) .EQ.1._wp ) THEN160 IF ( tmask(ji,jj,jk+1) == 1._wp ) THEN 161 161 pvol_flx(ji,jj,jk+1) = pvol_flx(ji,jj,jk+1) + pvol_flx(ji,jj,jk) 162 162 pts_flx (ji,jj,jk+1,jp_sal)= pts_flx (ji,jj,jk+1,jp_sal) + pts_flx (ji,jj,jk,jp_sal) … … 169 169 ELSE 170 170 ! case no adjacent cell on the horizontal and on the vertical 171 IF ( lwp ) THEN ! JMM : cAution this warning may occur on any mpp subdomain but numout is only 172 ! open for narea== 1 (lwp=T) 171 173 WRITE(numout,*) 'W A R N I N G iscpl: no adjacent cell on the vertical and horizontal' 172 174 WRITE(numout,*) ' ',mig(ji),' ',mjg(jj),' ',jk 173 175 WRITE(numout,*) ' ',ji,' ',jj,' ',jk,' ',narea 174 176 WRITE(numout,*) ' we are now looking for the closest wet cell on the horizontal ' 177 ENDIF 175 178 ! We deal with these points later. 176 179 END IF … … 188 191 ! if no neighbour wet cell in case of 2close a cell", need to find the nearest wet point 189 192 ! allocation and initialisation of the list of problematic point 190 ALLOCATE( vnpts(jpnij))191 vnpts(:)=0193 ALLOCATE(inpts(jpnij)) 194 inpts(:)=0 192 195 193 196 ! fill narea location with the number of problematic point … … 197 200 IF ( ptmask_b(ji,jj,jk) == 1._wp .AND. tmask(ji,jj,jk+1) == 0._wp .AND. tmask_h(ji,jj) == 1._wp & 198 201 .AND. SUM(tmask(ji-1:ji+1,jj,jk)) + SUM(tmask(ji,jj-1:jj+1,jk)) == 0._wp) THEN 199 vnpts(narea) = vnpts(narea) + 1202 inpts(narea) = inpts(narea) + 1 200 203 END IF 201 204 END DO … … 204 207 205 208 ! build array of total problematic point on each cpu (share to each cpu) 206 CALL mpp_max( vnpts,jpnij)209 CALL mpp_max(inpts,jpnij) 207 210 208 211 ! size of the new variable 209 npts = SUM( vnpts)212 npts = SUM(inpts) 210 213 211 214 ! allocation of the coordinates, correction, index vector for the problematic points 212 215 ALLOCATE(ixpts(npts), iypts(npts), izpts(npts), zcorr_vol(npts), zcorr_sal(npts), zcorr_tem(npts), zlon(npts), zlat(npts)) 213 ixpts(:) = -9999 ; iypts(:) = -9999 ; izpts(:) = -9999 ; zlon(:) = -1.0e20 ; zlat(:) = -1.0e20214 zcorr_vol(:) = -1.0e20 215 zcorr_sal(:) = -1.0e20 216 zcorr_tem(:) = -1.0e20 216 ixpts(:) = -9999 ; iypts(:) = -9999 ; izpts(:) = -9999 ; zlon(:) = -1.0e20_wp ; zlat(:) = -1.0e20_wp 217 zcorr_vol(:) = -1.0e20_wp 218 zcorr_sal(:) = -1.0e20_wp 219 zcorr_tem(:) = -1.0e20_wp 217 220 218 221 ! fill new variable 219 jpts = SUM( vnpts(1:narea-1))222 jpts = SUM(inpts(1:narea-1)) 220 223 DO jk = 1,jpk-1 221 224 DO jj = 2,jpj-1 … … 223 226 IF ( ptmask_b(ji,jj,jk) == 1._wp .AND. tmask(ji,jj,jk+1) == 0._wp .AND. tmask_h(ji,jj) == 1._wp & 224 227 .AND. SUM(tmask(ji-1:ji+1,jj,jk)) + SUM(tmask(ji,jj-1:jj+1,jk)) == 0._wp) THEN 225 jpts = jpts + 1 ! positioning in the vnpts vector for the area narea228 jpts = jpts + 1 ! positioning in the inpts vector for the area narea 226 229 ixpts(jpts) = ji ; iypts(jpts) = jj ; izpts(jpts) = jk 227 230 zlon (jpts) = glamt(ji,jj) ; zlat (jpts) = gphit(ji,jj) … … 273 276 274 277 ! deallocate variables 275 DEALLOCATE( vnpts)278 DEALLOCATE(inpts) 276 279 DEALLOCATE(ixpts, iypts, izpts, zcorr_vol, zcorr_sal, zcorr_tem, zlon, zlat) 277 280
Note: See TracChangeset
for help on using the changeset viewer.