Changeset 811
- Timestamp:
- 2008-02-07T17:00:12+01:00 (17 years ago)
- Location:
- branches/dev_001_SBC/NEMO
- Files:
-
- 9 deleted
- 51 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/dev_001_SBC/NEMO/LIM_SRC/limrst.F90
r717 r811 54 54 !!---------------------------------------------------------------------- 55 55 ! 56 IF( kt == nit000 ) lrst_ice = .FALSE. 57 58 IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nitend - nit000 + 1 <= nn_fsbc ) THEN59 ! beware if model runs less than nn_fsbc + 1 time step60 ! beware of the format used to write kt (default is i8.8, that should be large enough)61 IF( nitrst > 1.0e9 ) THEN62 WRITE(clkt,*) nitrst63 ELSE64 WRITE(clkt,'(i8.8)') nitrst56 IF( kt == nit000 ) lrst_ice = .FALSE. ! default definition 57 58 ! to get better performances with NetCDF format: 59 ! we open and define the ice restart file one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1) 60 ! except if we write ice restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1 61 IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN 62 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 63 IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst 64 ELSE ; WRITE(clkt, '(i8.8)') nitrst 65 65 ENDIF 66 66 ! create the file 67 IF(lwp) WRITE(numout,*)68 67 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_restart_ice" 69 IF(lwp) WRITE(numout,*) ' open ice restart.output NetCDF file: '//clname 68 IF(lwp) THEN 69 WRITE(numout,*) 70 SELECT CASE ( jprstlib ) 71 CASE ( jprstdimg ) ; WRITE(numout,*) ' open ice restart binary file: '//clname 72 CASE DEFAULT ; WRITE(numout,*) ' open ice restart NetCDF file: '//clname 73 END SELECT 74 IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN 75 WRITE(numout,*) ' kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp 76 ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp 77 ENDIF 78 ENDIF 79 70 80 CALL iom_open( clname, numriw, ldwrt = .TRUE., kiolib = jprstlib ) 71 81 lrst_ice = .TRUE. … … 86 96 !!---------------------------------------------------------------------- 87 97 88 iter = kt + nn_fsbc - 1 98 iter = kt + nn_fsbc - 1 ! ice restarts are written at kt == nitrst - nn_fsbc + 1 89 99 90 100 IF( iter == nitrst ) THEN 91 101 IF(lwp) WRITE(numout,*) 92 IF(lwp) WRITE(numout,*) 'lim_rst_write : write ice restart .output NetCDFfile kt =', kt102 IF(lwp) WRITE(numout,*) 'lim_rst_write : write ice restart file kt =', kt 93 103 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~' 94 104 ENDIF -
branches/dev_001_SBC/NEMO/NST_SRC/agrif_opa_interp.F90
r699 r811 8 8 USE dom_oce 9 9 USE sol_oce 10 USE agrif_oce 10 11 11 12 IMPLICIT NONE … … 16 17 CONTAINS 17 18 18 SUBROUTINE Agrif_tra ( kt )19 SUBROUTINE Agrif_tra 19 20 !!--------------------------------------------- 20 21 !! *** ROUTINE Agrif_Tra *** … … 23 24 # include "vectopt_loop_substitute.h90" 24 25 25 INTEGER, INTENT(in) :: kt26 27 26 INTEGER :: ji,jj,jk 28 27 REAL(wp) :: zrhox … … 178 177 179 178 Agrif_SpecialValue=0. 180 Agrif_UseSpecialValue = .TRUE. 179 Agrif_UseSpecialValue = ln_spc_dyn 180 181 181 zua = 0. 182 182 zva = 0. … … 187 187 188 188 Agrif_SpecialValue=0. 189 Agrif_UseSpecialValue = .TRUE.189 Agrif_UseSpecialValue = ln_spc_dyn 190 190 CALL Agrif_Bc_variable(zua2d,e1u,calledweight=1.,procname=interpu2d) 191 191 CALL Agrif_Bc_variable(zva2d,e2v,calledweight=1.,procname=interpv2d) -
branches/dev_001_SBC/NEMO/NST_SRC/agrif_opa_sponge.F90
r699 r811 10 10 USE dom_oce 11 11 USE in_out_manager 12 USE agrif_oce 12 13 13 14 IMPLICIT NONE … … 16 17 PUBLIC Agrif_Sponge_Tra, Agrif_Sponge_Dyn, interptn, interpsn, interpun, interpvn 17 18 18 !! * Namelist (namagrif)19 REAL(wp) :: visc_tra = rdt20 REAL(wp) :: visc_dyn = rdt21 19 22 20 CONTAINS 23 21 24 SUBROUTINE Agrif_Sponge_Tra ( kt )22 SUBROUTINE Agrif_Sponge_Tra 25 23 !!--------------------------------------------- 26 24 !! *** ROUTINE Agrif_Sponge_Tra *** … … 28 26 #include "domzgr_substitute.h90" 29 27 30 INTEGER, INTENT(in) :: kt31 32 28 INTEGER :: ji,jj,jk 33 REAL(wp), DIMENSION(jpi,jpj,jpk) :: umasktemp,vmasktemp34 29 INTEGER :: spongearea 35 30 REAL(wp) :: timecoeff 36 31 REAL(wp) :: zta, zsa, zabe1, zabe2, zbtr 37 32 REAL(wp), DIMENSION(jpi,jpj) :: localviscsponge 38 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztab,tbdiff, sbdiff33 REAL(wp), DIMENSION(jpi,jpj,jpk) :: tbdiff, sbdiff 39 34 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztu ,ztv, zsu ,zsv 35 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztab 40 36 41 37 #if defined SPONGE 42 43 IF( kt == nit000 ) CALL agrif_sponge_init44 38 45 39 timecoeff = REAL(Agrif_NbStepint(),wp)/Agrif_rhot() … … 61 55 sbdiff(:,:,:) = sb(:,:,:) - ztab(:,:,:) 62 56 57 63 58 spongearea = 2 + 2 * Agrif_irhox() 64 59 65 60 localviscsponge = 0. 66 umasktemp = 0. 67 vmasktemp = 0. 61 62 IF (.NOT. spongedoneT) THEN 63 spe1ur(:,:) = 0. 64 spe2vr(:,:) = 0. 68 65 69 66 IF ((nbondi == -1).OR.(nbondi == 2)) THEN … … 71 68 localviscsponge(ji,:) = visc_tra * (spongearea-ji)/real(spongearea-2) 72 69 ENDDO 73 DO jk = 1, jpkm1 74 umasktemp(2:spongearea-1,:,jk) = umask(2:spongearea-1,:,jk) & 75 * 0.5 * (localviscsponge(2:spongearea-1,:) + localviscsponge(3:spongearea,:)) 76 ENDDO 77 DO jk = 1, jpkm1 78 vmasktemp(2:spongearea,1:jpjm1,jk) = vmask(2:spongearea,1:jpjm1,jk) & 79 * 0.5 * (localviscsponge(2:spongearea,1:jpjm1) + localviscsponge(2:spongearea,2:jpj)) 80 ENDDO 70 71 spe1ur(2:spongearea-1,:)=0.5 * (localviscsponge(2:spongearea-1,:) + localviscsponge(3:spongearea,:)) & 72 * e2u(2:spongearea-1,:) / e1u(2:spongearea-1,:) 73 74 spe2vr(2:spongearea,1:jpjm1) = 0.5 * (localviscsponge(2:spongearea,1:jpjm1) + & 75 localviscsponge(2:spongearea,2:jpj)) & 76 * e1v(2:spongearea,1:jpjm1) / e2v(2:spongearea,1:jpjm1) 81 77 ENDIF 82 78 … … 85 81 localviscsponge(ji,:) = visc_tra * (ji - (nlci-spongearea+1))/real(spongearea-2) 86 82 ENDDO 87 DO jk = 1, jpkm1 88 umasktemp(nlci-spongearea + 1:nlci-2,:,jk) = umask(nlci-spongearea + 1:nlci-2,:,jk)&89 * 0.5 * (localviscsponge(nlci-spongearea + 1:nlci-2,:) + localviscsponge(nlci-spongearea + 2:nlci-1,:)) 90 ENDDO 91 DO jk = 1, jpkm1 92 vmasktemp(nlci-spongearea + 1:nlci-1,1:jpjm1,jk) = vmask(nlci-spongearea + 1:nlci-1,1:jpjm1,jk) &93 * 0.5 * (localviscsponge(nlci-spongearea + 1:nlci-1,1:jpjm1) + localviscsponge(nlci-spongearea + 1:nlci-1,2:jpj)) 94 ENDDO 83 84 spe1ur(nlci-spongearea + 1:nlci-2,:)=0.5 * (localviscsponge(nlci-spongearea + 1:nlci-2,:) + & 85 localviscsponge(nlci-spongearea + 2:nlci-1,:)) & 86 * e2u(nlci-spongearea + 1:nlci-2,:) / e1u(nlci-spongearea + 1:nlci-2,:) 87 88 spe2vr(nlci-spongearea + 1:nlci-1,1:jpjm1) = 0.5 * (localviscsponge(nlci-spongearea + 1:nlci-1,1:jpjm1) & 89 + localviscsponge(nlci-spongearea + 1:nlci-1,2:jpj)) & 90 * e1v(nlci-spongearea + 1:nlci-1,1:jpjm1) / e2v(nlci-spongearea + 1:nlci-1,1:jpjm1) 95 91 ENDIF 96 92 … … 100 96 localviscsponge(:,jj) = visc_tra * (spongearea-jj)/real(spongearea-2) 101 97 ENDDO 102 DO jk = 1, jpkm1 103 vmasktemp(:,2:spongearea-1,jk) = vmask(:,2:spongearea-1,jk)&104 * 0.5 * (localviscsponge(:,2:spongearea-1) + localviscsponge(:,3:spongearea)) 105 ENDDO 106 DO jk = 1, jpkm1 107 umasktemp(1:jpim1,2:spongearea,jk) = umask(1:jpim1,2:spongearea,jk)&108 * 0.5 * (localviscsponge(1:jpim1,2:spongearea) + localviscsponge(2:jpi,2:spongearea)) 109 ENDDO 98 99 spe1ur(1:jpim1,2:spongearea)=0.5 * (localviscsponge(1:jpim1,2:spongearea) + & 100 localviscsponge(2:jpi,2:spongearea)) & 101 * e2u(1:jpim1,2:spongearea) / e1u(1:jpim1,2:spongearea) 102 103 spe2vr(:,2:spongearea-1) = 0.5 * (localviscsponge(:,2:spongearea-1) + & 104 localviscsponge(:,3:spongearea)) & 105 * e1v(:,2:spongearea-1) / e2v(:,2:spongearea-1) 110 106 ENDIF 111 107 … … 114 110 localviscsponge(:,jj) = visc_tra * (jj - (nlcj-spongearea+1))/real(spongearea-2) 115 111 ENDDO 116 DO jk = 1, jpkm1 117 vmasktemp(:,nlcj-spongearea + 1:nlcj-2,jk) = vmask(:,nlcj-spongearea + 1:nlcj-2,jk) & 118 * 0.5 * (localviscsponge(:,nlcj-spongearea + 1:nlcj-2) + localviscsponge(:,nlcj-spongearea + 2:nlcj-1)) 119 ENDDO 120 DO jk = 1, jpkm1 121 umasktemp(1:jpim1,nlcj-spongearea + 1:nlcj-1,jk) = umask(1:jpim1,nlcj-spongearea + 1:nlcj-1,jk) & 122 * 0.5 * (localviscsponge(1:jpim1,nlcj-spongearea + 1:nlcj-1) + localviscsponge(2:jpi,nlcj-spongearea + 1:nlcj-1)) 123 ENDDO 124 ENDIF 125 126 IF (.NOT. spongedoneT) THEN 127 zspe1ur(:,:) = e2u(:,:) / e1u(:,:) 128 zspe2vr(:,:) = e1v(:,:) / e2v(:,:) 129 zspbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:)) 112 113 spe1ur(1:jpim1,nlcj-spongearea + 1:nlcj-1)=0.5 * (localviscsponge(1:jpim1,nlcj-spongearea + 1:nlcj-1) + & 114 localviscsponge(2:jpi,nlcj-spongearea + 1:nlcj-1)) & 115 * e2u(1:jpim1,nlcj-spongearea + 1:nlcj-1) / e1u(1:jpim1,nlcj-spongearea + 1:nlcj-1) 116 117 spe2vr(:,nlcj-spongearea + 1:nlcj-2) = 0.5 * (localviscsponge(:,nlcj-spongearea + 1:nlcj-2) + & 118 localviscsponge(:,nlcj-spongearea + 2:nlcj-1)) & 119 * e1v(:,nlcj-spongearea + 1:nlcj-2) / e2v(:,nlcj-spongearea + 1:nlcj-2) 120 ENDIF 121 122 spbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:)) 130 123 131 124 spongedoneT = .TRUE. … … 136 129 DO ji = 1, jpim1 137 130 #if defined key_zco 138 zabe1 = umask temp(ji,jj,jk) * zspe1ur(ji,jj)139 zabe2 = vmask temp(ji,jj,jk) * zspe2vr(ji,jj)140 #else 141 zabe1 = umask temp(ji,jj,jk) * zspe1ur(ji,jj) * fse3u(ji,jj,jk)142 zabe2 = vmask temp(ji,jj,jk) * zspe2vr(ji,jj) * fse3v(ji,jj,jk)131 zabe1 = umask(ji,jj,jk) * spe1ur(ji,jj) 132 zabe2 = vmask(ji,jj,jk) * spe2vr(ji,jj) 133 #else 134 zabe1 = umask(ji,jj,jk) * spe1ur(ji,jj) * fse3u(ji,jj,jk) 135 zabe2 = vmask(ji,jj,jk) * spe2vr(ji,jj) * fse3v(ji,jj,jk) 143 136 #endif 144 137 ztu(ji,jj,jk) = zabe1 * ( tbdiff(ji+1,jj ,jk) - tbdiff(ji,jj,jk) ) … … 152 145 DO ji = 2,jpim1 153 146 #if defined key_zco 154 zbtr = zspbtr2(ji,jj)155 #else 156 zbtr = zspbtr2(ji,jj) / fse3t(ji,jj,jk)147 zbtr = spbtr2(ji,jj) 148 #else 149 zbtr = spbtr2(ji,jj) / fse3t(ji,jj,jk) 157 150 #endif 158 151 ! horizontal diffusive trends … … 173 166 END SUBROUTINE Agrif_Sponge_Tra 174 167 175 SUBROUTINE Agrif_Sponge_dyn ( kt )168 SUBROUTINE Agrif_Sponge_dyn 176 169 !!--------------------------------------------- 177 170 !! *** ROUTINE Agrif_Sponge_dyn *** 178 171 !!--------------------------------------------- 179 172 #include "domzgr_substitute.h90" 180 181 INTEGER,INTENT(in) :: kt182 173 183 174 INTEGER :: ji,jj,jk 184 175 INTEGER :: spongearea 185 176 REAL(wp) :: timecoeff 186 REAL(wp) :: ze2u, ze1v, zua, zva 177 REAL(wp) :: ze2u, ze1v, zua, zva, zbtr 187 178 REAL(wp), DIMENSION(jpi,jpj) :: localviscsponge 188 179 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztab, ubdiff, vbdiff,rotdiff,hdivdiff 189 REAL(wp), DIMENSION(jpi,jpj,jpk) :: umasktemp,vmasktemp190 180 191 181 #if defined SPONGE … … 194 184 195 185 Agrif_SpecialValue=0. 196 Agrif_UseSpecialValue = .TRUE.186 Agrif_UseSpecialValue = ln_spc_dyn 197 187 ztab = 0.e0 198 188 CALL Agrif_Bc_Variable(ztab, ua,calledweight=timecoeff,procname=interpun) 199 189 Agrif_UseSpecialValue = .FALSE. 200 190 201 ubdiff(:,:,:) = ub(:,:,:) - ztab(:,:,:)191 ubdiff(:,:,:) = (ub(:,:,:) - ztab(:,:,:))*umask(:,:,:) 202 192 203 193 ztab = 0.e0 204 194 Agrif_SpecialValue=0. 205 Agrif_UseSpecialValue = .TRUE.195 Agrif_UseSpecialValue = ln_spc_dyn 206 196 CALL Agrif_Bc_Variable(ztab, va,calledweight=timecoeff,procname=interpvn) 207 197 Agrif_UseSpecialValue = .FALSE. 208 198 209 vbdiff(:,:,:) = vb(:,:,:) - ztab(:,:,:)199 vbdiff(:,:,:) = (vb(:,:,:) - ztab(:,:,:))*vmask(:,:,:) 210 200 211 201 spongearea = 2 + 2 * Agrif_irhox() 212 202 213 203 localviscsponge = 0. 214 umasktemp = 0. 215 vmasktemp = 0. 204 205 IF (.NOT. spongedoneU) THEN 206 spe1ur2(:,:) = 0. 207 spe2vr2(:,:) = 0. 216 208 217 209 IF ((nbondi == -1).OR.(nbondi == 2)) THEN … … 219 211 localviscsponge(ji,:) = visc_dyn * (spongearea-ji)/real(spongearea-2) 220 212 ENDDO 221 DO jk = 1, jpkm1 222 umasktemp(2:spongearea-1,:,jk) = umask(2:spongearea-1,:,jk) & 223 * 0.5 * (localviscsponge(2:spongearea-1,:) + localviscsponge(3:spongearea,:)) 224 ENDDO 225 DO jk = 1, jpkm1 226 vmasktemp(2:spongearea,1:jpjm1,jk) = vmask(2:spongearea,1:jpjm1,jk) & 227 * 0.5 * (localviscsponge(2:spongearea,1:jpjm1) + localviscsponge(2:spongearea,2:jpj)) 228 ENDDO 213 214 spe1ur2(2:spongearea-1,:)=0.5 * (localviscsponge(2:spongearea-1,:) + localviscsponge(3:spongearea,:)) 215 216 spe2vr2(2:spongearea,1:jpjm1) = 0.5 * (localviscsponge(2:spongearea,1:jpjm1) + & 217 localviscsponge(2:spongearea,2:jpj)) 229 218 ENDIF 230 219 … … 233 222 localviscsponge(ji,:) = visc_dyn * (ji - (nlci-spongearea+1))/real(spongearea-2) 234 223 ENDDO 235 DO jk = 1, jpkm1 236 umasktemp(nlci-spongearea + 1:nlci-2,:,jk) = umask(nlci-spongearea + 1:nlci-2,:,jk) & 237 * 0.5 * (localviscsponge(nlci-spongearea + 1:nlci-2,:) + localviscsponge(nlci-spongearea + 2:nlci-1,:)) 238 ENDDO 239 DO jk = 1, jpkm1 240 vmasktemp(nlci-spongearea + 1:nlci-1,1:jpjm1,jk) = vmask(nlci-spongearea + 1:nlci-1,1:jpjm1,jk) & 241 * 0.5 * (localviscsponge(nlci-spongearea + 1:nlci-1,1:jpjm1) + localviscsponge(nlci-spongearea + 1:nlci-1,2:jpj)) 242 ENDDO 243 ENDIF 224 225 spe1ur2(nlci-spongearea + 1:nlci-2,:)=0.5 * (localviscsponge(nlci-spongearea + 1:nlci-2,:) + & 226 localviscsponge(nlci-spongearea + 2:nlci-1,:)) 227 228 spe2vr2(nlci-spongearea + 1:nlci-1,1:jpjm1) = 0.5 * (localviscsponge(nlci-spongearea + 1:nlci-1,1:jpjm1) & 229 + localviscsponge(nlci-spongearea + 1:nlci-1,2:jpj)) 230 ENDIF 231 244 232 245 233 IF ((nbondj == -1).OR.(nbondj == 2)) THEN … … 247 235 localviscsponge(:,jj) = visc_dyn * (spongearea-jj)/real(spongearea-2) 248 236 ENDDO 249 DO jk = 1, jpkm1 250 vmasktemp(:,2:spongearea-1,jk) = vmask(:,2:spongearea-1,jk) & 251 * 0.5 * (localviscsponge(:,2:spongearea-1) + localviscsponge(:,3:spongearea)) 252 ENDDO 253 DO jk = 1, jpkm1 254 umasktemp(1:jpim1,2:spongearea,jk) = umask(1:jpim1,2:spongearea,jk) & 255 * 0.5 * (localviscsponge(1:jpim1,2:spongearea) + localviscsponge(2:jpi,2:spongearea)) 256 ENDDO 237 238 spe1ur2(1:jpim1,2:spongearea)=0.5 * (localviscsponge(1:jpim1,2:spongearea) + & 239 localviscsponge(2:jpi,2:spongearea)) 240 241 spe2vr2(:,2:spongearea-1) = 0.5 * (localviscsponge(:,2:spongearea-1) + & 242 localviscsponge(:,3:spongearea)) 257 243 ENDIF 258 244 … … 261 247 localviscsponge(:,jj) = visc_dyn * (jj - (nlcj-spongearea+1))/real(spongearea-2) 262 248 ENDDO 263 DO jk = 1, jpkm1 264 vmasktemp(:,nlcj-spongearea + 1:nlcj-2,jk) = vmask(:,nlcj-spongearea + 1:nlcj-2,jk) & 265 * 0.5 * (localviscsponge(:,nlcj-spongearea + 1:nlcj-2) + localviscsponge(:,nlcj-spongearea + 2:nlcj-1)) 266 ENDDO 267 DO jk = 1, jpkm1 268 umasktemp(1:jpim1,nlcj-spongearea + 1:nlcj-1,jk) = umask(1:jpim1,nlcj-spongearea + 1:nlcj-1,jk) & 269 * 0.5 * (localviscsponge(1:jpim1,nlcj-spongearea + 1:nlcj-1) + localviscsponge(2:jpi,nlcj-spongearea + 1:nlcj-1)) 270 ENDDO 271 ENDIF 272 273 ubdiff = ubdiff * umasktemp 274 vbdiff = vbdiff * vmasktemp 275 249 250 spe1ur2(1:jpim1,nlcj-spongearea + 1:nlcj-1)=0.5 * (localviscsponge(1:jpim1,nlcj-spongearea + 1:nlcj-1) + & 251 localviscsponge(2:jpi,nlcj-spongearea + 1:nlcj-1)) 252 253 spe2vr2(:,nlcj-spongearea + 1:nlcj-2) = 0.5 * (localviscsponge(:,nlcj-spongearea + 1:nlcj-2) + & 254 localviscsponge(:,nlcj-spongearea + 2:nlcj-1)) 255 ENDIF 256 257 spongedoneU = .TRUE. 258 259 spbtr3(:,:) = 1./( e1f(:,:) * e2f(:,:)) 260 ENDIF 261 262 IF (.NOT. spongedoneT) THEN 263 spbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:)) 264 ENDIF 265 266 DO jk=1,jpkm1 267 ubdiff(:,:,jk) = ubdiff(:,:,jk) * spe1ur2(:,:) 268 vbdiff(:,:,jk) = vbdiff(:,:,jk) * spe2vr2(:,:) 269 ENDDO 270 276 271 hdivdiff = 0. 277 272 rotdiff = 0. … … 286 281 DO ji = 2, jpim1 ! vector opt. 287 282 #if defined key_zco 283 zbtr = spbtr2(ji,jj) 288 284 hdivdiff(ji,jj,jk) = ( e2u(ji,jj) * ubdiff(ji,jj,jk) & 289 285 - e2u(ji-1,jj ) * ubdiff(ji-1,jj ,jk) & 290 286 & + e1v(ji,jj) * vbdiff(ji,jj,jk) - & 291 & e1v(ji ,jj-1) * vbdiff(ji ,jj-1,jk) ) &292 & / ( e1t(ji,jj) * e2t(ji,jj) ) 293 #else 287 & e1v(ji ,jj-1) * vbdiff(ji ,jj-1,jk) ) * zbtr 288 #else 289 zbtr = spbtr2(ji,jj) / fse3t(ji,jj,jk) 294 290 hdivdiff(ji,jj,jk) = & 295 291 ( e2u(ji,jj)*fse3u(ji,jj,jk) * & … … 298 294 + e1v(ji,jj)*fse3v(ji,jj,jk) * & 299 295 vbdiff(ji,jj,jk) - e1v(ji ,jj-1)* & 300 fse3v(ji ,jj-1,jk) * vbdiff(ji ,jj-1,jk) ) & 301 / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 296 fse3v(ji ,jj-1,jk) * vbdiff(ji ,jj-1,jk) ) * zbtr 302 297 #endif 303 298 END DO … … 306 301 DO jj = 1, jpjm1 307 302 DO ji = 1, jpim1 ! vector opt. 303 #if defined key_zco 304 zbtr = spbtr3(ji,jj) 308 305 rotdiff(ji,jj,jk) = ( e2v(ji+1,jj ) * vbdiff(ji+1,jj ,jk) - e2v(ji,jj) * vbdiff(ji,jj,jk) & 309 306 & - e1u(ji ,jj+1) * ubdiff(ji ,jj+1,jk) + e1u(ji,jj) * ubdiff(ji,jj,jk) ) & 310 & * fmask(ji,jj,jk) / ( e1f(ji,jj) * e2f(ji,jj) ) 307 & * fmask(ji,jj,jk) * zbtr 308 #else 309 zbtr = spbtr3(ji,jj) * fse3f(ji,jj,jk) 310 rotdiff(ji,jj,jk) = ( e2v(ji+1,jj ) * vbdiff(ji+1,jj ,jk) - e2v(ji,jj) * vbdiff(ji,jj,jk) & 311 & - e1u(ji ,jj+1) * ubdiff(ji ,jj+1,jk) + e1u(ji,jj) * ubdiff(ji,jj,jk) ) & 312 & * fmask(ji,jj,jk) * zbtr 313 #endif 311 314 END DO 312 315 END DO … … 333 336 ze1v ) / e2v(ji,jj) 334 337 #else 335 ze2u = rotdiff (ji,jj,jk) *fse3f(ji,jj,jk)338 ze2u = rotdiff (ji,jj,jk) 336 339 ze1v = hdivdiff(ji,jj,jk) 337 340 ! horizontal diffusive trends 338 zua = - ( ze2u - rotdiff (ji,jj-1,jk)* & 339 fse3f(ji,jj-1,jk) ) / ( e2u(ji,jj) * fse3u(ji,jj,jk) ) & 341 zua = - ( ze2u - rotdiff (ji,jj-1,jk)) / ( e2u(ji,jj) * fse3u(ji,jj,jk) ) & 340 342 + ( hdivdiff(ji+1,jj,jk) - ze1v & 341 343 ) / e1u(ji,jj) 342 344 343 zva = + ( ze2u - rotdiff (ji-1,jj,jk)* & 344 fse3f(ji-1,jj,jk) ) / ( e1v(ji,jj) * fse3v(ji,jj,jk) ) & 345 zva = + ( ze2u - rotdiff (ji-1,jj,jk)) / ( e1v(ji,jj) * fse3v(ji,jj,jk) ) & 345 346 + ( hdivdiff(ji,jj+1,jk) - ze1v & 346 347 ) / e2v(ji,jj) … … 360 361 END SUBROUTINE Agrif_Sponge_dyn 361 362 362 SUBROUTINE agrif_sponge_init363 !!---------------------------------------------364 !! *** ROUTINE agrif_sponge_init ***365 !!---------------------------------------------366 NAMELIST/namagrif/ visc_tra, visc_dyn367 REWIND ( numnam )368 READ ( numnam, namagrif )369 370 IF(lwp) THEN371 WRITE(numout,*)372 WRITE(numout,*) 'agrif_sponge_init : agrif sponge parameters'373 WRITE(numout,*) '~~~~~~~~~~~~'374 WRITE(numout,*) ' Namelist namagrif : set sponge parameters'375 WRITE(numout,*) ' sponge coefficient for tracers = ', visc_tra376 WRITE(numout,*) ' sponge coefficient for dynamics = ', visc_dyn377 ENDIF378 379 END SUBROUTINE agrif_sponge_init380 381 363 SUBROUTINE interptn(tabres,i1,i2,j1,j2,k1,k2) 382 364 !!--------------------------------------------- … … 405 387 END SUBROUTINE interpsn 406 388 407 408 389 SUBROUTINE interpun(tabres,i1,i2,j1,j2,k1,k2) 409 390 !!--------------------------------------------- -
branches/dev_001_SBC/NEMO/NST_SRC/agrif_opa_update.F90
r699 r811 9 9 USE oce 10 10 USE dom_oce 11 USE agrif_oce 11 12 12 13 IMPLICIT NONE … … 15 16 PUBLIC Agrif_Update_Tra, Agrif_Update_Dyn 16 17 17 INTEGER, PARAMETER :: nbclineupdate = 318 18 INTEGER :: nbcline 19 19 … … 71 71 nbcline = nbcline + 1 72 72 73 Agrif_UseSpecialValueInUpdate = .TRUE.73 Agrif_UseSpecialValueInUpdate = ln_spc_dyn 74 74 Agrif_SpecialValueFineGrid = 0. 75 75 CALL Agrif_Update_Variable(ztab2d,sshn,procname = updateSSH) -
branches/dev_001_SBC/NEMO/NST_SRC/agrif_top_interp.F90
r699 r811 8 8 USE dom_oce 9 9 USE sol_oce 10 USE agrif_oce 10 11 USE trcstp 11 12 USE sms -
branches/dev_001_SBC/NEMO/NST_SRC/agrif_top_update.F90
r699 r811 10 10 USE oce 11 11 USE dom_oce 12 USE agrif_oce 12 13 USE trcstp 13 14 USE sms … … 18 19 PUBLIC Agrif_Update_Trc 19 20 20 INTEGER, PARAMETER :: nbclineupdate = 321 21 INTEGER :: nbcline 22 22 -
branches/dev_001_SBC/NEMO/NST_SRC/agrif_user.F90
r699 r811 68 68 USE ice_oce 69 69 #endif 70 #if defined key_agrif71 70 USE agrif_opa_update 72 71 USE agrif_opa_interp … … 74 73 USE agrif_top_update 75 74 USE agrif_top_interp 76 #endif77 75 78 76 IMPLICIT NONE … … 92 90 93 91 Call opa_init ! Initializations of each fine grid 92 Call agrif_opa_init 94 93 95 94 ! Specific fine grid Initializations … … 314 313 End SUBROUTINE Agrif_detect 315 314 315 SUBROUTINE agrif_opa_init 316 !!--------------------------------------------- 317 !! *** ROUTINE agrif_init *** 318 !!--------------------------------------------- 319 USE agrif_oce 320 USE in_out_manager 321 322 IMPLICIT NONE 323 324 NAMELIST/namagrif/ nbclineupdate, visc_tra, visc_dyn, ln_spc_dyn 325 326 REWIND ( numnam ) 327 READ ( numnam, namagrif ) 328 IF(lwp) THEN 329 WRITE(numout,*) 330 WRITE(numout,*) 'agrif_opa_init : agrif parameters' 331 WRITE(numout,*) '~~~~~~~~~~~~' 332 WRITE(numout,*) ' Namelist namagrif : set agrif parameters' 333 WRITE(numout,*) ' baroclinic update frequency = ', nbclineupdate 334 WRITE(numout,*) ' sponge coefficient for tracers = ', visc_tra 335 WRITE(numout,*) ' sponge coefficient for dynamics = ', visc_dyn 336 WRITE(numout,*) ' use special values for dynamics = ', ln_spc_dyn 337 WRITE(numout,*) 338 ENDIF 339 340 END SUBROUTINE agrif_opa_init 316 341 #if defined key_mpp_mpi 317 318 342 SUBROUTINE Agrif_InvLoc(indloc,nprocloc,i,indglob) 319 343 !!------------------------------------------ … … 338 362 339 363 END SUBROUTINE Agrif_InvLoc 340 341 #endif 342 364 #endif 343 365 #else 344 366 SUBROUTINE Subcalledbyagrif -
branches/dev_001_SBC/NEMO/OPA_SRC/DOM/dom_oce.F90
r699 r811 216 216 ! ! parameterize exchanges through straits 217 217 218 #if defined key_agrif219 !!----------------------------------------------------------------------220 !! agrif sponge layer221 !!----------------------------------------------------------------------222 LOGICAL, PUBLIC :: spongedoneT = .FALSE. !: ???223 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: &224 zspe1ur, zspe2vr ,zspbtr2 !: ???225 !!----------------------------------------------------------------------226 #endif227 228 218 END MODULE dom_oce -
branches/dev_001_SBC/NEMO/OPA_SRC/DOM/domain.F90
r717 r811 179 179 ndastp = ndate0 ! Assign initial date to current date 180 180 181 ! ... Control of output frequency 182 IF ( nstock == 0 ) THEN 183 IF(lwp)WRITE(numout,cform_war) 184 IF(lwp)WRITE(numout,*) ' nstock = ', nstock, ' it is forced to ', nitend 185 nstock = nitend 186 nwarn = nwarn + 1 181 ! ... Control of output frequency 182 IF ( nstock == 0 .OR. nstock > nitend - nit000 + 1 ) THEN 183 WRITE(ctmp1,*) ' nstock = ', nstock, ' it is forced to ', nitend - nit000 + 1 184 CALL ctl_warn( ctmp1 ) 185 nstock = nitend - nit000 + 1 187 186 ENDIF 188 187 IF ( nwrite == 0 ) THEN 189 IF(lwp)WRITE(numout,cform_war) 190 IF(lwp)WRITE(numout,*) ' nwrite = ', nwrite, ' it is forced to ', nitend 191 nwrite = nitend 192 nwarn = nwarn + 1 188 WRITE(ctmp1,*) ' nwrite = ', nwrite, ' it is forced to ', nitend 189 CALL ctl_warn( ctmp1 ) 190 nwrite = nitend 193 191 ENDIF 194 192 -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/divcur.F90
r699 r811 122 122 123 123 #if defined key_obc 124 #if defined key_agrif 125 IF (Agrif_Root() ) THEN 126 #endif 124 127 ! open boundaries (div must be zero behind the open boundary) 125 128 ! mpp remark: The zeroing of hdivn can probably be extended to 1->jpi/jpj for the correct row/column … … 128 131 IF( lp_obc_north ) hdivn(nin0 :nin1 ,njn0p1:njn1p1,jk) = 0.e0 ! north 129 132 IF( lp_obc_south ) hdivn(nis0 :nis1 ,njs0 :njs1 ,jk) = 0.e0 ! south 133 #if defined key_agrif 134 ENDIF 135 #endif 130 136 #endif 137 #if defined key_agrif 138 if ( .NOT. AGRIF_Root() ) then 139 IF ((nbondi == 1).OR.(nbondi == 2)) hdivn(nlci-1 , : ,jk) = 0.e0 ! east 140 IF ((nbondi == -1).OR.(nbondi == 2)) hdivn(2 , : ,jk) = 0.e0 ! west 141 IF ((nbondj == 1).OR.(nbondj == 2)) hdivn(: ,nlcj-1 ,jk) = 0.e0 ! north 142 IF ((nbondj == -1).OR.(nbondj == 2)) hdivn(: ,2 ,jk) = 0.e0 ! south 143 endif 144 #endif 131 145 132 146 ! ! -------- … … 317 331 318 332 #if defined key_obc 333 #if defined key_agrif 334 IF ( Agrif_Root() ) THEN 335 #endif 319 336 ! open boundaries (div must be zero behind the open boundary) 320 337 ! mpp remark: The zeroing of hdivn can probably be extended to 1->jpi/jpj for the correct row/column … … 323 340 IF( lp_obc_north ) hdivn(nin0 :nin1 ,njn0p1:njn1p1,jk) = 0.e0 ! north 324 341 IF( lp_obc_south ) hdivn(nis0 :nis1 ,njs0 :njs1 ,jk) = 0.e0 ! south 342 #if defined key_agrif 343 ENDIF 344 #endif 325 345 #endif 346 #if defined key_agrif 347 if ( .NOT. AGRIF_Root() ) then 348 IF ((nbondi == 1).OR.(nbondi == 2)) hdivn(nlci-1 , : ,jk) = 0.e0 ! east 349 IF ((nbondi == -1).OR.(nbondi == 2)) hdivn(2 , : ,jk) = 0.e0 ! west 350 IF ((nbondj == 1).OR.(nbondj == 2)) hdivn(: ,nlcj-1 ,jk) = 0.e0 ! north 351 IF ((nbondj == -1).OR.(nbondj == 2)) hdivn(: ,2 ,jk) = 0.e0 ! south 352 endif 353 #endif 354 326 355 ! ! -------- 327 356 ! relative vorticity ! rot -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/dynhpg.F90
r699 r811 18 18 !! dyn_hpg : update the momentum trend with the now horizontal 19 19 !! gradient of the hydrostatic pressure 20 !! default case : k-j-i loops (vector opt. available)21 20 !! hpg_ctl : initialisation and control of options 22 21 !! hpg_zco : z-coordinate scheme … … 30 29 USE oce ! ocean dynamics and tracers 31 30 USE dom_oce ! ocean space and time domain 32 USE dynhpg_jki !33 31 USE phycst ! physical constants 34 32 USE in_out_manager ! I/O manager … … 42 40 43 41 PUBLIC dyn_hpg ! routine called by step module 44 45 #if defined key_mpp_omp46 !!----------------------------------------------------------------------47 !! 'key_mpp_omp' : j-k-i loop (j-slab)48 !!----------------------------------------------------------------------49 LOGICAL, PUBLIC, PARAMETER :: lk_dynhpg_jki = .TRUE. !: OpenMP hpg flag50 LOGICAL, PUBLIC, PARAMETER :: lk_dynhpg = .FALSE. !: vector hpg flag51 #else52 !!----------------------------------------------------------------------53 !! default case : k-j-i loop (vector opt.)54 !!----------------------------------------------------------------------55 LOGICAL, PUBLIC, PARAMETER :: lk_dynhpg_jki = .FALSE. !: OpenMP hpg flag56 LOGICAL, PUBLIC, PARAMETER :: lk_dynhpg = .TRUE. !: vector hpg flag57 #endif58 42 59 43 !!* Namelist nam_dynhpg : Choice of horizontal pressure gradient computation … … 111 95 CASE ( 5 ) ; CALL hpg_djc ( kt ) ! s-coordinate (Density Jacobian with Cubic polynomial) 112 96 CASE ( 6 ) ; CALL hpg_rot ( kt ) ! s-coordinate (ROTated axes scheme) 113 CASE ( 10 ) ; CALL hpg_zco_jki( kt ) ! z-coordinate (k-j-i)114 CASE ( 11 ) ; CALL hpg_zps_jki( kt ) ! z-coordinate plus partial steps (interpolation) (k-j-i)115 CASE ( 12 ) ; CALL hpg_sco_jki( kt ) ! s-coordinate (standard jacobian formulation) (k-j-i)116 97 END SELECT 117 98 … … 186 167 IF ( ioptio /= 1 ) CALL ctl_stop( ' NO or several hydrostatic pressure gradient options used' ) 187 168 188 IF( lk_dynhpg_jki ) THEN189 nhpg = nhpg + 10190 IF(lwp) WRITE(numout,*)191 IF(lwp) WRITE(numout,*) ' Autotasking or OPENMP: use j-k-i loops (i.e. _jki routines)'192 ENDIF193 169 ! 194 170 END SUBROUTINE hpg_ctl -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/dynspg.F90
r699 r811 20 20 USE dynspg_flt ! surface pressure gradient (dyn_spg_flt routine) 21 21 USE dynspg_rl ! surface pressure gradient (dyn_spg_rl routine) 22 USE dynspg_exp_jki ! surface pressure gradient (dyn_spg_exp_jki routine)23 USE dynspg_ts_jki ! surface pressure gradient (dyn_spg_ts_jki routine)24 USE dynspg_flt_jki ! surface pressure gradient (dyn_spg_flt_jki routine)25 22 USE trdmod ! ocean dynamics trends 26 23 USE trdmod_oce ! ocean variables trends … … 68 65 69 66 SELECT CASE ( nspg ) ! compute surf. pressure gradient trend and add it to the general trend 70 ! ! k-j-i loops67 ! 71 68 CASE ( 0 ) ; CALL dyn_spg_exp ( kt ) ! explicit 72 69 CASE ( 1 ) ; CALL dyn_spg_ts ( kt ) ! time-splitting 73 70 CASE ( 2 ) ; CALL dyn_spg_flt ( kt, kindic ) ! filtered 74 71 CASE ( 3 ) ; CALL dyn_spg_rl ( kt, kindic ) ! rigid lid 75 ! ! j-k-i loops 76 CASE ( 10 ) ; CALL dyn_spg_exp_jki( kt ) ! explicit with j-k-i loop 77 CASE ( 11 ) ; CALL dyn_spg_ts_jki ( kt ) ! time-splitting with j-k-i loop 78 CASE ( 12 ) ; CALL dyn_spg_flt_jki( kt, kindic ) ! filtered with j-k-i loop 79 ! 72 ! 80 73 CASE ( -1 ) ! esopa: test all possibility with control print 81 74 ; CALL dyn_spg_exp ( kt ) … … 87 80 ; CALL dyn_spg_flt ( kt, kindic ) 88 81 ; CALL prt_ctl( tab3d_1=ua, clinfo1=' spg2 - Ua: ', mask1=umask, & 89 & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' )90 ; CALL dyn_spg_exp_jki( kt )91 ; CALL prt_ctl( tab3d_1=ua, clinfo1=' spg10- Ua: ', mask1=umask, &92 & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' )93 ; CALL dyn_spg_ts_jki ( kt )94 ; CALL prt_ctl( tab3d_1=ua, clinfo1=' spg12- Ua: ', mask1=umask, &95 & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' )96 ; CALL dyn_spg_flt_jki( kt, kindic )97 ; CALL prt_ctl( tab3d_1=ua, clinfo1=' spg13- Ua: ', mask1=umask, &98 82 & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' ) 99 83 END SELECT … … 159 143 IF( lk_dynspg_flt) nspg = 2 160 144 IF( lk_dynspg_rl ) nspg = 3 161 IF( lk_jki ) nspg = nspg + 10162 145 IF( nspg == 13 ) nspg = 3 163 146 … … 171 154 IF( nspg == 2 ) WRITE(numout,*) ' filtered free surface' 172 155 IF( nspg == 3 ) WRITE(numout,*) ' rigid-lid' 173 IF( nspg == 10 ) WRITE(numout,*) ' explicit free surface with j-k-i loop'174 IF( nspg == 11 ) WRITE(numout,*) ' time splitting free surface with j-k-i loop'175 IF( nspg == 12 ) WRITE(numout,*) ' filtered free surface with j-k-i loop'176 156 ENDIF 177 157 -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/dynspg_exp.F90
r762 r811 33 33 !! * Accessibility 34 34 PUBLIC dyn_spg_exp ! routine called by step.F90 35 PUBLIC exp_rst ! routine called j-k-i subroutine35 PUBLIC exp_rst ! routine called by istate.F90 36 36 37 37 !! * Substitutions -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/dynspg_flt.F90
r762 r811 34 34 USE solsor ! Successive Over-relaxation solver 35 35 USE solfet ! FETI solver 36 USE solsor_e ! Successive Over-relaxation solver with MPP optimization37 36 USE obcdyn ! ocean open boundary condition (obc_dyn routines) 38 37 USE obcvol ! ocean open boundary condition (obc_vol routines) … … 51 50 52 51 PUBLIC dyn_spg_flt ! routine called by step.F90 53 PUBLIC flt_rst ! routine called by j-k-i subroutine52 PUBLIC flt_rst ! routine called by istate.F90 54 53 55 54 !! * Substitutions … … 315 314 END DO 316 315 ! applied the lateral boundary conditions 317 IF( nsolv == 4 )CALL lbc_lnk_e( gcb, c_solver_pt, 1. )316 IF( nsolv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 ) CALL lbc_lnk_e( gcb, c_solver_pt, 1. ) 318 317 319 318 #if defined key_agrif … … 360 359 ELSEIF( nsolv == 3 ) THEN ! FETI solver 361 360 CALL sol_fet( kindic ) 362 ELSEIF( nsolv == 4 ) THEN ! successive-over-relaxation with extra outer halo363 CALL sol_sor_e( kindic )364 361 ELSE ! e r r o r in nsolv namelist parameter 365 362 WRITE(ctmp1,*) ' ~~~~~~~~~~~ not = ', nsolv 366 CALL ctl_stop( ' dyn_spg_flt : e r r o r, nsolv = 1, 2 ,3 or 4', ctmp1 )363 CALL ctl_stop( ' dyn_spg_flt : e r r o r, nsolv = 1, 2 or 3', ctmp1 ) 367 364 ENDIF 368 365 ENDIF -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/dynspg_rl.F90
r762 r811 36 36 USE solsor ! Successive Over-relaxation solver 37 37 USE solfet ! FETI solver 38 USE solsor_e ! Successive Over-relaxation solver with MPP optimization39 38 USE solisl ! ??? 40 39 USE obc_oce ! Lateral open boundary condition … … 177 176 END DO 178 177 ! applied the lateral boundary conditions 179 IF( nsolv == 4)CALL lbc_lnk_e( gcb, c_solver_pt, 1. )178 IF( nsolv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 ) CALL lbc_lnk_e( gcb, c_solver_pt, 1. ) 180 179 181 180 ! Relative precision (computation on one processor) … … 204 203 CASE( 3 ) ! FETI solver 205 204 CALL sol_fet( kindic ) 206 CASE( 4 ) ! successive-over-relaxation with extra outer halo207 CALL sol_sor_e( kindic )208 205 CASE DEFAULT ! e r r o r in nsolv namelist parameter 209 206 WRITE(ctmp1,*) ' ~~~~~~~~~~ not = ', nsolv 210 CALL ctl_stop( ' dyn_spg_rl : e r r o r, nsolv = 1, 2 ,3 or 4', ctmp1 )207 CALL ctl_stop( ' dyn_spg_rl : e r r o r, nsolv = 1, 2 or 3', ctmp1 ) 211 208 END SELECT 212 209 ENDIF -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/dynspg_ts.F90
r762 r811 7 7 !! " " ! 05-11 (V. Garnier, G. Madec) optimization 8 8 !! 9.0 ! 06-08 (S. Masson) distributed restart using iom 9 !! 9.0 ! 08-01 (R. Benshila) change averaging method 9 10 !!--------------------------------------------------------------------- 10 11 #if defined key_dynspg_ts || defined key_esopa … … 40 41 41 42 PUBLIC dyn_spg_ts ! routine called by step.F90 42 PUBLIC ts_rst ! routine called by j-k-i subroutine43 PUBLIC ts_rst ! routine called by istate.F90 43 44 44 45 REAL(wp), DIMENSION(jpi,jpj) :: ftnw, ftne, & ! triad of coriolis parameter … … 92 93 !! * Local declarations 93 94 INTEGER :: ji, jj, jk, jit ! dummy loop indices 94 INTEGER :: icycle 95 INTEGER :: icycle, ibaro ! temporary scalar 95 96 REAL(wp) :: & 96 97 zraur, zcoef, z2dt_e, z2dt_b, zfac25, & ! temporary scalars … … 295 296 !---------------- 296 297 ! Number of iteration of the barotropic loop 297 icycle = FLOOR( z2dt_b / rdtbt ) 298 ibaro = FLOOR( rdt / rdtbt ) 299 icycle = 3 /2 * ibaro 298 300 299 301 ! variables for the barotropic equations … … 304 306 zun_e (:,:) = un_b (:,:) 305 307 zvn_e (:,:) = vn_b (:,:) 306 zssha_b(:,:) = sshn (:,:) ! time averaged variables over all sub-timesteps307 zua_b (:,:) = un_b (:,:)308 zva_b (:,:) = vn_b (:,:)308 zssha_b(:,:) = 0.e0 309 zua_b (:,:) = 0.e0 310 zva_b (:,:) = 0.e0 309 311 IF( lk_vvl ) THEN 310 312 zsshun_e(:,:) = sshu (:,:) ! (barotropic) sea surface height (now) at u-point … … 464 466 ! temporal sum 465 467 !------------- 466 zssha_b(:,:) = zssha_b(:,:) + ssha_e(:,:) 467 zua_b (:,:) = zua_b (:,:) + ua_e (:,:) 468 zva_b (:,:) = zva_b (:,:) + va_e (:,:) 468 IF( jit >= ibaro/2 ) THEN 469 zssha_b(:,:) = zssha_b(:,:) + ssha_e(:,:) 470 zua_b (:,:) = zua_b (:,:) + ua_e (:,:) 471 zva_b (:,:) = zva_b (:,:) + va_e (:,:) 472 ENDIF 469 473 470 474 ! Time filter and swap of dynamics arrays … … 530 534 531 535 ! Time average of after barotropic variables 532 zcoef = 1.e0 / ( FLOAT( icycle +1 ))536 zcoef = 1.e0 / ( ibaro + 1 ) 533 537 zssha_b(:,:) = zcoef * zssha_b(:,:) 534 538 zua_b (:,:) = zcoef * zua_b (:,:) -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/dynvor.F90
r699 r811 226 226 227 227 !CDIR PARALLEL DO PRIVATE( zwx, zwy, zwz ) 228 !$OMP PARALLEL DO PRIVATE( zwx, zwy, zwz )229 228 ! ! =============== 230 229 DO jk = 1, jpkm1 ! Horizontal slab … … 333 332 334 333 !CDIR PARALLEL DO PRIVATE( zwx, zwy, zwz, zww ) 335 !$OMP PARALLEL DO PRIVATE( zwx, zwy, zwz, zww )336 334 ! ! =============== 337 335 DO jk = 1, jpkm1 ! Horizontal slab … … 444 442 445 443 !CDIR PARALLEL DO PRIVATE( zwx, zwy, zwz ) 446 !$OMP PARALLEL DO PRIVATE( zwx, zwy, zwz )447 444 ! ! =============== 448 445 DO jk = 1, jpkm1 ! Horizontal slab … … 567 564 568 565 !CDIR PARALLEL DO PRIVATE( zwx, zwy, zwz, ztnw, ztne, ztsw, ztse ) 569 !$OMP PARALLEL DO PRIVATE( zwx, zwy, zwz, ztnw, ztne, ztsw, ztse )570 566 ! ! =============== 571 567 DO jk = 1, jpkm1 ! Horizontal slab -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/dynzad.F90
r708 r811 38 38 CONTAINS 39 39 40 #if defined key_mpp_omp41 !!----------------------------------------------------------------------42 !! 'key_mpp_omp' OpenMP / NEC autotasking: j-k-i loops (j-slab)43 !!----------------------------------------------------------------------44 45 SUBROUTINE dyn_zad( kt )46 !!----------------------------------------------------------------------47 !! *** ROUTINE dynzad ***48 !!49 !! ** Purpose : Compute the now vertical momentum advection trend and50 !! add it to the general trend of momentum equation.51 !!52 !! ** Method : Use j-slab (j-k-i loops) for OpenMP / NEC autotasking53 !! The now vertical advection of momentum is given by:54 !! w dz(u) = ua + 1/(e1u*e2u*e3u) mk+1[ mi(e1t*e2t*wn) dk(un) ]55 !! w dz(v) = va + 1/(e1v*e2v*e3v) mk+1[ mj(e1t*e2t*wn) dk(vn) ]56 !! Add this trend to the general trend (ua,va):57 !! (ua,va) = (ua,va) + w dz(u,v)58 !!59 !! ** Action : - Update (ua,va) with the vert. momentum advection trends60 !! - Save the trends in (ztrdu,ztrdv) ('key_trddyn')61 !!----------------------------------------------------------------------62 USE oce, ONLY: zwuw => ta ! use ta as 3D workspace63 USE oce, ONLY: zwvw => sa ! use sa as 3D workspace64 !!65 INTEGER, INTENT(in) :: kt ! ocean time-step inedx66 !!67 INTEGER :: ji, jj, jk ! dummy loop indices68 REAL(wp) :: zvn, zua, zva ! temporary scalars69 REAL(wp), DIMENSION(jpi) :: zww ! 1D workspace70 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztrdu, ztrdv ! 3D workspace71 !!----------------------------------------------------------------------72 73 IF( kt == nit000 ) THEN74 IF(lwp) WRITE(numout,*)75 IF(lwp) WRITE(numout,*) 'dyn_zad : arakawa advection scheme'76 IF(lwp) WRITE(numout,*) '~~~~~~~ Auto-tasking case, j-slab, no vector opt.'77 ENDIF78 79 IF( l_trddyn ) THEN ! Save ua and va trends80 ztrdu(:,:,:) = ua(:,:,:)81 ztrdv(:,:,:) = va(:,:,:)82 ENDIF83 84 ! ! ===============85 DO jj = 2, jpjm1 ! Vertical slab86 ! ! ===============87 DO jk = 2, jpkm1 ! Vertical momentum advection at uw and vw-pts88 DO ji = 2, jpi ! vertical fluxes89 zww(ji) = 0.25 * e1t(ji,jj) * e2t(ji,jj) * wn(ji,jj,jk)90 END DO91 DO ji = 2, jpim1 ! vertical momentum advection at w-point92 zvn = 0.25 * e1t(ji,jj+1) * e2t(ji,jj+1) * wn(ji,jj+1,jk)93 zwuw(ji,jj,jk) = ( zww(ji+1) + zww(ji) ) * ( un(ji,jj,jk-1)-un(ji,jj,jk) )94 zwvw(ji,jj,jk) = ( zvn + zww(ji) ) * ( vn(ji,jj,jk-1)-vn(ji,jj,jk) )95 END DO96 END DO97 DO ji = 2, jpim1 ! Surface and bottom values set to zero98 zwuw(ji,jj, 1 ) = 0.e099 zwvw(ji,jj, 1 ) = 0.e0100 zwuw(ji,jj,jpk) = 0.e0101 zwvw(ji,jj,jpk) = 0.e0102 END DO103 !104 DO jk = 1, jpkm1 ! Vertical momentum advection at u- and v-points105 DO ji = 2, jpim1106 ! ! vertical momentum advective trends107 zua = - ( zwuw(ji,jj,jk) + zwuw(ji,jj,jk+1) ) / ( e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk) )108 zva = - ( zwvw(ji,jj,jk) + zwvw(ji,jj,jk+1) ) / ( e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk) )109 ! ! add the trends to the general momentum trends110 ua(ji,jj,jk) = ua(ji,jj,jk) + zua111 va(ji,jj,jk) = va(ji,jj,jk) + zva112 END DO113 END DO114 ! ! ===============115 END DO ! End of slab116 ! ! ===============117 !118 IF( l_trddyn ) THEN ! save the vertical advection trends for diagnostic119 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)120 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)121 CALL trd_mod( ztrdu, ztrdv, jpdyn_trd_zad, 'DYN', kt )122 ENDIF123 ! ! Control print124 IF(ln_ctl) CALL prt_ctl( tab3d_1=ua, clinfo1=' zad - Ua: ', mask1=umask, &125 & tab3d_2=va, clinfo2=' Va: ', mask2=vmask, clinfo3='dyn' )126 !127 END SUBROUTINE dyn_zad128 129 #else130 !!----------------------------------------------------------------------131 !! Default option k-j-i loop (vector opt.)132 !!----------------------------------------------------------------------133 134 40 SUBROUTINE dyn_zad ( kt ) 135 41 !!---------------------------------------------------------------------- … … 162 68 IF(lwp)WRITE(numout,*) 163 69 IF(lwp)WRITE(numout,*) 'dyn_zad : arakawa advection scheme' 164 IF(lwp)WRITE(numout,*) '~~~~~~~ vector optimization k-j-i loop'165 70 ENDIF 166 71 … … 215 120 ! 216 121 END SUBROUTINE dyn_zad 217 #endif218 122 219 123 !!====================================================================== -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/dynzdf.F90
r699 r811 17 17 USE dynzdf_exp ! vertical diffusion: explicit (dyn_zdf_exp routine) 18 18 USE dynzdf_imp ! vertical diffusion: implicit (dyn_zdf_imp routine) 19 USE dynzdf_imp_jki ! vertical diffusion implicit (dyn_zdf_imp_jki routine)20 19 21 20 USE ldfdyn_oce ! ocean dynamics: lateral physics … … 74 73 ! 75 74 CASE ( 0 ) ; CALL dyn_zdf_exp ( kt, r2dt ) ! explicit scheme 76 CASE ( 1 ) ; CALL dyn_zdf_imp ( kt, r2dt ) ! implicit scheme (k-j-i loop) 77 CASE ( 2 ) ; CALL dyn_zdf_imp_jki( kt, r2dt ) ! implicit scheme (j-k-i loop) 75 CASE ( 1 ) ; CALL dyn_zdf_imp ( kt, r2dt ) ! implicit scheme 78 76 ! 79 77 CASE ( -1 ) ! esopa: test all possibility with control print … … 83 81 CALL dyn_zdf_imp ( kt, r2dt ) 84 82 CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf1 - Ua: ', mask1=umask, & 85 & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' )86 CALL dyn_zdf_imp_jki( kt, r2dt )87 CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf2 - Ua: ', mask1=umask, &88 83 & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' ) 89 84 END SELECT … … 109 104 !! ** Method : implicit (euler backward) scheme (default) 110 105 !! explicit (time-splitting) scheme if ln_zdfexp=T 111 !! OpenMP / NEC autotasking: use j-k-i loops112 106 !!---------------------------------------------------------------------- 113 107 USE zdftke … … 125 119 IF( ln_dynldf_hor .AND. ln_sco ) nzdf = 1 ! horizontal lateral physics in s-coordinate 126 120 127 ! OpenMP / NEC autotasking128 #if defined key_mpp_omp129 IF( nzdf == 1 ) nzdf = 2 ! j-k-i loop130 #endif131 132 121 IF( lk_esopa ) nzdf = -1 ! Esopa key: All schemes used 133 122 … … 139 128 IF( nzdf == 0 ) WRITE(numout,*) ' Explicit time-splitting scheme' 140 129 IF( nzdf == 1 ) WRITE(numout,*) ' Implicit (euler backward) scheme' 141 IF( nzdf == 2 ) WRITE(numout,*) ' Implicit (euler backward) scheme with j-k-i loops'142 130 ENDIF 143 131 ! -
branches/dev_001_SBC/NEMO/OPA_SRC/DYN/wzvmod.F90
r708 r811 35 35 36 36 CONTAINS 37 38 #if defined key_mpp_omp39 !!----------------------------------------------------------------------40 !! 'key_mpp_omp' j-k-i loop (j-slab)41 !!----------------------------------------------------------------------42 43 SUBROUTINE wzv( kt )44 !!----------------------------------------------------------------------45 !! *** ROUTINE wzv ***46 !!47 !! ** Purpose : Compute the now vertical velocity after the array swap48 !!49 !! ** Method : Using the incompressibility hypothesis, the vertical50 !! velocity is computed by integrating the horizontal divergence51 !! from the bottom to the surface.52 !! The boundary conditions are w=0 at the bottom (no flux) and,53 !! in rigid-lid case, w=0 at the sea surface.54 !!55 !! ** action : wn array : the now vertical velocity56 !!----------------------------------------------------------------------57 !! * Arguments58 INTEGER, INTENT( in ) :: kt ! ocean time-step index59 60 !! * Local declarations61 INTEGER :: jj, jk ! dummy loop indices62 !!----------------------------------------------------------------------63 64 IF( kt == nit000 ) THEN65 IF(lwp) WRITE(numout,*)66 IF(lwp) WRITE(numout,*) 'wzv : vertical velocity from continuity eq.'67 IF(lwp) WRITE(numout,*) '~~~~~~~ j-k-i loops'68 69 ! bottom boundary condition: w=0 (set once for all)70 wn(:,:,jpk) = 0.e071 ENDIF72 73 ! ! ===============74 DO jj = 1, jpj ! Vertical slab75 ! ! ===============76 ! Computation from the bottom77 DO jk = jpkm1, 1, -178 wn(:,jj,jk) = wn(:,jj,jk+1) - fse3t(:,jj,jk) * hdivn(:,jj,jk)79 END DO80 ! ! ===============81 END DO ! End of slab82 ! ! ===============83 84 IF(ln_ctl) CALL prt_ctl(tab3d_1=wn, clinfo1=' w**2 - : ', mask1=wn)85 86 END SUBROUTINE wzv87 88 #else89 !!----------------------------------------------------------------------90 !! Default option k-j-i loop91 !!----------------------------------------------------------------------92 37 93 38 SUBROUTINE wzv( kt ) … … 188 133 189 134 END SUBROUTINE wzv 190 #endif191 135 192 136 !!====================================================================== -
branches/dev_001_SBC/NEMO/OPA_SRC/LDF/ldfeiv.F90
r717 r811 10 10 !!---------------------------------------------------------------------- 11 11 !! ldf_eiv : compute the eddy induced velocity coefficients 12 !! Same results but not same routine if 'key_mpp_omp'13 !! is defined or not14 12 !!---------------------------------------------------------------------- 15 13 !! * Modules used … … 41 39 42 40 CONTAINS 43 44 # if defined key_mpp_omp45 !!----------------------------------------------------------------------46 !! 'key_mpp_omp' : OpenMP / NEC autotasking (j-slab)47 !!----------------------------------------------------------------------48 49 SUBROUTINE ldf_eiv( kt )50 !!----------------------------------------------------------------------51 !! *** ROUTINE ldf_eiv ***52 !!53 !! ** Purpose : Compute the eddy induced velocity coefficient from the54 !! growth rate of baroclinic instability.55 !!56 !! ** Method :57 !!58 !! ** Action : uslp(), : i- and j-slopes of neutral surfaces59 !! vslp() at u- and v-points, resp.60 !! wslpi(), : i- and j-slopes of neutral surfaces61 !! wslpj() at w-points.62 !!63 !! History :64 !! 8.1 ! 99-03 (G. Madec, A. Jouzeau) Original code65 !! 8.5 ! 02-06 (G. Madec) Free form, F9066 !!----------------------------------------------------------------------67 !! * Arguments68 INTEGER, INTENT( in ) :: kt ! ocean time-step inedx69 70 !! * Local declarations71 INTEGER :: ji, jj, jk ! dummy loop indices72 REAL(wp) :: &73 zfw, ze3w, zn2, zf20, & ! temporary scalars74 zaht, zaht_min75 REAL(wp), DIMENSION(jpi,jpj) :: &76 zn, zah, zhw, zross ! workspace77 !!----------------------------------------------------------------------78 79 IF( kt == nit000 ) THEN80 IF(lwp) WRITE(numout,*)81 IF(lwp) WRITE(numout,*) 'ldf_eiv : eddy induced velocity coefficients'82 IF(lwp) WRITE(numout,*) '~~~~~~~ NEC autotasking / OpenMP : j-slab'83 ENDIF84 85 ! ! ===============86 DO jj = 2, jpjm1 ! Vertical slab87 ! ! ===============88 89 ! 0. Local initialization90 ! -----------------------91 zn (:,jj) = 0.e092 zhw (:,jj) = 5.e093 zah (:,jj) = 0.e094 zross(:,jj) = 0.e095 96 ! 1. Compute lateral diffusive coefficient97 ! ----------------------------------------98 99 !CDIR NOVERRCHK100 DO jk = 1, jpk101 !CDIR NOVERRCHK102 DO ji = 2, jpim1103 ! Take the max of N^2 and zero then take the vertical sum104 ! of the square root of the resulting N^2 ( required to compute105 ! internal Rossby radius Ro = .5 * sum_jpk(N) / f106 zn2 = MAX( rn2(ji,jj,jk), 0.e0 )107 ze3w = fse3w(ji,jj,jk) * tmask(ji,jj,jk)108 zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * fse3w(ji,jj,jk)109 ! Compute elements required for the inverse time scale of baroclinic110 ! eddies using the isopycnal slopes calculated in ldfslp.F :111 ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w))112 zah(ji,jj) = zah(ji,jj) + zn2 &113 * ( wslpi(ji,jj,jk) * wslpi(ji,jj,jk) &114 + wslpj(ji,jj,jk) * wslpj(ji,jj,jk) ) &115 * ze3w116 zhw(ji,jj) = zhw(ji,jj) + ze3w117 END DO118 END DO119 120 !CDIR NOVERRCHK121 DO ji = 2, jpim1122 zfw = MAX( ABS( 2. * omega * SIN( rad * gphit(ji,jj) ) ) , 1.e-10 )123 ! Rossby radius at w-point taken < 40km and > 2km124 zross(ji,jj) = MAX( MIN( .4 * zn(ji,jj) / zfw, 40.e3 ), 2.e3 )125 ! Compute aeiw by multiplying Ro^2 and T^-1126 aeiw(ji,jj) = zross(ji,jj) * zross(ji,jj) * SQRT( zah(ji,jj) / zhw(ji,jj) ) * tmask(ji,jj,1)127 IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN ! ORCA R02128 ! Take the minimum between aeiw and aeiv0 for depth levels129 ! lower than 20 (21 in w- point)130 IF( mbathy(ji,jj) <= 21. ) aeiw(ji,jj) = MIN( aeiw(ji,jj), 1000. )131 ENDIF132 END DO133 134 ! Decrease the coefficient in the tropics (20N-20S)135 zf20 = 2. * omega * sin( rad * 20. )136 DO ji = 2, jpim1137 aeiw(ji,jj) = MIN( 1., ABS( ff(ji,jj) / zf20 ) ) * aeiw(ji,jj)138 END DO139 140 ! ORCA R05: Take the minimum between aeiw and aeiv0141 IF( cp_cfg == "orca" .AND. jp_cfg == 05 ) THEN ! ORCA R05142 DO ji = 2, jpim1143 aeiw(ji,jj) = MIN( aeiw(ji,jj), aeiv0 )144 END DO145 ENDIF146 ! ! ===============147 END DO ! End of slab148 ! ! ===============149 150 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,synchro,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,151 152 ! lateral boundary condition on aeiw153 CALL lbc_lnk( aeiw, 'W', 1. )154 155 ! Average the diffusive coefficient at u- v- points156 DO jj = 2, jpjm1157 DO ji = fs_2, fs_jpim1 ! vector opt.158 aeiu(ji,jj) = .5 * (aeiw(ji,jj) + aeiw(ji+1,jj ))159 aeiv(ji,jj) = .5 * (aeiw(ji,jj) + aeiw(ji ,jj+1))160 END DO161 END DO162 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,synchro,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,163 164 ! lateral boundary condition on aeiu, aeiv165 CALL lbc_lnk( aeiu, 'U', 1. )166 CALL lbc_lnk( aeiv, 'V', 1. )167 168 IF(ln_ctl) THEN169 CALL prt_ctl(tab2d_1=aeiu, clinfo1=' eiv - u: ', ovlap=1)170 CALL prt_ctl(tab2d_1=aeiv, clinfo1=' eiv - v: ', ovlap=1)171 ENDIF172 173 ! ORCA R05: add a space variation on aht (=aeiv except at the equator and river mouth)174 IF( cp_cfg == "orca" .AND. jp_cfg == 05 ) THEN175 zf20 = 2. * omega * SIN( rad * 20. )176 zaht_min = 100. ! minimum value for aht177 DO jj = 1, jpj178 DO ji = 1, jpi179 zaht = ( 1. - MIN( 1., ABS( ff(ji,jj) / zf20 ) ) ) * ( aht0 - zaht_min ) &180 & + aht0 * rnfmsk(ji,jj) ! enhanced near river mouths181 ahtu(ji,jj) = MAX( MAX( zaht_min, aeiu(ji,jj) ) + zaht, aht0 )182 ahtv(ji,jj) = MAX( MAX( zaht_min, aeiv(ji,jj) ) + zaht, aht0 )183 ahtw(ji,jj) = MAX( MAX( zaht_min, aeiw(ji,jj) ) + zaht, aht0 )184 END DO185 END DO186 IF(ln_ctl) THEN187 CALL prt_ctl(tab2d_1=ahtu, clinfo1=' aht - u: ', ovlap=1)188 CALL prt_ctl(tab2d_1=ahtv, clinfo1=' aht - v: ', ovlap=1)189 CALL prt_ctl(tab2d_1=ahtw, clinfo1=' aht - w: ', ovlap=1)190 ENDIF191 ENDIF192 193 IF( aeiv0 == 0.e0 ) THEN194 aeiu(:,:) = 0.e0195 aeiv(:,:) = 0.e0196 aeiw(:,:) = 0.e0197 ENDIF198 199 END SUBROUTINE ldf_eiv200 201 # else202 !!----------------------------------------------------------------------203 !! Default key k-j-i loops204 !!----------------------------------------------------------------------205 41 206 42 SUBROUTINE ldf_eiv( kt ) … … 252 88 253 89 DO jk = 1, jpk 254 # if defined key_vectopt_loop && ! defined key_mpp_omp90 # if defined key_vectopt_loop 255 91 !CDIR NOVERRCHK 256 92 DO ji = 1, jpij ! vector opt. … … 374 210 END SUBROUTINE ldf_eiv 375 211 376 # endif377 378 212 #else 379 213 !!---------------------------------------------------------------------- -
branches/dev_001_SBC/NEMO/OPA_SRC/LDF/ldfslp.F90
r699 r811 141 141 142 142 IF( ln_zps ) THEN ! partial steps correction at the bottom ocean level (zps_hde routine) 143 # if defined key_vectopt_loop && ! defined key_mpp_omp143 # if defined key_vectopt_loop 144 144 jj = 1 145 145 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 153 153 zgru(ji,jj,iku) = gru(ji,jj) 154 154 zgrv(ji,jj,ikv) = grv(ji,jj) 155 # if ! defined key_vectopt_loop || defined key_mpp_omp155 # if ! defined key_vectopt_loop 156 156 END DO 157 157 # endif … … 492 492 ! mask for mixed layer 493 493 DO jk = 1, jpk 494 # if defined key_vectopt_loop && ! defined key_mpp_omp494 # if defined key_vectopt_loop 495 495 jj = 1 496 496 DO ji = 1, jpij ! vector opt. (forced unrolling) … … 506 506 omlmask(ji,jj,jk) = 0.e0 507 507 ENDIF 508 # if ! defined key_vectopt_loop || defined key_mpp_omp508 # if ! defined key_vectopt_loop 509 509 END DO 510 510 # endif … … 524 524 zwy(:,jpj) = 0.e0 525 525 zwy(jpi,:) = 0.e0 526 # if defined key_vectopt_loop && ! defined key_mpp_omp526 # if defined key_vectopt_loop 527 527 jj = 1 528 528 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 537 537 & * ( pn2(ji,jj,ik) + pn2(ji,jj,ik+1) ) & 538 538 & / MAX( tmask(ji,jj,ik) + tmask (ji,jj,ik+1), 1. ) 539 # if ! defined key_vectopt_loop || defined key_mpp_omp539 # if ! defined key_vectopt_loop 540 540 END DO 541 541 # endif … … 545 545 546 546 ! Slope at u points 547 # if defined key_vectopt_loop && ! defined key_mpp_omp547 # if defined key_vectopt_loop 548 548 jj = 1 549 549 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) … … 562 562 ! uslpml 563 563 uslpml (ji,jj) = zau / ( zbu - zeps ) * umask (ji,jj,ik) 564 # if ! defined key_vectopt_loop || defined key_mpp_omp564 # if ! defined key_vectopt_loop 565 565 END DO 566 566 # endif … … 574 574 zwy ( :, jpj) = 0.e0 575 575 zwy ( jpi, :) = 0.e0 576 # if defined key_vectopt_loop && ! defined key_mpp_omp576 # if defined key_vectopt_loop 577 577 jj = 1 578 578 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 586 586 & * ( pn2(ji,jj,ik) + pn2(ji,jj,ik+1) ) & 587 587 & / MAX( tmask(ji,jj,ik) + tmask (ji,jj,ik+1), 1. ) 588 # if ! defined key_vectopt_loop || defined key_mpp_omp588 # if ! defined key_vectopt_loop 589 589 END DO 590 590 # endif … … 595 595 596 596 ! Slope at v points 597 # if defined key_vectopt_loop && ! defined key_mpp_omp597 # if defined key_vectopt_loop 598 598 jj = 1 599 599 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) … … 612 612 ! vslpml 613 613 vslpml (ji,jj) = zav / ( zbv - zeps ) * vmask (ji,jj,ik) 614 # if ! defined key_vectopt_loop || defined key_mpp_omp614 # if ! defined key_vectopt_loop 615 615 END DO 616 616 # endif … … 626 626 ! Local vertical density gradient evaluated from N^2 627 627 ! zwy = d/dz(prd)= - mk ( prd ) / grav * pn2 -- at w point 628 # if defined key_vectopt_loop && ! defined key_mpp_omp628 # if defined key_vectopt_loop 629 629 jj = 1 630 630 DO ji = 1, jpij ! vector opt. (forced unrolling) … … 638 638 zwy (ji,jj) = zm05g * pn2 (ji,jj,ik) * & 639 639 & ( prd (ji,jj,ik) + prd (ji,jj,ikm1) + 2. ) 640 # if ! defined key_vectopt_loop || defined key_mpp_omp640 # if ! defined key_vectopt_loop 641 641 END DO 642 642 # endif … … 644 644 645 645 ! Slope at w point 646 # if defined key_vectopt_loop && ! defined key_mpp_omp646 # if defined key_vectopt_loop 647 647 jj = 1 648 648 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) … … 674 674 wslpiml (ji,jj) = zai / ( zbi - zeps) * tmask (ji,jj,ik) 675 675 wslpjml (ji,jj) = zaj / ( zbj - zeps) * tmask (ji,jj,ik) 676 # if ! defined key_vectopt_loop || defined key_mpp_omp676 # if ! defined key_vectopt_loop 677 677 END DO 678 678 # endif -
branches/dev_001_SBC/NEMO/OPA_SRC/SOL/sol_oce.F90
r699 r811 24 24 !! ---------------------------------- 25 25 INTEGER , PUBLIC :: & !!: namsol elliptic solver / island / free surface 26 nsolv = 1 , & !: = 1/2/3 /4type of elliptic solver26 nsolv = 1 , & !: = 1/2/3 type of elliptic solver 27 27 nsol_arp = 0 , & !: = 0/1 absolute/relative precision convergence test 28 28 nmin = 300 , & !: minimum of iterations for the SOR solver -
branches/dev_001_SBC/NEMO/OPA_SRC/SOL/solmat.F90
r699 r811 291 291 gcp(:,:,3) = gcp(:,:,3) * gcdprc(:,:) 292 292 gcp(:,:,4) = gcp(:,:,4) * gcdprc(:,:) 293 IF( ( nsolv == 2 ) .OR. ( nsolv == 4 )) gccd(:,:) = sor * gcp(:,:,2)294 295 IF( nsolv == 4) THEN293 IF( nsolv == 2 ) gccd(:,:) = sor * gcp(:,:,2) 294 295 IF( nsolv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0) THEN 296 296 CALL lbc_lnk_e( gcp (:,:,1), c_solver_pt, 1. ) ! lateral boundary conditions 297 297 CALL lbc_lnk_e( gcp (:,:,2), c_solver_pt, 1. ) ! lateral boundary conditions -
branches/dev_001_SBC/NEMO/OPA_SRC/SOL/solpcg.F90
r699 r811 52 52 !! where q is the preconditioning matrix = diagonal matrix of the 53 53 !! diagonal elements of a 54 !! Initialization :54 !! Initialization : 55 55 !! x(o) = gcx 56 56 !! r(o) = d(o) = pgcb - pa.x(o) 57 57 !! rr(o)= < r(o) , r(o) >_q 58 !! Iteration n : 59 !! z(n) = pa.d(n) 60 !! alp(n) = rr(n) / < z(n) , d(n) >_q 58 !! Iteration 1 : 59 !! standard PCG algorithm 60 !! Iteration n > 1 : 61 !! s(n) = pa.r(n) 62 !! gam(n) = < r(n) , r(n) >_q 63 !! del(n) = < r(n) , s(n) >_q 64 !! bet(n) = gam(n) / gam(n-1) 65 !! d(n) = r(n) + bet(n) d(n-1) 66 !! z(n) = s(n) + bet(n) z(n-1) 67 !! sig(n) = del(n) - bet(n)*bet(n)*sig(n-1) 68 !! alp(n) = gam(n) / sig(n) 61 69 !! x(n+1) = x(n) + alp(n) d(n) 62 70 !! r(n+1) = r(n) - alp(n) z(n) 63 !! rr(n+1)= < r(n+1) , r(n+1) >_q64 !! bet(n) = rr(n+1) / rr(n)65 !! r(n+1) = r(n+1) + bet(n+1) d(n)66 71 !! Convergence test : 67 72 !! rr(n+1) / < gcb , gcb >_q =< epsr … … 73 78 !! References : 74 79 !! Madec et al. 1988, Ocean Modelling, issue 78, 1-6. 80 !! D Azevedo et al. 1993, Computer Science Technical Report, Tennessee U. 75 81 !! 76 82 !! History : … … 82 88 !! ! 96-11 (A. Weaver) correction to preconditioning 83 89 !! 8.5 ! 02-08 (G. Madec) F90: Free form 90 !! ! 08-01 (R. Benshila) mpp optimization 84 91 !!---------------------------------------------------------------------- 85 92 !! * Arguments … … 91 98 !! * Local declarations 92 99 INTEGER :: ji, jj, jn ! dummy loop indices 93 REAL(wp) :: zgcad ! temporary scalars 100 REAL(wp) :: zgcad ! temporary scalars 101 REAL(wp), DIMENSION(2) :: zsum 102 REAL(wp), DIMENSION(jpi,jpj) :: zgcr 94 103 !!---------------------------------------------------------------------- 95 104 105 ! Initialization of the algorithm with standard PCG 106 ! ------------------------------------------------- 107 108 CALL lbc_lnk( gcx, c_solver_pt, 1. ) ! lateral boundary condition 109 110 ! gcr = gcb-a.gcx 111 ! gcdes = gcr 112 113 DO jj = 2, jpjm1 114 DO ji = fs_2, fs_jpim1 ! vector opt. 115 zgcad = bmask(ji,jj) * ( gcb(ji,jj ) - gcx(ji ,jj ) & 116 & - gcp(ji,jj,1) * gcx(ji ,jj-1) & 117 & - gcp(ji,jj,2) * gcx(ji-1,jj ) & 118 & - gcp(ji,jj,3) * gcx(ji+1,jj ) & 119 & - gcp(ji,jj,4) * gcx(ji ,jj+1) ) 120 gcr (ji,jj) = zgcad 121 gcdes(ji,jj) = zgcad 122 END DO 123 END DO 124 125 ! rnorme = (gcr,gcr) 126 rnorme = SUM( gcr(:,:) * gcdmat(:,:) * gcr(:,:) ) 127 IF( lk_mpp ) CALL mpp_sum( rnorme ) ! sum over the global domain 128 129 CALL lbc_lnk( gcdes, c_solver_pt, 1. ) ! lateral boundary condition 130 131 ! gccd = matrix . gcdes 132 DO jj = 2, jpjm1 133 DO ji = fs_2, fs_jpim1 ! vector opt. 134 gccd(ji,jj) = bmask(ji,jj)*( gcdes(ji,jj) & 135 & +gcp(ji,jj,1)*gcdes(ji,jj-1)+gcp(ji,jj,2)*gcdes(ji-1,jj) & 136 & +gcp(ji,jj,4)*gcdes(ji,jj+1)+gcp(ji,jj,3)*gcdes(ji+1,jj) ) 137 END DO 138 END DO 139 140 ! alph = (gcr,gcr)/(gcdes,gccd) 141 radd = SUM( gcdes(:,:) * gcdmat(:,:) * gccd(:,:) ) 142 IF( lk_mpp ) CALL mpp_sum( radd ) ! sum over the global domain 143 alph = rnorme /radd 144 145 ! gcx = gcx + alph * gcdes 146 ! gcr = gcr - alph * gccd 147 DO jj = 2, jpjm1 148 DO ji = fs_2, fs_jpim1 ! vector opt. 149 gcx(ji,jj) = bmask(ji,jj) * ( gcx(ji,jj) + alph * gcdes(ji,jj) ) 150 gcr(ji,jj) = bmask(ji,jj) * ( gcr(ji,jj) - alph * gccd (ji,jj) ) 151 END DO 152 END DO 153 154 ! Algorithm wtih Eijkhout rearrangement 155 ! ------------------------------------- 156 96 157 ! !================ 97 158 DO jn = 1, nmax ! Iterative loop 98 159 ! !================ 99 160 100 IF( jn == 1 ) THEN ! Initialization of the algorithm 101 102 CALL lbc_lnk( gcx, c_solver_pt, 1. ) ! lateral boundary condition 103 104 ! gcr = gcb-a.gcx 105 ! gcdes = gsr 106 DO jj = 2, jpjm1 107 DO ji = fs_2, fs_jpim1 ! vector opt. 108 zgcad = bmask(ji,jj) * ( gcb(ji,jj ) - gcx(ji ,jj ) & 109 & - gcp(ji,jj,1) * gcx(ji ,jj-1) & 110 & - gcp(ji,jj,2) * gcx(ji-1,jj ) & 111 & - gcp(ji,jj,3) * gcx(ji+1,jj ) & 112 & - gcp(ji,jj,4) * gcx(ji ,jj+1) ) 113 gcr (ji,jj) = zgcad 114 gcdes(ji,jj) = zgcad 115 END DO 116 END DO 117 118 rnorme = SUM( gcr(:,:) * gcdmat(:,:) * gcr(:,:) ) 119 IF( lk_mpp ) CALL mpp_sum( rnorme ) ! sum over the global domain 120 rr = rnorme 121 122 ENDIF 123 124 ! ! Algorithm 125 126 CALL lbc_lnk( gcdes, c_solver_pt, 1. ) ! lateral boundary condition 127 128 ! ... gccd = matrix . gcdes 161 CALL lbc_lnk( gcr, c_solver_pt, 1. ) ! lateral boundary condition 162 163 ! zgcr = matrix . gcr 129 164 DO jj = 2, jpjm1 130 165 DO ji = fs_2, fs_jpim1 ! vector opt. 131 gccd(ji,jj) = bmask(ji,jj)*( gcdes(ji,jj) &132 & +gcp(ji,jj,1)*gc des(ji,jj-1)+gcp(ji,jj,2)*gcdes(ji-1,jj) &133 & +gcp(ji,jj,4)*gc des(ji,jj+1)+gcp(ji,jj,3)*gcdes(ji+1,jj) )166 zgcr(ji,jj) = bmask(ji,jj)*( gcr(ji,jj) & 167 & +gcp(ji,jj,1)*gcr(ji,jj-1)+gcp(ji,jj,2)*gcr(ji-1,jj) & 168 & +gcp(ji,jj,4)*gcr(ji,jj+1)+gcp(ji,jj,3)*gcr(ji+1,jj) ) 134 169 END DO 135 170 END DO 136 171 137 ! alph = (gcr,gcr)/(gcdes,gccd)138 radd = SUM( gcdes(:,:) * gcdmat(:,:) * gccd(:,:) )139 IF( lk_mpp ) CALL mpp_sum( radd ) ! sum over the global domain140 alph = rr / radd141 142 ! gcx = gcx + alph * gcdes143 ! gcr = gcr - alph * gccd144 DO jj = 2, jpjm1145 DO ji = fs_2, fs_jpim1 ! vector opt.146 gcx(ji,jj) = bmask(ji,jj) * ( gcx(ji,jj) + alph * gcdes(ji,jj) )147 gcr(ji,jj) = bmask(ji,jj) * ( gcr(ji,jj) - alph * gccd (ji,jj) )148 END DO149 END DO150 151 172 ! rnorme = (gcr,gcr) 152 rnorme = SUM( gcr(:,:) * gcdmat(:,:) * gcr(:,:) ) 153 IF( lk_mpp ) CALL mpp_sum( rnorme ) ! sum over the global domain 154 173 rr = rnorme 174 zsum(1) = SUM( gcr(:,:) * gcdmat(:,:) * gcr(:,:) ) 175 176 ! zgcad = (zgcr,gcr) 177 zsum(2) = SUM( gcr(2:jpim1,2:jpjm1) * gcdmat(2:jpim1,2:jpjm1) * zgcr(2:jpim1,2:jpjm1) ) 178 179 IF( lk_mpp ) CALL mpp_sum( zsum, 2 ) ! sum over the global domain 180 rnorme = zsum(1) 181 zgcad = zsum(2) 182 155 183 ! test of convergence 156 184 IF( rnorme < epsr .OR. jn == nmax ) THEN … … 159 187 ncut = 999 160 188 ENDIF 161 189 162 190 ! beta = (rk+1,rk+1)/(rk,rk) 163 191 beta = rnorme / rr 164 rr = rnorme 165 192 radd = zgcad - beta*beta*radd 193 alph = rnorme / radd 194 195 ! gcx = gcx + alph * gcdes 196 ! gcr = gcr - alph * gccd 197 DO jj = 2, jpjm1 198 DO ji = fs_2, fs_jpim1 ! vector opt. 199 gcdes(ji,jj) = gcr (ji,jj) + beta * gcdes(ji,jj) 200 gccd (ji,jj) = zgcr(ji,jj) + beta * gccd (ji,jj) 201 gcx (ji,jj) = gcx (ji,jj) + alph * gcdes(ji,jj) 202 gcr (ji,jj) = gcr (ji,jj) - alph * gccd (ji,jj) 203 END DO 204 END DO 205 166 206 ! indicator of non-convergence or explosion 167 207 IF( jn == nmax .OR. SQRT(epsr)/eps > 1.e+20 ) kindic = -2 168 208 IF( ncut == 999 ) GOTO 999 169 209 170 ! gcdes = gcr + beta * gcdes171 DO jj = 2, jpjm1172 DO ji = fs_2, fs_jpim1 ! vector opt.173 gcdes(ji,jj) = bmask(ji,jj)*( gcr(ji,jj) + beta * gcdes(ji,jj) )174 END DO175 END DO176 177 210 ! !================ 178 211 END DO ! End Loop -
branches/dev_001_SBC/NEMO/OPA_SRC/SOL/solsor.F90
r699 r811 43 43 !! as well as islands) while in the latter the boundary condition 44 44 !! specification is not required. 45 !! 45 !! This routine provides a MPI optimization to the existing solsor 46 !! by reducing the number of call to lbc. 47 !! 46 48 !! ** Method : Successive-over-relaxation method using the red-black 47 49 !! technique. The former technique used was not compatible with 48 50 !! the north-fold boundary condition used in orca configurations. 49 !! 51 !! Compared to the classical sol_sor, this routine provides a 52 !! mpp optimization by reducing the number of calls to lnc_lnk 53 !! The solution is computed on a larger area and the boudary 54 !! conditions only when the inside domain is reached. 55 !! 50 56 !! References : 51 57 !! Madec et al. 1988, Ocean Modelling, issue 78, 1-6. 58 !! Beare and Stevens 1997 Ann. Geophysicae 15, 1369-1377 52 59 !! 53 60 !! History : … … 58 65 !! ! 96-11 (A. Weaver) correction to preconditioning 59 66 !! 9.0 ! 03-04 (C. Deltel, G. Madec) Red-Black SOR in free form 67 !! 9.0 ! 05-09 (R. Benshila, G. Madec) MPI optimization 60 68 !!---------------------------------------------------------------------- 61 69 !! * Arguments … … 66 74 !! * Local declarations 67 75 INTEGER :: ji, jj, jn ! dummy loop indices 68 INTEGER :: ishift 76 INTEGER :: ishift, icount 69 77 REAL(wp) :: ztmp, zres, zres2 70 78 71 79 INTEGER :: ijmppodd, ijmppeven 80 INTEGER :: ijpr2d 72 81 !!---------------------------------------------------------------------- 73 82 74 ijmppeven = MOD(nimpp+njmpp ,2) 75 ijmppodd = MOD(nimpp+njmpp+1,2) 83 ijmppeven = MOD(nimpp+njmpp+jpr2di+jpr2dj,2) 84 ijmppodd = MOD(nimpp+njmpp+jpr2di+jpr2dj+1,2) 85 ijpr2d = MAX(jpr2di,jpr2dj) 86 icount = 0 76 87 ! ! ============== 77 88 DO jn = 1, nmax ! Iterative loop 78 89 ! ! ============== 79 90 80 CALL lbc_lnk( gcx, c_solver_pt, 1. ) ! applied the lateral boundary conditions 81 91 ! applied the lateral boundary conditions 92 IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx, c_solver_pt, 1. ) 93 82 94 ! Residus 83 95 ! ------- 84 96 85 97 ! Guess black update 86 DO jj = 2 , jpjm187 ishift = MOD( jj-ijmppodd , 2 )88 DO ji = 2 +ishift, jpim1, 298 DO jj = 2-jpr2dj, nlcj-1+jpr2dj 99 ishift = MOD( jj-ijmppodd-jpr2dj, 2 ) 100 DO ji = 2-jpr2di+ishift, nlci-1+jpr2di, 2 89 101 ztmp = gcb(ji ,jj ) & 90 102 & - gcp(ji,jj,1) * gcx(ji ,jj-1) & … … 99 111 END DO 100 112 END DO 101 102 CALL lbc_lnk( gcx, c_solver_pt, 1. ) ! applied the lateral boubary conditions 113 icount = icount + 1 114 115 ! applied the lateral boundary conditions 116 IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx, c_solver_pt, 1. ) 103 117 104 118 ! Guess red update 105 DO jj = 2 , jpjm1106 ishift = MOD( jj-ijmppeven , 2 )107 DO ji = 2 +ishift, jpim1, 2119 DO jj = 2-jpr2dj, nlcj-1+jpr2dj 120 ishift = MOD( jj-ijmppeven-jpr2dj, 2 ) 121 DO ji = 2-jpr2di+ishift, nlci-1+jpr2di, 2 108 122 ztmp = gcb(ji ,jj ) & 109 123 & - gcp(ji,jj,1) * gcx(ji ,jj-1) & … … 118 132 END DO 119 133 END DO 134 icount = icount + 1 120 135 121 136 ! test of convergence … … 124 139 SELECT CASE ( nsol_arp ) 125 140 CASE ( 0 ) ! absolute precision (maximum value of the residual) 126 zres2 = MAXVAL( gcr(2: jpim1,2:jpjm1) )141 zres2 = MAXVAL( gcr(2:nlci-1,2:nlcj-1) ) 127 142 IF( lk_mpp ) CALL mpp_max( zres2 ) ! max over the global domain 128 143 ! test of convergence … … 133 148 ENDIF 134 149 CASE ( 1 ) ! relative precision 135 rnorme = SUM( gcr(2: jpim1,2:jpjm1) )150 rnorme = SUM( gcr(2:nlci-1,2:nlcj-1) ) 136 151 IF( lk_mpp ) CALL mpp_sum( rnorme ) ! sum over the global domain 137 152 ! test of convergence … … 163 178 ! ------------- 164 179 165 CALL lbc_lnk ( gcx, c_solver_pt, 1. ) ! boundary conditions180 CALL lbc_lnk_e( gcx, c_solver_pt, 1. ) ! boundary conditions 166 181 167 182 -
branches/dev_001_SBC/NEMO/OPA_SRC/SOL/solver.F90
r699 r811 152 152 153 153 CASE ( 2 ) ! successive-over-relaxation solver 154 IF(lwp) WRITE(numout,*) ' a successive-over-relaxation solver is used' 155 IF( jpr2di /= 0 .AND. jpr2dj /= 0 ) & 156 CALL ctl_stop( ' jpr2di and jpr2dj should be equal to zero' ) 154 IF(lwp) WRITE(numout,*) ' a successive-over-relaxation solver with extra outer halo is used' 155 IF(lwp) WRITE(numout,*) ' with jpr2di =', jpr2di, ' and jpr2dj =', jpr2dj 156 IF( .NOT. lk_mpp .AND. jpr2di /= 0 .AND. jpr2dj /= 0 ) THEN 157 CALL ctl_stop( ' jpr2di and jpr2dj are not equal to zero', & 158 & ' In this case this algorithm should be used only with the key_mpp_... option' ) 159 ELSE 160 IF( ( ( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 ) .OR. ( jpni /= 1 ) ) & 161 & .AND. ( jpr2di /= jpr2dj ) ) CALL ctl_stop( ' jpr2di should be equal to jpr2dj' ) 162 ENDIF 157 163 158 164 CASE ( 3 ) ! FETI solver … … 169 175 ENDIF 170 176 171 CASE ( 4 ) ! successive-over-relaxation solver with extra outer halo172 IF(lwp) WRITE(numout,*) ' a successive-over-relaxation solver with extra outer halo is used'173 IF(lwp) WRITE(numout,*) ' with jpr2di =', jpr2di, ' and jpr2dj =', jpr2dj174 IF( .NOT. lk_mpp .AND. jpr2di /= 0 .AND. jpr2dj /= 0 ) THEN175 CALL ctl_stop( ' jpr2di and jpr2dj are not equal to zero', &176 & ' In this case this algorithm should be used only with the key_mpp_... option' )177 ELSE178 IF( ( ( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 ) .OR. ( jpni /= 1 ) ) &179 & .AND. ( jpr2di /= jpr2dj ) ) CALL ctl_stop( ' jpr2di should be equal to jpr2dj' )180 ENDIF181 182 177 CASE DEFAULT 183 178 WRITE(ctmp1,*) ' bad flag value for nsolv = ', nsolv … … 186 181 END SELECT 187 182 188 IF( nbit_cmp == 1 .AND. nsolv /= 2 ) THEN 189 CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require the SOR solver: nsolv = 2' ) 183 IF( nbit_cmp == 1 ) THEN 184 IF( nsolv /= 2 ) THEN 185 CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require the SOR solver: nsolv = 2' ) 186 ELSE IF( MAX( jpr2di, jpr2dj ) > 0 ) THEN 187 CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require jpr2di = jpr2dj = 0' ) 188 END IF 190 189 END IF 191 190 -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/traadv.F90
r699 r811 14 14 USE dom_oce ! ocean space and time domain 15 15 USE traadv_cen2 ! 2nd order centered scheme (tra_adv_cen2 routine) 16 USE traadv_cen2_jki ! 2nd order centered scheme (tra_adv_cen2 routine)17 16 USE traadv_tvd ! TVD scheme (tra_adv_tvd routine) 18 17 USE traadv_muscl ! MUSCL scheme (tra_adv_muscl routine) … … 88 87 89 88 SELECT CASE ( nadv ) ! compute advection trend and add it to general trend 90 CASE ( 0 ) ; CALL tra_adv_cen2 ( kt, zun, zvn, zwn ) ! 2nd order centered scheme k-j-i loops 91 CASE ( 1 ) ; CALL tra_adv_cen2_jki( kt, zun, zvn, zwn ) ! 2nd order centered scheme 89 CASE ( 1 ) ; CALL tra_adv_cen2 ( kt, zun, zvn, zwn ) ! 2nd order centered scheme 92 90 CASE ( 2 ) ; CALL tra_adv_tvd ( kt, zun, zvn, zwn ) ! TVD scheme 93 91 CASE ( 3 ) ; CALL tra_adv_muscl ( kt, zun, zvn, zwn ) ! MUSCL scheme … … 99 97 CALL tra_adv_cen2 ( kt, zun, zvn, zwn ) 100 98 CALL prt_ctl( tab3d_1=ta, clinfo1=' adv0 - Ta: ', mask1=tmask, & 101 & tab3d_2=sa, clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' )102 CALL tra_adv_cen2_jki( kt, zun, zvn, zwn )103 CALL prt_ctl( tab3d_1=ta, clinfo1=' adv1 - Ta: ', mask1=tmask, &104 99 & tab3d_2=sa, clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) 105 100 CALL tra_adv_tvd ( kt, zun, zvn, zwn ) … … 171 166 172 167 ! ! Set nadv 173 IF( ln_traadv_cen2 ) nadv = 0174 #if defined key_mpp_omp175 168 IF( ln_traadv_cen2 ) nadv = 1 176 #endif177 169 IF( ln_traadv_tvd ) nadv = 2 178 170 IF( ln_traadv_muscl ) nadv = 3 … … 184 176 IF(lwp) THEN ! Print the choice 185 177 WRITE(numout,*) 186 IF( nadv == 0 ) WRITE(numout,*) ' 2nd order scheme is used' 187 IF( nadv == 1 ) WRITE(numout,*) ' 2nd order scheme is usedi, k-j-i case' 178 IF( nadv == 1 ) WRITE(numout,*) ' 2nd order scheme is used' 188 179 IF( nadv == 2 ) WRITE(numout,*) ' TVD scheme is used' 189 180 IF( nadv == 3 ) WRITE(numout,*) ' MUSCL scheme is used' 190 181 IF( nadv == 4 ) WRITE(numout,*) ' MUSCL2 scheme is used' 191 182 IF( nadv == 5 ) WRITE(numout,*) ' UBS scheme is used' 192 IF( nadv == 6 ) WRITE(numout,*) ' PPM scheme is used' 193 IF( nadv == 7 ) WRITE(numout,*) ' QUICKEST scheme is used' 183 IF( nadv == 6 ) WRITE(numout,*) ' QUICKEST scheme is used' 194 184 IF( nadv == -1 ) WRITE(numout,*) ' esopa test: use all advection scheme' 195 185 ENDIF -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/traadv_cen2.F90
r717 r811 15 15 !! tra_adv_cen2 : update the tracer trend with the horizontal and 16 16 !! vertical advection trends using a seconder order 17 !! centered scheme. (k-j-i loops)18 17 !! ups_orca_set : allow mixed upstream/centered scheme in specific 19 18 !! area (set for orca 2 and 4 only) -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/traadv_qck.F90
r708 r811 50 50 51 51 CONTAINS 52 53 #if ! defined key_mpp_omp54 !!----------------------------------------------------------------------55 !! Default option : quickest advection scheme (k-j-i loop)56 !!----------------------------------------------------------------------57 52 58 53 SUBROUTINE tra_adv_qck( kt, pun, pvn, pwn ) … … 579 574 END FUNCTION 580 575 581 #else582 !!----------------------------------------------------------------------583 !! 'key_mpp_omp' : quickest advection (k- and j-slabs)584 !!----------------------------------------------------------------------585 SUBROUTINE tra_adv_qck( kt, pun, pvn, pwn )586 !!----------------------------------------------------------------------587 !! * Arguments588 INTEGER, INTENT( in ) :: kt ! ocean time-step index589 REAL(wp), INTENT(in), DIMENSION(jpi,jpj,jpk) :: pun ! effective ocean velocity, u_component590 REAL(wp), INTENT(in), DIMENSION(jpi,jpj,jpk) :: pvn ! effective ocean velocity, v_component591 REAL(wp), INTENT(in), DIMENSION(jpi,jpj,jpk) :: pwn ! effective ocean velocity, w_component592 !!----------------------------------------------------------------------593 IF(lwp) WRITE(numout,*)594 IF(lwp) WRITE(numout,*) 'tra_adv_ qck:3st order quickest advection scheme'595 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~ Vector optimization case'596 IF(lwp) WRITE(numout,*) 'WITH AUTOTASKING =>this routine doesn t exist for the moment'597 IF(lwp) WRITE(numout,*) ' EMPTY ROUTINE!!!!!!'598 599 END SUBROUTINE tra_adv_qck600 601 #endif602 603 576 !!====================================================================== 604 577 END MODULE traadv_qck -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/traadv_tvd.F90
r699 r811 75 75 INTEGER :: ji, jj, jk ! dummy loop indices 76 76 REAL(wp) :: & ! temporary scalar 77 ztai, ztaj, ztak, & ! " " 78 zsai, zsaj, zsak, & ! " " 77 ztat, zsat, & ! " " 79 78 z_hdivn_x, z_hdivn_y, z_hdivn 80 79 REAL(wp) :: & … … 158 157 ! total advective trend 159 158 DO jk = 1, jpkm1 159 z2dtt = z2 * rdttra(jk) 160 160 DO jj = 2, jpjm1 161 161 DO ji = fs_2, fs_jpim1 ! vector opt. 162 162 zbtr = 1./ ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 163 ! i- j- horizontal & k- vertical advective trends164 ztai = - ( ztu(ji,jj,jk) - ztu(ji-1,jj ,jk ) ) * zbtr165 ztaj = - ( ztv(ji,jj,jk) - ztv(ji ,jj-1,jk ) ) * zbtr166 ztak = - ( ztw(ji,jj,jk) - ztw(ji ,jj ,jk+1) ) * zbtr167 zsai = - ( zsu(ji,jj,jk) - zsu(ji-1,jj ,jk ) ) * zbtr168 zsaj = - ( zsv(ji,jj,jk) - zsv(ji ,jj-1,jk ) ) * zbtr169 zsak = - ( zsw(ji,jj,jk) - zsw(ji ,jj ,jk+1) ) * zbtr170 163 ! total intermediate advective trends 171 zti(ji,jj,jk) = ztai + ztaj + ztak 172 zsi(ji,jj,jk) = zsai + zsaj + zsak 164 ztat = - ( ztu(ji,jj,jk) - ztu(ji-1,jj ,jk ) & 165 & + ztv(ji,jj,jk) - ztv(ji ,jj-1,jk ) & 166 & + ztw(ji,jj,jk) - ztw(ji ,jj ,jk+1) ) * zbtr 167 zsat = - ( zsu(ji,jj,jk) - zsu(ji-1,jj ,jk ) & 168 & + zsv(ji,jj,jk) - zsv(ji ,jj-1,jk ) & 169 & + zsw(ji,jj,jk) - zsw(ji ,jj ,jk+1) ) * zbtr 170 ! update and guess with monotonic sheme 171 ta(ji,jj,jk) = ta(ji,jj,jk) + ztat 172 sa(ji,jj,jk) = sa(ji,jj,jk) + zsat 173 zti (ji,jj,jk) = ( tb(ji,jj,jk) + z2dtt * ztat ) * tmask(ji,jj,jk) 174 zsi (ji,jj,jk) = ( sb(ji,jj,jk) + z2dtt * zsat ) * tmask(ji,jj,jk) 173 175 END DO 174 176 END DO … … 222 224 ! 223 225 ENDIF 224 225 ! update and guess with monotonic sheme226 DO jk = 1, jpkm1227 z2dtt = z2 * rdttra(jk)228 DO jj = 2, jpjm1229 DO ji = fs_2, fs_jpim1 ! vector opt.230 ta(ji,jj,jk) = ta(ji,jj,jk) + zti(ji,jj,jk)231 sa(ji,jj,jk) = sa(ji,jj,jk) + zsi(ji,jj,jk)232 zti (ji,jj,jk) = ( tb(ji,jj,jk) + z2dtt * zti(ji,jj,jk) ) * tmask(ji,jj,jk)233 zsi (ji,jj,jk) = ( sb(ji,jj,jk) + z2dtt * zsi(ji,jj,jk) ) * tmask(ji,jj,jk)234 END DO235 END DO236 END DO237 226 238 227 ! Lateral boundary conditions on zti, zsi (unchanged sign) … … 290 279 DO ji = fs_2, fs_jpim1 ! vector opt. 291 280 zbtr = 1. / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 292 ! i- j- horizontal & k- vertical advective trends 293 ztai = - ( ztu(ji,jj,jk) - ztu(ji-1,jj ,jk )) * zbtr 294 ztaj = - ( ztv(ji,jj,jk) - ztv(ji ,jj-1,jk )) * zbtr 295 ztak = - ( ztw(ji,jj,jk) - ztw(ji ,jj ,jk+1)) * zbtr 296 zsai = - ( zsu(ji,jj,jk) - zsu(ji-1,jj ,jk )) * zbtr 297 zsaj = - ( zsv(ji,jj,jk) - zsv(ji ,jj-1,jk )) * zbtr 298 zsak = - ( zsw(ji,jj,jk) - zsw(ji ,jj ,jk+1)) * zbtr 299 281 ! total advective trends 282 ztat = - ( ztu(ji,jj,jk) - ztu(ji-1,jj ,jk ) & 283 & + ztv(ji,jj,jk) - ztv(ji ,jj-1,jk ) & 284 & + ztw(ji,jj,jk) - ztw(ji ,jj ,jk+1) ) * zbtr 285 zsat = - ( zsu(ji,jj,jk) - zsu(ji-1,jj ,jk ) & 286 & + zsv(ji,jj,jk) - zsv(ji ,jj-1,jk ) & 287 & + zsw(ji,jj,jk) - zsw(ji ,jj ,jk+1) ) * zbtr 300 288 ! add them to the general tracer trends 301 ta(ji,jj,jk) = ta(ji,jj,jk) + zta i + ztaj + ztak302 sa(ji,jj,jk) = sa(ji,jj,jk) + zsa i + zsaj + zsak289 ta(ji,jj,jk) = ta(ji,jj,jk) + ztat 290 sa(ji,jj,jk) = sa(ji,jj,jk) + zsat 303 291 END DO 304 292 END DO … … 396 384 !! in-space based differencing for fluid 397 385 !!---------------------------------------------------------------------- 398 REAL(wp), INTENT( in ) :: prdt 386 REAL(wp), INTENT( in ) :: prdt ! ??? 399 387 REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT( inout ) :: & 400 388 pbef, & ! before field … … 407 395 INTEGER :: ikm1 408 396 REAL(wp), DIMENSION (jpi,jpj,jpk) :: zbetup, zbetdo 397 REAL(wp), DIMENSION (jpi,jpj,jpk) :: zbup, zbdo 409 398 REAL(wp) :: zpos, zneg, zbt, za, zb, zc, zbig, zrtrn, z2dtt 399 REAL(wp) :: zau, zbu, zcu, zav, zbv, zcv 400 REAL(wp) :: zup, zdo 410 401 !!---------------------------------------------------------------------- 411 402 412 403 zbig = 1.e+40 413 404 zrtrn = 1.e-15 414 zbetup(:,:,:) = 0.e0 ; zbetdo(:,:,:) = 0.e0 405 zbetup(:,:,jpk) = 0.e0 ; zbetdo(:,:,jpk) = 0.e0 406 415 407 416 408 ! Search local extrema 417 409 ! -------------------- 418 ! large negative value (-zbig) inside land 419 pbef(:,:,:) = pbef(:,:,:) * tmask(:,:,:) - zbig * ( 1.e0 - tmask(:,:,:) ) 420 paft(:,:,:) = paft(:,:,:) * tmask(:,:,:) - zbig * ( 1.e0 - tmask(:,:,:) ) 421 ! search maximum in neighbourhood 410 ! max/min of pbef & paft with large negative/positive value (-/+zbig) inside land 411 zbup = MAX( pbef * tmask - zbig * ( 1.e0 - tmask ), & 412 & paft * tmask - zbig * ( 1.e0 - tmask ) ) 413 zbdo = MIN( pbef * tmask + zbig * ( 1.e0 - tmask ), & 414 & paft * tmask + zbig * ( 1.e0 - tmask ) ) 415 422 416 DO jk = 1, jpkm1 423 417 ikm1 = MAX(jk-1,1) 424 DO jj = 2, jpjm1425 DO ji = fs_2, fs_jpim1 ! vector opt.426 zbetup(ji,jj,jk) = MAX( pbef(ji ,jj ,jk ), paft(ji ,jj ,jk ), &427 & pbef(ji-1,jj ,jk ), pbef(ji+1,jj ,jk ), &428 & paft(ji-1,jj ,jk ), paft(ji+1,jj ,jk ), &429 & pbef(ji ,jj-1,jk ), pbef(ji ,jj+1,jk ), &430 & paft(ji ,jj-1,jk ), paft(ji ,jj+1,jk ), &431 & pbef(ji ,jj ,ikm1), pbef(ji ,jj ,jk+1), &432 & paft(ji ,jj ,ikm1), paft(ji ,jj ,jk+1) )433 END DO434 END DO435 END DO436 ! large positive value (+zbig) inside land437 pbef(:,:,:) = pbef(:,:,:) * tmask(:,:,:) + zbig * ( 1.e0 - tmask(:,:,:) )438 paft(:,:,:) = paft(:,:,:) * tmask(:,:,:) + zbig * ( 1.e0 - tmask(:,:,:) )439 ! search minimum in neighbourhood440 DO jk = 1, jpkm1441 ikm1 = MAX(jk-1,1)442 DO jj = 2, jpjm1443 DO ji = fs_2, fs_jpim1 ! vector opt.444 zbetdo(ji,jj,jk) = MIN( pbef(ji ,jj ,jk ), paft(ji ,jj ,jk ), &445 & pbef(ji-1,jj ,jk ), pbef(ji+1,jj ,jk ), &446 & paft(ji-1,jj ,jk ), paft(ji+1,jj ,jk ), &447 & pbef(ji ,jj-1,jk ), pbef(ji ,jj+1,jk ), &448 & paft(ji ,jj-1,jk ), paft(ji ,jj+1,jk ), &449 & pbef(ji ,jj ,ikm1), pbef(ji ,jj ,jk+1), &450 & paft(ji ,jj ,ikm1), paft(ji ,jj ,jk+1) )451 END DO452 END DO453 END DO454 455 ! restore masked values to zero456 pbef(:,:,:) = pbef(:,:,:) * tmask(:,:,:)457 paft(:,:,:) = paft(:,:,:) * tmask(:,:,:)458 459 460 ! 2. Positive and negative part of fluxes and beta terms461 ! ------------------------------------------------------462 463 DO jk = 1, jpkm1464 418 z2dtt = prdt * rdttra(jk) 465 419 DO jj = 2, jpjm1 466 420 DO ji = fs_2, fs_jpim1 ! vector opt. 467 ! positive & negative part of the flux 421 422 ! search maximum in neighbourhood 423 zup = MAX( zbup(ji ,jj ,jk ), & 424 & zbup(ji-1,jj ,jk ), zbup(ji+1,jj ,jk ), & 425 & zbup(ji ,jj-1,jk ), zbup(ji ,jj+1,jk ), & 426 & zbup(ji ,jj ,ikm1), zbup(ji ,jj ,jk+1) ) 427 428 ! search minimum in neighbourhood 429 zdo = MIN( zbdo(ji ,jj ,jk ), & 430 & zbdo(ji-1,jj ,jk ), zbdo(ji+1,jj ,jk ), & 431 & zbdo(ji ,jj-1,jk ), zbdo(ji ,jj+1,jk ), & 432 & zbdo(ji ,jj ,ikm1), zbdo(ji ,jj ,jk+1) ) 433 434 ! positive part of the flux 468 435 zpos = MAX( 0., paa(ji-1,jj ,jk ) ) - MIN( 0., paa(ji ,jj ,jk ) ) & 469 436 & + MAX( 0., pbb(ji ,jj-1,jk ) ) - MIN( 0., pbb(ji ,jj ,jk ) ) & 470 437 & + MAX( 0., pcc(ji ,jj ,jk+1) ) - MIN( 0., pcc(ji ,jj ,jk ) ) 438 439 ! negative part of the flux 471 440 zneg = MAX( 0., paa(ji ,jj ,jk ) ) - MIN( 0., paa(ji-1,jj ,jk ) ) & 472 441 & + MAX( 0., pbb(ji ,jj ,jk ) ) - MIN( 0., pbb(ji ,jj-1,jk ) ) & 473 442 & + MAX( 0., pcc(ji ,jj ,jk ) ) - MIN( 0., pcc(ji ,jj ,jk+1) ) 443 474 444 ! up & down beta terms 475 445 zbt = e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) / z2dtt 476 zbetup(ji,jj,jk) = ( z betup(ji,jj,jk) - paft(ji,jj,jk) ) / (zpos+zrtrn) * zbt477 zbetdo(ji,jj,jk) = ( paft(ji,jj,jk) - z betdo(ji,jj,jk) ) / (zneg+zrtrn) * zbt446 zbetup(ji,jj,jk) = ( zup - paft(ji,jj,jk) ) / ( zpos + zrtrn ) * zbt 447 zbetdo(ji,jj,jk) = ( paft(ji,jj,jk) - zdo ) / ( zneg + zrtrn ) * zbt 478 448 END DO 479 449 END DO … … 490 460 DO jj = 2, jpjm1 491 461 DO ji = fs_2, fs_jpim1 ! vector opt. 492 za = MIN( 1.e0, zbetdo(ji,jj,jk), zbetup(ji+1,jj,jk) ) 493 zb = MIN( 1.e0, zbetup(ji,jj,jk), zbetdo(ji+1,jj,jk) ) 494 zc = 0.5 * ( 1.e0 + SIGN( 1.e0, paa(ji,jj,jk) ) ) 495 paa(ji,jj,jk) = paa(ji,jj,jk) * ( zc * za + ( 1.e0 - zc) * zb ) 496 497 za = MIN( 1.e0, zbetdo(ji,jj,jk), zbetup(ji,jj+1,jk) ) 498 zb = MIN( 1.e0, zbetup(ji,jj,jk), zbetdo(ji,jj+1,jk) ) 499 zc = 0.5 * ( 1.e0 + SIGN( 1.e0, pbb(ji,jj,jk) ) ) 500 pbb(ji,jj,jk) = pbb(ji,jj,jk) * ( zc * za + ( 1.e0 - zc) * zb ) 501 END DO 502 END DO 503 END DO 504 462 zau = MIN( 1.e0, zbetdo(ji,jj,jk), zbetup(ji+1,jj,jk) ) 463 zbu = MIN( 1.e0, zbetup(ji,jj,jk), zbetdo(ji+1,jj,jk) ) 464 zcu = ( 0.5 + SIGN( 0.5 , paa(ji,jj,jk) ) ) 465 paa(ji,jj,jk) = paa(ji,jj,jk) * ( zcu * zau + ( 1.e0 - zcu) * zbu ) 466 467 zav = MIN( 1.e0, zbetdo(ji,jj,jk), zbetup(ji,jj+1,jk) ) 468 zbv = MIN( 1.e0, zbetup(ji,jj,jk), zbetdo(ji,jj+1,jk) ) 469 zcv = ( 0.5 + SIGN( 0.5 , pbb(ji,jj,jk) ) ) 470 pbb(ji,jj,jk) = pbb(ji,jj,jk) * ( zcv * zav + ( 1.e0 - zcv) * zbv ) 505 471 506 472 ! monotonic flux in the k direction, i.e. pcc 507 473 ! ------------------------------------------- 508 DO jk = 2, jpkm1 509 DO jj = 2, jpjm1 510 DO ji = fs_2, fs_jpim1 ! vector opt. 511 512 za = MIN( 1., zbetdo(ji,jj,jk), zbetup(ji,jj,jk-1) ) 513 zb = MIN( 1., zbetup(ji,jj,jk), zbetdo(ji,jj,jk-1) ) 514 zc = 0.5 * ( 1.e0 + SIGN( 1.e0, pcc(ji,jj,jk) ) ) 515 pcc(ji,jj,jk) = pcc(ji,jj,jk) * ( zc * za + ( 1.e0 - zc) * zb ) 474 za = MIN( 1., zbetdo(ji,jj,jk+1), zbetup(ji,jj,jk) ) 475 zb = MIN( 1., zbetup(ji,jj,jk+1), zbetdo(ji,jj,jk) ) 476 zc = ( 0.5 + SIGN( 0.5 , pcc(ji,jj,jk+1) ) ) 477 pcc(ji,jj,jk+1) = pcc(ji,jj,jk+1) * ( zc * za + ( 1.e0 - zc) * zb ) 516 478 END DO 517 479 END DO … … 521 483 CALL lbc_lnk( paa, 'U', -1. ) ! changed sign 522 484 CALL lbc_lnk( pbb, 'V', -1. ) ! changed sign 523 CALL lbc_lnk( pcc, 'W', 1. ) ! NO changed sign524 485 ! 525 486 END SUBROUTINE nonosc -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/trabbc.F90
r699 r811 75 75 INTEGER, INTENT( in ) :: kt ! ocean time-step index 76 76 !! 77 #if defined key_vectopt_loop && ! defined key_mpp_omp77 #if defined key_vectopt_loop 78 78 INTEGER :: ji ! dummy loop indices 79 79 #else … … 95 95 ! 96 96 CASE ( 1:2 ) ! geothermal heat flux 97 #if defined key_vectopt_loop && ! defined key_mpp_omp97 #if defined key_vectopt_loop 98 98 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 99 99 zqgh_trd = ro0cpr * qgh_trd0(ji,1) / fse3t(ji,1,nbotlevt(ji,1) ) -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/trabbl.F90
r699 r811 154 154 ! ----------------------------------------------------------------- 155 155 ! mbathy= number of w-level, minimum value=1 (cf dommsk.F) 156 # if defined key_vectopt_loop && ! defined key_mpp_omp156 # if defined key_vectopt_loop 157 157 jj = 1 158 158 DO ji = 1, jpij ! vector opt. (forced unrolling) … … 167 167 zsbb(ji,jj) = sb(ji,jj,ik) * tmask(ji,jj,1) 168 168 zdep(ji,jj) = fsdept(ji,jj,ik) ! depth of the ocean bottom T-level 169 # if ! defined key_vectopt_loop || defined key_mpp_omp169 # if ! defined key_vectopt_loop 170 170 END DO 171 171 # endif … … 173 173 174 174 IF( ln_zps ) THEN ! partial steps correction 175 # if defined key_vectopt_loop && ! defined key_mpp_omp175 # if defined key_vectopt_loop 176 176 jj = 1 177 177 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 188 188 zahu(ji,jj) = atrbbl * e2u(ji,jj) * ze3u / e1u(ji,jj) * umask(ji,jj,1) 189 189 zahv(ji,jj) = atrbbl * e1v(ji,jj) * ze3v / e2v(ji,jj) * vmask(ji,jj,1) 190 # if ! defined key_vectopt_loop || defined key_mpp_omp190 # if ! defined key_vectopt_loop 191 191 END DO 192 192 # endif 193 193 END DO 194 194 ELSE ! z-coordinate - full steps or s-coordinate 195 # if defined key_vectopt_loop && ! defined key_mpp_omp195 # if defined key_vectopt_loop 196 196 jj = 1 197 197 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 204 204 zahu(ji,jj) = atrbbl * e2u(ji,jj) * fse3u(ji,jj,iku) / e1u(ji,jj) * umask(ji,jj,1) 205 205 zahv(ji,jj) = atrbbl * e1v(ji,jj) * fse3v(ji,jj,ikv) / e2v(ji,jj) * vmask(ji,jj,1) 206 # if ! defined key_vectopt_loop || defined key_mpp_omp206 # if ! defined key_vectopt_loop 207 207 END DO 208 208 # endif … … 219 219 CASE ( 0 ) ! Jackett and McDougall (1994) formulation 220 220 221 # if defined key_vectopt_loop && ! defined key_mpp_omp221 # if defined key_vectopt_loop 222 222 jj = 1 223 223 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 238 238 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 239 239 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 240 # if ! defined key_vectopt_loop || defined key_mpp_omp241 END DO 242 # endif 243 END DO 244 245 # if defined key_vectopt_loop && ! defined key_mpp_omp240 # if ! defined key_vectopt_loop 241 END DO 242 # endif 243 END DO 244 245 # if defined key_vectopt_loop 246 246 jj = 1 247 247 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 262 262 zsign = sign( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 263 263 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 264 # if ! defined key_vectopt_loop || defined key_mpp_omp264 # if ! defined key_vectopt_loop 265 265 END DO 266 266 # endif … … 269 269 CASE ( 1 ) ! Linear formulation function of temperature only 270 270 ! 271 # if defined key_vectopt_loop && ! defined key_mpp_omp271 # if defined key_vectopt_loop 272 272 jj = 1 273 273 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 281 281 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 282 282 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 283 # if ! defined key_vectopt_loop || defined key_mpp_omp284 END DO 285 # endif 286 END DO 287 288 # if defined key_vectopt_loop && ! defined key_mpp_omp283 # if ! defined key_vectopt_loop 284 END DO 285 # endif 286 END DO 287 288 # if defined key_vectopt_loop 289 289 jj = 1 290 290 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 298 298 zsign = sign( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 299 299 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 300 # if ! defined key_vectopt_loop || defined key_mpp_omp300 # if ! defined key_vectopt_loop 301 301 END DO 302 302 # endif … … 305 305 CASE ( 2 ) ! Linear formulation function of temperature and salinity 306 306 307 # if defined key_vectopt_loop && ! defined key_mpp_omp307 # if defined key_vectopt_loop 308 308 jj = 1 309 309 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 318 318 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 319 319 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 320 # if ! defined key_vectopt_loop || defined key_mpp_omp321 END DO 322 # endif 323 END DO 324 325 # if defined key_vectopt_loop && ! defined key_mpp_omp320 # if ! defined key_vectopt_loop 321 END DO 322 # endif 323 END DO 324 325 # if defined key_vectopt_loop 326 326 jj = 1 327 327 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 336 336 zsign = sign( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 337 337 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 338 # if ! defined key_vectopt_loop || defined key_mpp_omp338 # if ! defined key_vectopt_loop 339 339 END DO 340 340 # endif … … 352 352 353 353 ! first derivative (gradient) 354 # if defined key_vectopt_loop && ! defined key_mpp_omp354 # if defined key_vectopt_loop 355 355 jj = 1 356 356 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 364 364 zky(ji,jj) = zkj(ji,jj) * ( ztbb(ji,jj+1) - ztbb(ji,jj) ) 365 365 zkw(ji,jj) = zkj(ji,jj) * ( zsbb(ji,jj+1) - zsbb(ji,jj) ) 366 # if ! defined key_vectopt_loop || defined key_mpp_omp366 # if ! defined key_vectopt_loop 367 367 END DO 368 368 # endif … … 402 402 403 403 ! second derivative (divergence) and add to the general tracer trend 404 # if defined key_vectopt_loop && ! defined key_mpp_omp404 # if defined key_vectopt_loop 405 405 jj = 1 406 406 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) … … 417 417 ta(ji,jj,ik) = ta(ji,jj,ik) + zta 418 418 sa(ji,jj,ik) = sa(ji,jj,ik) + zsa 419 # if ! defined key_vectopt_loop || defined key_mpp_omp419 # if ! defined key_vectopt_loop 420 420 END DO 421 421 # endif -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/trabbl_adv.h90
r699 r811 99 99 ! mbathy= number of w-level, minimum value=1 (cf dommsk.F) 100 100 101 #if defined key_vectopt_loop && ! defined key_mpp_omp101 #if defined key_vectopt_loop 102 102 jj = 1 103 103 DO ji = 1, jpij ! vector opt. (forced unrolling) … … 115 115 zunb(ji,jj) = un(ji,jj,mbku(ji,jj)) 116 116 zvnb(ji,jj) = vn(ji,jj,mbkv(ji,jj)) 117 #if ! defined key_vectopt_loop || defined key_mpp_omp117 #if ! defined key_vectopt_loop 118 118 END DO 119 119 #endif … … 229 229 IF( ln_zps ) THEN ! partial steps correction 230 230 231 # if defined key_vectopt_loop && ! defined key_mpp_omp231 # if defined key_vectopt_loop 232 232 jj = 1 233 233 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 249 249 v_bbl(ji,jj,ikv) = zalphay(ji,jj) * vn(ji,jj,ikv) * ze3v / fse3v(ji,jj,ikv) 250 250 ENDIF 251 # if ! defined key_vectopt_loop || defined key_mpp_omp251 # if ! defined key_vectopt_loop 252 252 END DO 253 253 # endif … … 259 259 ELSE ! if not partial step loop over the whole domain no lbc call 260 260 261 #if defined key_vectopt_loop && ! defined key_mpp_omp261 #if defined key_vectopt_loop 262 262 jj = 1 263 263 DO ji = 1, jpij ! vector opt. (forced unrolling) … … 272 272 v_bbl(ji,jj,ikv) = zalphay(ji,jj) * vn(ji,jj,ikv) 273 273 ENDIF 274 #if ! defined key_vectopt_loop || defined key_mpp_omp274 #if ! defined key_vectopt_loop 275 275 END DO 276 276 #endif … … 284 284 ! ... Second order centered tracer flux at u and v-points 285 285 286 # if defined key_vectopt_loop && ! defined key_mpp_omp286 # if defined key_vectopt_loop 287 287 jj = 1 288 288 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 309 309 zwz(ji,jj) = ( ( zfvj + ABS( zfvj ) ) * zsbb(ji ,jj ) & 310 310 & +( zfvj - ABS( zfvj ) ) * zsbb(ji ,jj+1) ) * 0.5 311 #if ! defined key_vectopt_loop || defined key_mpp_omp311 #if ! defined key_vectopt_loop 312 312 END DO 313 313 #endif 314 314 END DO 315 # if defined key_vectopt_loop && ! defined key_mpp_omp315 # if defined key_vectopt_loop 316 316 jj = 1 317 317 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) … … 331 331 ta(ji,jj,ik) = ta(ji,jj,ik) + zta 332 332 sa(ji,jj,ik) = sa(ji,jj,ik) + zsa 333 #if ! defined key_vectopt_loop || defined key_mpp_omp333 #if ! defined key_vectopt_loop 334 334 END DO 335 335 #endif … … 365 365 IF( ln_zps ) THEN 366 366 367 # if defined key_vectopt_loop && ! defined key_mpp_omp367 # if defined key_vectopt_loop 368 368 jj = 1 369 369 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 383 383 zwu(ji,jj) = zalphax(ji,jj) * e2u(ji,jj) * ze3u 384 384 zwv(ji,jj) = zalphay(ji,jj) * e1v(ji,jj) * ze3v 385 #if ! defined key_vectopt_loop || defined key_mpp_omp385 #if ! defined key_vectopt_loop 386 386 END DO 387 387 #endif … … 390 390 ELSE 391 391 392 # if defined key_vectopt_loop && ! defined key_mpp_omp392 # if defined key_vectopt_loop 393 393 jj = 1 394 394 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) … … 401 401 zwu(ji,jj) = zalphax(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,iku) 402 402 zwv(ji,jj) = zalphay(ji,jj) * e1v(ji,jj) * fse3v(ji,jj,ikv) 403 #if ! defined key_vectopt_loop || defined key_mpp_omp403 #if ! defined key_vectopt_loop 404 404 END DO 405 405 #endif … … 409 409 410 410 411 # if defined key_vectopt_loop && ! defined key_mpp_omp411 # if defined key_vectopt_loop 412 412 jj = 1 413 413 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) … … 425 425 & ) / zbt 426 426 427 # if ! defined key_vectopt_loop || defined key_mpp_omp427 # if ! defined key_vectopt_loop 428 428 END DO 429 429 # endif -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/traldf_iso.F90
r699 r811 18 18 !! and with the vertical part of 19 19 !! the isopycnal or geopotential s-coord. operator 20 !! vector optimization, use k-j-i loops.21 20 !!---------------------------------------------------------------------- 22 21 USE oce ! ocean dynamics and active tracers … … 151 150 152 151 !CDIR PARALLEL DO PRIVATE( zdk1t, zdk1s, zftu, zfsu ) 153 !$OMP PARALLEL DO PRIVATE( zdk1t, zdk1s, zftu, zfsu )154 152 ! ! =============== 155 153 DO jk = 1, jpkm1 ! Horizontal slab -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/tranxt.F90
r708 r811 168 168 ! ! =============== 169 169 ! Update tracers on open boundaries. 170 CALL Agrif_tra ( kt )170 CALL Agrif_tra 171 171 ! ! =============== 172 172 DO jk = 1, jpkm1 ! Horizontal slab -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/trazdf.F90
r708 r811 19 19 USE trazdf_exp ! vertical diffusion: explicit (tra_zdf_exp routine) 20 20 USE trazdf_imp ! vertical diffusion: implicit (tra_zdf_imp routine) 21 USE trazdf_imp_jki ! vertical diffusion implicit (tra_zdf_imp_jki routine)22 21 23 22 USE ldftra_oce ! ocean active tracers: lateral physics … … 90 89 CALL prt_ctl( tab3d_1=ta, clinfo1=' zdf1 - Ta: ', mask1=tmask, & 91 90 & tab3d_2=sa, clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) 92 CALL tra_zdf_imp_jki( kt, r2dt )93 CALL prt_ctl( tab3d_1=ta, clinfo1=' zdf2 - Ta: ', mask1=tmask, &94 & tab3d_2=sa, clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' )95 91 96 92 CASE ( 0 ) ! explicit scheme … … 102 98 ENDIF 103 99 104 CASE ( 1 ) ! implicit scheme (k-j-i loop)100 CASE ( 1 ) ! implicit scheme 105 101 CALL tra_zdf_imp ( kt, r2dt ) 106 IF( l_trdtra ) THEN ! save the vertical diffusive trends for further diagnostics107 DO jk = 1, jpkm1108 ztrdt(:,:,jk) = ( ( ta(:,:,jk) - tb(:,:,jk) ) / r2dt(jk) ) - ztrdt(:,:,jk)109 ztrds(:,:,jk) = ( ( sa(:,:,jk) - sb(:,:,jk) ) / r2dt(jk) ) - ztrds(:,:,jk)110 END DO111 CALL trd_mod( ztrdt, ztrds, jptra_trd_zdf, 'TRA', kt )112 ENDIF113 114 CASE ( 2 ) ! implicit scheme (j-k-i loop)115 CALL tra_zdf_imp_jki( kt, r2dt )116 102 IF( l_trdtra ) THEN ! save the vertical diffusive trends for further diagnostics 117 103 DO jk = 1, jpkm1 … … 137 123 !! ** Purpose : Choose the vertical mixing scheme 138 124 !! 139 !! ** Method : Set nzdf from ln_zdfexp and 'key_mpp_omp'.125 !! ** Method : Set nzdf from ln_zdfexp 140 126 !! nzdf = 0 explicit (time-splitting) scheme (ln_zdfexp=T) 141 127 !! = 1 implicit (euler backward) scheme (ln_zdfexp=F) 142 !! = 2 implicit (euler backward) scheme with j-k-i loops143 !! (ln_zdfexp=T and 'key_mpp_omp')144 128 !! NB: rotation of lateral mixing operator or TKE or KPP scheme, 145 129 !! the implicit scheme is required. … … 169 153 ENDIF 170 154 171 ! NEC autotasking / OpenMP172 #if defined key_mpp_omp173 IF( nzdf == 1 ) nzdf = 2 ! j-k-i loop174 #endif175 176 155 ! Test: esopa 177 156 IF( lk_esopa ) nzdf = -1 ! All schemes used … … 184 163 IF( nzdf == 0 ) WRITE(numout,*) ' Explicit time-splitting scheme' 185 164 IF( nzdf == 1 ) WRITE(numout,*) ' Implicit (euler backward) scheme' 186 IF( nzdf == 2 ) WRITE(numout,*) ' Implicit (euler backward) scheme with j-k-i loops'187 165 ENDIF 188 166 -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/trazdf_exp.F90
r699 r811 85 85 IF( kt == nit000 ) THEN 86 86 IF(lwp) WRITE(numout,*) 87 IF(lwp) WRITE(numout,*) 'tra_zdf_exp : explicit vertical mixing (j-k-i loops)'87 IF(lwp) WRITE(numout,*) 'tra_zdf_exp : explicit vertical mixing' 88 88 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 89 89 ENDIF -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/trazdf_imp.F90
r699 r811 17 17 !! tra_zdf_imp : Update the tracer trend with the diagonal vertical 18 18 !! part of the mixing tensor. 19 !! Vector optimization, use k-j-i loops.20 19 !!---------------------------------------------------------------------- 21 20 !! * Modules used … … 108 107 IF( kt == nit000 ) THEN 109 108 IF(lwp)WRITE(numout,*) 110 IF(lwp)WRITE(numout,*) 'tra_zdf_imp : implicit vertical mixing (k-j-i loops)'109 IF(lwp)WRITE(numout,*) 'tra_zdf_imp : implicit vertical mixing' 111 110 IF(lwp)WRITE(numout,*) '~~~~~~~~~~~ ' 112 111 zavi = 0.e0 ! avoid warning at compilation phase when lk_ldfslp=F -
branches/dev_001_SBC/NEMO/OPA_SRC/TRA/zpshde.F90
r699 r811 130 130 131 131 ! Interpolation of T and S at the last ocean level 132 # if defined key_vectopt_loop && ! defined key_mpp_omp132 # if defined key_vectopt_loop 133 133 jj = 1 134 134 DO ji = 1, jpij-jpi ! vector opt. (forced unrolled) … … 193 193 pgsv(ji,jj) = vmask(ji,jj,1) * ( psal(ji,jj+1,ikv) - zsj(ji,jj) ) 194 194 ENDIF 195 # if ! defined key_vectopt_loop || defined key_mpp_omp195 # if ! defined key_vectopt_loop 196 196 END DO 197 197 # endif … … 205 205 206 206 ! Gradient of density at the last level 207 # if defined key_vectopt_loop && ! defined key_mpp_omp207 # if defined key_vectopt_loop 208 208 jj = 1 209 209 DO ji = 1, jpij-jpi ! vector opt. (forced unrolled) … … 226 226 pgrv(ji,jj) = vmask(ji,jj,1) * ( prd(ji,jj+1,ikv) - zrj(ji,jj) ) 227 227 ENDIF 228 # if ! defined key_vectopt_loop || defined key_mpp_omp228 # if ! defined key_vectopt_loop 229 229 END DO 230 230 # endif -
branches/dev_001_SBC/NEMO/OPA_SRC/TRD/trdmld_rst.F90
r699 r811 46 46 !!-------------------------------------------------------------------------------- 47 47 48 IF( kt == nitrst-1 ) THEN 49 IF( nitrst > 1.0e9 ) THEN 50 WRITE(clkt,*) nitrst 51 ELSE 52 WRITE(clkt,'(i8.8)') nitrst 48 ! to get better performances with NetCDF format: 49 ! we open and define the ocean restart_mld file one time step before writing the data (-> at nitrst - 1) 50 ! except if we write ocean restart_mld files every time step or if an ocean restart_mld file was writen at nitend - 1 51 IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. MOD( nitend - 1, nstock ) == 0 ) ) THEN 52 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 53 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 54 ELSE ; WRITE(clkt, '(i8.8)') nitrst 53 55 ENDIF 56 ! create the file 54 57 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_restart_mld" 55 IF(lwp) WRITE(numout,*) ' open ocean restart_mld NetCDF file: '//clname 58 IF(lwp) THEN 59 WRITE(numout,*) 60 SELECT CASE ( jprstlib ) 61 CASE ( jprstdimg ) ; WRITE(numout,*) ' open ocean restart_mld binary file: '//clname 62 CASE DEFAULT ; WRITE(numout,*) ' open ocean restart_mld NetCDF file: '//clname 63 END SELECT 64 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt,' date= ', ndastp 65 ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp 66 ENDIF 67 ENDIF 68 56 69 CALL iom_open( clname, nummldw, ldwrt = .TRUE., kiolib = jprstlib ) 57 70 ENDIF … … 59 72 IF( kt == nitrst .AND. lwp ) THEN 60 73 WRITE(numout,*) 61 WRITE(numout,*) 'trdmld_rst: output for ML diags. restart, with trd_mld_rst_write routine '74 WRITE(numout,*) 'trdmld_rst: output for ML diags. restart, with trd_mld_rst_write routine kt =', kt 62 75 WRITE(numout,*) '~~~~~~~~~~' 63 76 WRITE(numout,*) … … 81 94 CALL iom_rstput( kt, nitrst, nummldw, 'tml_sumb' , tml_sumb ) 82 95 DO jk = 1, jpltrd 83 IF( jk < 10 ) THEN 84 WRITE(charout,FMT="('tmltrd_csum_ub_', I1)") jk 85 ELSE 86 WRITE(charout,FMT="('tmltrd_csum_ub_', I2)") jk 96 IF( jk < 10 ) THEN ; WRITE(charout,FMT="('tmltrd_csum_ub_', I1)") jk 97 ELSE ; WRITE(charout,FMT="('tmltrd_csum_ub_', I2)") jk 87 98 ENDIF 88 99 CALL iom_rstput( kt, nitrst, nummldw, charout, tmltrd_csum_ub(:,:,jk) ) … … 94 105 CALL iom_rstput( kt, nitrst, nummldw, 'sml_sumb' , sml_sumb ) 95 106 DO jk = 1, jpltrd 96 IF( jk < 10 ) THEN 97 WRITE(charout,FMT="('smltrd_csum_ub_', I1)") jk 98 ELSE 99 WRITE(charout,FMT="('smltrd_csum_ub_', I2)") jk 107 IF( jk < 10 ) THEN ; WRITE(charout,FMT="('smltrd_csum_ub_', I1)") jk 108 ELSE ; WRITE(charout,FMT="('smltrd_csum_ub_', I2)") jk 100 109 ENDIF 101 110 CALL iom_rstput( kt, nitrst, nummldw, charout , smltrd_csum_ub(:,:,jk) ) -
branches/dev_001_SBC/NEMO/OPA_SRC/ZDF/zdfbfr.F90
r699 r811 80 80 81 81 CASE( 0 ) ! no-slip boundary condition 82 # if defined key_vectopt_loop && ! defined key_mpp_omp82 # if defined key_vectopt_loop 83 83 jj = 1 84 84 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) … … 93 93 avmu(ji,jj,ikbu) = 2. * avmu(ji,jj,ikbum1) 94 94 avmv(ji,jj,ikbv) = 2. * avmv(ji,jj,ikbvm1) 95 # if ! defined key_vectopt_loop || defined key_mpp_omp95 # if ! defined key_vectopt_loop 96 96 END DO 97 97 # endif … … 99 99 100 100 CASE( 1 ) ! linear botton friction 101 # if defined key_vectopt_loop && ! defined key_mpp_omp101 # if defined key_vectopt_loop 102 102 jj = 1 103 103 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) … … 110 110 avmu(ji,jj,ikbu) = bfri1 * fse3uw(ji,jj,ikbu) 111 111 avmv(ji,jj,ikbv) = bfri1 * fse3vw(ji,jj,ikbv) 112 # if ! defined key_vectopt_loop || defined key_mpp_omp112 # if ! defined key_vectopt_loop 113 113 END DO 114 114 # endif … … 116 116 117 117 CASE( 2 ) ! quadratic botton friction 118 # if defined key_vectopt_loop && ! defined key_mpp_omp118 # if defined key_vectopt_loop 119 119 jj = 1 120 120 !CDIR NOVERRCHK … … 142 142 avmu(ji,jj,ikbu) = bfri2 * zecu * fse3uw(ji,jj,ikbu) 143 143 avmv(ji,jj,ikbv) = bfri2 * zecv * fse3vw(ji,jj,ikbv) 144 # if ! defined key_vectopt_loop || defined key_mpp_omp144 # if ! defined key_vectopt_loop 145 145 END DO 146 146 # endif … … 148 148 149 149 CASE( 3 ) ! free-slip boundary condition 150 # if defined key_vectopt_loop && ! defined key_mpp_omp150 # if defined key_vectopt_loop 151 151 jj = 1 152 152 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) … … 159 159 avmu(ji,jj,ikbu) = 0.e0 160 160 avmv(ji,jj,ikbv) = 0.e0 161 # if ! defined key_vectopt_loop || defined key_mpp_omp161 # if ! defined key_vectopt_loop 162 162 END DO 163 163 # endif -
branches/dev_001_SBC/NEMO/OPA_SRC/ZDF/zdfevd.F90
r699 r811 79 79 DO jk = 1, jpkm1 ! Horizontal slab 80 80 ! ! =============== 81 # if defined key_vectopt_loop && ! defined key_mpp_omp81 # if defined key_vectopt_loop 82 82 !!! WHERE( rn2(:,:,jk) <= -1.e-12 ) avt(:,:,jk) = tmask(:,:,jk) * avevd ! agissant sur T SEUL! 83 83 jj = 1 ! big loop forced … … 129 129 ! ! =============== 130 130 !!! WHERE( rn2(:,:,jk) <= -1.e-12 ) avt(:,:,jk) = tmask(:,:,jk) * avevd ! agissant sur T SEUL! 131 # if defined key_vectopt_loop && ! defined key_mpp_omp131 # if defined key_vectopt_loop 132 132 jj = 1 ! big loop forced 133 133 DO ji = 1, jpij -
branches/dev_001_SBC/NEMO/OPA_SRC/ZDF/zdfmxl.F90
r699 r811 44 44 45 45 CONTAINS 46 47 # if defined key_mpp_omp48 !!----------------------------------------------------------------------49 !! 'key_mpp_omp' j-k-i loop (j-slab)50 !!----------------------------------------------------------------------51 52 SUBROUTINE zdf_mxl( kt )53 !!----------------------------------------------------------------------54 !! *** ROUTINE zdfmxl ***55 !!56 !! ** Purpose : Compute the turbocline depth and the mixed layer depth57 !! with a density criteria.58 !!59 !! ** Method : The turbocline depth is the depth at which the vertical60 !! eddy diffusivity coefficient (resulting from the vertical physics61 !! alone, not the isopycnal part, see trazdf.F) fall below a given62 !! value defined locally (avt_c here taken equal to 5 cm/s2)63 !!64 !! ** Action :65 !!66 !!----------------------------------------------------------------------67 !! * Arguments68 INTEGER, INTENT( in ) :: kt ! ocean time-step index69 70 !! * Local declarations71 INTEGER :: ji, jj, jk ! dummy loop indices72 INTEGER :: ik ! temporary integer73 INTEGER, DIMENSION(jpi,jpj) :: &74 imld ! temporary workspace75 !!----------------------------------------------------------------------76 77 IF( kt == nit000 ) THEN78 IF(lwp) WRITE(numout,*)79 IF(lwp) WRITE(numout,*) 'zdf_mxl : mixed layer depth, j-k-i loops'80 IF(lwp) WRITE(numout,*) '~~~~~~~'81 ENDIF82 83 ! ! ===============84 DO jj = 1, jpj ! Vertical slab85 ! ! ===============86 87 ! 1. Turbocline depth88 ! -------------------89 ! last w-level at which avt<avt_c (starting from the bottom jk=jpk)90 ! (since avt(.,.,jpk)=0, we have jpk=< imld =< 2 )91 DO jk = jpk, 2, -192 DO ji = 1, jpi93 IF( avt(ji,jj,jk) < avt_c ) imld(ji,jj) = jk94 END DO95 END DO96 97 ! Turbocline depth and sub-turbocline temperature98 DO ji = 1, jpi99 ik = imld(ji,jj)100 hmld (ji,jj) = fsdepw(ji,jj,ik) * tmask(ji,jj,1)101 END DO102 103 !!gm idea104 !!105 !!gm DO jk = jpk, 2, -1106 !!gm DO ji = 1, jpi107 !!gm IF( avt(ji,jj,jk) < avt_c ) hmld(ji,jj) = fsdepw(ji,jj,jk) * tmask(ji,jj,1)108 !!gm END DO109 !!gm END DO110 !!gm111 112 ! 2. Mixed layer depth113 ! --------------------114 ! Initialization to the number of w ocean point mbathy115 nmln(:,jj) = mbathy(:,jj)116 117 ! Last w-level at which rhop>=rho surf+rho_c (starting from jpk-1)118 ! (rhop defined at t-point, thus jk-1 for w-level just above)119 DO jk = jpkm1, 2, -1120 DO ji = 1, jpi121 IF( rhop(ji,jj,jk) > rhop(ji,jj,1) + rho_c ) nmln(ji,jj) = jk122 END DO123 END DO124 125 ! Mixed layer depth126 DO ji = 1, jpi127 ik = nmln(ji,jj)128 hmlp (ji,jj) = fsdepw(ji,jj,ik) * tmask(ji,jj,1)129 hmlpt(ji,jj) = fsdept(ji,jj,ik-1)130 END DO131 ! ! ===============132 END DO ! End of slab133 ! ! ===============134 135 IF(ln_ctl) CALL prt_ctl( tab2d_1=REAL(nmln,wp), clinfo1=' nmln : ', tab2d_2=hmld, clinfo2=' hmld : ', ovlap=1 )136 137 END SUBROUTINE zdf_mxl138 139 # else140 !!----------------------------------------------------------------------141 !! Default option : k-j-i loop142 !!----------------------------------------------------------------------143 46 144 47 SUBROUTINE zdf_mxl( kt ) … … 237 140 238 141 END SUBROUTINE zdf_mxl 239 #endif240 142 241 143 !!====================================================================== -
branches/dev_001_SBC/NEMO/OPA_SRC/ZDF/zdftke.F90
r762 r811 43 43 44 44 PUBLIC zdf_tke ! routine called in step module 45 PUBLIC zdf_tke_init ! routine also called in zdftke_jki module46 PUBLIC tke_rst ! routine also called in zdftke_jki module47 45 48 46 LOGICAL , PUBLIC, PARAMETER :: lk_zdftke = .TRUE. !: TKE vertical mixing flag -
branches/dev_001_SBC/NEMO/OPA_SRC/eosbn2.F90
r703 r811 444 444 DO jj = 1, jpjm1 445 445 !CDIR NOVERRCHK 446 #if defined key_mpp_omp447 DO ji = 1, jpim1448 #else449 446 DO ji = 1, fs_jpim1 ! vector opt. 450 #endif451 447 zws(ji,jj) = SQRT( ABS( psal(ji,jj) ) ) 452 448 END DO … … 455 451 DO jj = 1, jpjm1 ! Horizontal slab 456 452 ! ! =============== 457 #if defined key_mpp_omp458 DO ji = 1, jpim1459 #else460 453 DO ji = 1, fs_jpim1 ! vector opt. 461 #endif462 454 zmask = tmask(ji,jj,1) ! land/sea bottom mask = surf. mask 463 455 … … 508 500 DO jj = 1, jpjm1 ! Horizontal slab 509 501 ! ! =============== 510 #if defined key_mpp_omp511 DO ji = 1, jpim1512 #else513 502 DO ji = 1, fs_jpim1 ! vector opt. 514 #endif515 503 prd(ji,jj) = ( 0.0285 - ralpha * ptem(ji,jj) ) * tmask(ji,jj,1) 516 504 END DO … … 524 512 DO jj = 1, jpjm1 ! Horizontal slab 525 513 ! ! =============== 526 #if defined key_mpp_omp527 DO ji = 1, jpim1528 #else529 514 DO ji = 1, fs_jpim1 ! vector opt. 530 #endif531 515 prd(ji,jj) = ( rbeta * psal(ji,jj) - ralpha * ptem(ji,jj) ) * tmask(ji,jj,1) 532 516 END DO -
branches/dev_001_SBC/NEMO/OPA_SRC/par_oce.F90
r699 r811 219 219 #endif 220 220 221 #if defined key_mpp_omp222 LOGICAL, PUBLIC, PARAMETER :: lk_jki = .TRUE. !: j-k-i loop flag223 #else224 LOGICAL, PUBLIC, PARAMETER :: lk_jki = .FALSE. !: k-j-i loop flag225 #endif226 227 221 !!====================================================================== 228 222 END MODULE par_oce -
branches/dev_001_SBC/NEMO/OPA_SRC/restart.F90
r762 r811 63 63 !!---------------------------------------------------------------------- 64 64 ! 65 IF( kt == nit000 ) THEN ! default initialization, to do: should be read in the namelist... 66 nitrst = nitend ! to do: should be read in the namelist in a cleaver way... 67 lrst_oce = .FALSE. 68 ENDIF 69 70 IF ( kt == nitrst-1 .AND. lrst_oce ) THEN 71 CALL ctl_stop( 'rst_opn: we cannot create an ocean restart at every time step', & 72 & 'if the run has more than one time step!!!' ) 73 numrow = 0 74 ELSEIF( kt == nitrst-1 .OR. nitend == nit000 ) THEN ! beware if model runs only one time step 75 ! beware of the format used to write kt (default is i8.8, that should be large enough) 76 IF( nitrst > 1.0e9 ) THEN 77 WRITE(clkt,*) nitrst 78 ELSE 79 WRITE(clkt,'(i8.8)') nitrst 65 IF( kt == nit000 ) THEN ! default definitions 66 lrst_oce = .FALSE. 67 nitrst = nitend 68 ENDIF 69 IF( MOD( kt - 1, nstock ) == 0 ) THEN 70 ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 71 nitrst = kt + nstock - 1 ! define the next value of nitrst for restart writing 72 IF( nitrst > nitend ) nitrst = nitend ! make sure we write a restart at the end of the run 73 ENDIF 74 75 ! to get better performances with NetCDF format: 76 ! we open and define the ocean restart file one time step before writing the data (-> at nitrst - 1) 77 ! except if we write ocean restart files every time step or if an ocean restart file was writen at nitend - 1 78 IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN 79 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 80 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 81 ELSE ; WRITE(clkt, '(i8.8)') nitrst 80 82 ENDIF 81 83 ! create the file … … 84 86 WRITE(numout,*) 85 87 SELECT CASE ( jprstlib ) 86 CASE ( jpnf90 ) 87 WRITE(numout,*) ' open ocean restart.output NetCDF file: '//clname 88 CASE ( jprstdimg ) 89 WRITE(numout,*) ' open ocean restart.output binary file: '//clname 88 CASE ( jprstdimg ) ; WRITE(numout,*) ' open ocean restart binary file: '//clname 89 CASE DEFAULT ; WRITE(numout,*) ' open ocean restart NetCDF file: '//clname 90 90 END SELECT 91 IF( kt == nitrst-1 ) THEN 92 WRITE(numout,*) ' kt = nitrst - 1 = ', kt,' date= ', ndastp 93 ELSE 94 WRITE(numout,*) ' kt = ', kt,' date= ', ndastp 91 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt,' date= ', ndastp 92 ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp 95 93 ENDIF 96 94 ENDIF … … 114 112 INTEGER, INTENT(in) :: kt ! ocean time-step 115 113 !!---------------------------------------------------------------------- 114 115 IF( kt == nitrst ) THEN 116 IF(lwp) WRITE(numout,*) 117 IF(lwp) WRITE(numout,*) 'rst_write : write oce restart file kt =', kt 118 IF(lwp) WRITE(numout,*) '~~~~~~~' 119 ENDIF 116 120 117 121 ! calendar control -
branches/dev_001_SBC/NEMO/OPA_SRC/step.F90
r709 r811 84 84 USE zdfbfr ! bottom friction (zdf_bfr routine) 85 85 USE zdftke ! TKE vertical mixing (zdf_tke routine) 86 USE zdftke_jki ! TKE vertical mixing (zdf_tke routine)87 86 USE zdfkpp ! KPP vertical mixing (zdf_kpp routine) 88 87 USE zdfddm ! double diffusion mixing (zdf_ddm routine) … … 210 209 ! ! Vertical eddy viscosity and diffusivity coefficients 211 210 IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz 212 #if defined key_mpp_omp 213 IF( lk_zdftke ) CALL zdf_tke_jki( kstp ) ! TKE closure scheme for Kz - j-k-i loops 214 #else 211 215 212 IF( lk_zdftke ) CALL zdf_tke( kstp ) ! TKE closure scheme for Kz 216 #endif 213 217 214 IF( lk_zdfkpp ) CALL zdf_kpp( kstp ) ! KPP closure scheme for Kz 218 215 … … 275 272 CALL tra_ldf ( kstp ) ! lateral mixing 276 273 #if defined key_agrif 277 IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra ( kstp )! tracers sponge274 IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra ! tracers sponge 278 275 #endif 279 276 CALL tra_zdf ( kstp ) ! vertical mixing … … 306 303 CALL dyn_ldf( kstp ) ! lateral mixing 307 304 #if defined key_agrif 308 IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_dyn ( kstp )! momemtum sponge305 IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_dyn ! momemtum sponge 309 306 #endif 310 307 CALL dyn_hpg( kstp ) ! horizontal gradient of Hydrostatic pressure -
branches/dev_001_SBC/NEMO/TOP_SRC/initrc.F90
r760 r811 25 25 USE trcini 26 26 USE prtctl_trc ! Print control passive tracers (prt_ctl_trc_init routine) 27 USE lib_mpp ! distributed memory computing 27 28 28 29 IMPLICIT NONE -
branches/dev_001_SBC/NEMO/TOP_SRC/trcrst.F90
r760 r811 335 335 ENDDO 336 336 #endif 337 trb(:,:,:,:) = trn(:,:,:,:) 337 !CT comment the line below which doesn't ensure 338 !CT restartability of the GYRE_LOBSTER configuration 339 !CT trb(:,:,:,:) = trn(:,:,:,:) 338 340 339 341 CALL iom_close( numrtr )
Note: See TracChangeset
for help on using the changeset viewer.