Changeset 3680 for branches/2012/dev_MERGE_2012/NEMOGCM/NEMO
- Timestamp:
- 2012-11-27T15:42:24+01:00 (11 years ago)
- Location:
- branches/2012/dev_MERGE_2012/NEMOGCM/NEMO
- Files:
-
- 18 deleted
- 99 edited
- 10 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_2/limrhg_2.F90
r3625 r3680 32 32 USE oce , ONLY : snwice_mass, snwice_mass_b 33 33 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 34 #if defined key_agrif 35 USE agrif_lim2_interp ! nesting 36 #endif 34 37 35 38 IMPLICIT NONE … … 148 151 zpice(:,:) = ssh_m(:,:) 149 152 ENDIF 153 #if defined key_agrif 154 ! load the boundary value of velocity in special array zuive and zvice 155 CALL agrif_rhg_lim2_load 156 #endif 150 157 151 158 ! Ice mass, ice strength, and wind stress at the center | … … 552 559 CALL lbc_lnk( zv_n(:,1:jpj), 'I', -1. ) 553 560 561 #if defined key_agrif 562 ! copy the boundary value from u_ice_nst and v_ice_nst to u_ice and v_ice 563 ! before next interations 564 CALL agrif_rhg_lim2(zu_n,zv_n) 565 #endif 566 554 567 ! Test of Convergence 555 568 DO jj = k_j1+1 , k_jpj-1 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_2/limtrp_2.F90
r3294 r3680 28 28 USE lib_mpp ! MPP library 29 29 USE wrk_nemo ! work arrays 30 # if defined key_agrif 31 USE agrif_lim2_interp ! nesting 32 # endif 30 33 31 34 IMPLICIT NONE … … 80 83 81 84 IF( kt == nit000 ) CALL lim_trp_init_2 ! Initialization (first time-step only) 85 86 # if defined key_agrif 87 CALL agrif_trp_lim2_load ! First interpolation 88 # endif 82 89 83 90 zsm(:,:) = area(:,:) … … 269 276 ENDIF 270 277 ! 278 # if defined key_agrif 279 CALL agrif_trp_lim2 ! Fill boundaries of the fine grid 280 # endif 281 ! 271 282 CALL wrk_dealloc( jpi, jpj, zui_u , zvi_v , zsm, zs0ice, zs0sn , zs0a, zs0c0 , zs0c1 , zs0c2 , zs0st ) 272 283 ! -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90
r3625 r3680 8 8 !! - ! 2008-11 (M. Vancoppenolle, S. Bouillon, Y. Aksenov) add surface tilt in ice rheolohy 9 9 !! 3.3 ! 2009-05 (G.Garric) addition of the lim2_evp cas 10 !! 4.0 ! 2011-01 (A Porter) dynamical allocation 10 !! 3.4 ! 2011-01 (A. Porter) dynamical allocation 11 !! 3.5 ! 2012-08 (R. Benshila) AGRIF 11 12 !!---------------------------------------------------------------------- 12 13 #if defined key_lim3 || ( defined key_lim2 && ! defined key_lim2_vp ) … … 37 38 USE prtctl ! Print control 38 39 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 40 #if defined key_agrif && defined key_lim2 41 USE agrif_lim2_interp 42 #endif 39 43 40 44 IMPLICIT NONE … … 168 172 at_i(:,:) = 1. - frld(:,:) 169 173 #endif 174 #if defined key_agrif && defined key_lim2 175 CALL agrif_rhg_lim2_load ! First interpolation of coarse values 176 #endif 170 177 ! 171 178 !------------------------------------------------------------------------------! … … 510 517 511 518 CALL lbc_lnk( u_ice(:,:), 'U', -1. ) 519 #if defined key_agrif 520 CALL agrif_rhg_lim2( jter, nevp, 'U' ) 521 #endif 512 522 513 523 !CDIR NOVERRCHK … … 535 545 536 546 CALL lbc_lnk( v_ice(:,:), 'V', -1. ) 547 #if defined key_agrif 548 CALL agrif_rhg_lim2( jter, nevp, 'V' ) 549 #endif 537 550 538 551 ELSE … … 561 574 562 575 CALL lbc_lnk( v_ice(:,:), 'V', -1. ) 576 #if defined key_agrif 577 CALL agrif_rhg_lim2( jter, nevp , 'V' ) 578 #endif 563 579 564 580 !CDIR NOVERRCHK … … 589 605 590 606 CALL lbc_lnk( u_ice(:,:), 'U', -1. ) 607 #if defined key_agrif 608 CALL agrif_rhg_lim2( jter, nevp, 'U' ) 609 #endif 591 610 592 611 ENDIF … … 629 648 CALL lbc_lnk( u_ice(:,:), 'U', -1. ) 630 649 CALL lbc_lnk( v_ice(:,:), 'V', -1. ) 650 #if defined key_agrif 651 CALL agrif_rhg_lim2( nevp , nevp, 'U' ) 652 CALL agrif_rhg_lim2( nevp , nevp, 'V' ) 653 #endif 631 654 632 655 DO jj = k_j1+1, k_jpj-1 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/NST_SRC/agrif2model.F90
r2528 r3680 5 5 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 6 6 !!---------------------------------------------------------------------- 7 SUBROUTINE Agrif2Model 8 !!--------------------------------------------- 9 !! *** ROUTINE Agrif2Model *** 10 !!--------------------------------------------- 11 END SUBROUTINE Agrif2model 7 12 8 13 SUBROUTINE Agrif_Set_numberofcells(Agrif_Gr) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/NST_SRC/agrif_oce.F90
r3294 r3680 25 25 26 26 ! !!! OLD namelist names 27 INTEGER , PUBLIC :: nbcline = 0 !: update counter 27 28 INTEGER , PUBLIC :: nbclineupdate !: update frequency 28 29 REAL(wp), PUBLIC :: visc_tra !: sponge coeff. for tracers -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/NST_SRC/agrif_opa_sponge.F90
r3294 r3680 1 #define SPONGE 1 #define SPONGE && define SPONGE_TOP 2 2 3 3 Module agrif_opa_sponge … … 13 13 PRIVATE 14 14 15 PUBLIC Agrif_Sponge_Tra, Agrif_Sponge_Dyn, interptsn, interpun, interpvn 16 15 PUBLIC Agrif_Sponge, Agrif_Sponge_Tra, Agrif_Sponge_Dyn, interptsn, interpun, interpvn 16 17 !! * Substitutions 18 # include "domzgr_substitute.h90" 17 19 !!---------------------------------------------------------------------- 18 20 !! NEMO/NST 3.3 , NEMO Consortium (2010) … … 27 29 !! *** ROUTINE Agrif_Sponge_Tra *** 28 30 !!--------------------------------------------- 29 #include "domzgr_substitute.h90"30 31 !! 31 32 INTEGER :: ji,jj,jk,jn 32 INTEGER :: spongearea33 33 REAL(wp) :: timecoeff 34 34 REAL(wp) :: ztsa, zabe1, zabe2, zbtr 35 REAL(wp), POINTER, DIMENSION(:,: ) :: localviscsponge36 35 REAL(wp), POINTER, DIMENSION(:,: ) :: ztu, ztv 37 36 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztab … … 39 38 40 39 #if defined SPONGE 41 CALL wrk_alloc( jpi, jpj, localviscsponge,ztu, ztv )40 CALL wrk_alloc( jpi, jpj, ztu, ztv ) 42 41 CALL wrk_alloc( jpi, jpj, jpk, jpts, ztab, tsbdiff ) 43 42 … … 52 51 tsbdiff(:,:,:,:) = tsb(:,:,:,:) - ztab(:,:,:,:) 53 52 54 spongearea = 2 + 2 * Agrif_irhox() 55 56 localviscsponge = 0. 57 58 IF (.NOT. spongedoneT) THEN 59 spe1ur(:,:) = 0. 60 spe2vr(:,:) = 0. 61 62 IF ((nbondi == -1).OR.(nbondi == 2)) THEN 63 DO ji = 2, spongearea 64 localviscsponge(ji,:) = visc_tra * (spongearea-ji)/real(spongearea-2) 65 ENDDO 66 67 spe1ur(2:spongearea-1,:)=0.5 * (localviscsponge(2:spongearea-1,:) + localviscsponge(3:spongearea,:)) & 68 * e2u(2:spongearea-1,:) / e1u(2:spongearea-1,:) 69 70 spe2vr(2:spongearea,1:jpjm1) = 0.5 * (localviscsponge(2:spongearea,1:jpjm1) + & 71 localviscsponge(2:spongearea,2:jpj)) & 72 * e1v(2:spongearea,1:jpjm1) / e2v(2:spongearea,1:jpjm1) 73 ENDIF 74 75 IF ((nbondi == 1).OR.(nbondi == 2)) THEN 76 DO ji = nlci-spongearea + 1,nlci-1 77 localviscsponge(ji,:) = visc_tra * (ji - (nlci-spongearea+1))/real(spongearea-2) 78 ENDDO 79 80 spe1ur(nlci-spongearea + 1:nlci-2,:)=0.5 * (localviscsponge(nlci-spongearea + 1:nlci-2,:) + & 81 localviscsponge(nlci-spongearea + 2:nlci-1,:)) & 82 * e2u(nlci-spongearea + 1:nlci-2,:) / e1u(nlci-spongearea + 1:nlci-2,:) 83 84 spe2vr(nlci-spongearea + 1:nlci-1,1:jpjm1) = 0.5 * (localviscsponge(nlci-spongearea + 1:nlci-1,1:jpjm1) & 85 + localviscsponge(nlci-spongearea + 1:nlci-1,2:jpj)) & 86 * e1v(nlci-spongearea + 1:nlci-1,1:jpjm1) / e2v(nlci-spongearea + 1:nlci-1,1:jpjm1) 87 ENDIF 88 89 90 IF ((nbondj == -1).OR.(nbondj == 2)) THEN 91 DO jj = 2, spongearea 92 localviscsponge(:,jj) = visc_tra * (spongearea-jj)/real(spongearea-2) 93 ENDDO 94 95 spe1ur(1:jpim1,2:spongearea)=0.5 * (localviscsponge(1:jpim1,2:spongearea) + & 96 localviscsponge(2:jpi,2:spongearea)) & 97 * e2u(1:jpim1,2:spongearea) / e1u(1:jpim1,2:spongearea) 98 99 spe2vr(:,2:spongearea-1) = 0.5 * (localviscsponge(:,2:spongearea-1) + & 100 localviscsponge(:,3:spongearea)) & 101 * e1v(:,2:spongearea-1) / e2v(:,2:spongearea-1) 102 ENDIF 103 104 IF ((nbondj == 1).OR.(nbondj == 2)) THEN 105 DO jj = nlcj-spongearea + 1,nlcj-1 106 localviscsponge(:,jj) = visc_tra * (jj - (nlcj-spongearea+1))/real(spongearea-2) 107 ENDDO 108 109 spe1ur(1:jpim1,nlcj-spongearea + 1:nlcj-1)=0.5 * (localviscsponge(1:jpim1,nlcj-spongearea + 1:nlcj-1) + & 110 localviscsponge(2:jpi,nlcj-spongearea + 1:nlcj-1)) & 111 * e2u(1:jpim1,nlcj-spongearea + 1:nlcj-1) / e1u(1:jpim1,nlcj-spongearea + 1:nlcj-1) 112 113 spe2vr(:,nlcj-spongearea + 1:nlcj-2) = 0.5 * (localviscsponge(:,nlcj-spongearea + 1:nlcj-2) + & 114 localviscsponge(:,nlcj-spongearea + 2:nlcj-1)) & 115 * e1v(:,nlcj-spongearea + 1:nlcj-2) / e2v(:,nlcj-spongearea + 1:nlcj-2) 116 ENDIF 117 118 spbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:)) 119 120 spongedoneT = .TRUE. 121 ENDIF 53 CALL Agrif_Sponge 122 54 123 55 DO jn = 1, jpts … … 147 79 ENDDO 148 80 149 CALL wrk_dealloc( jpi, jpj, localviscsponge,ztu, ztv )81 CALL wrk_dealloc( jpi, jpj, ztu, ztv ) 150 82 CALL wrk_dealloc( jpi, jpj, jpk, jpts, ztab, tsbdiff ) 151 83 #endif … … 157 89 !! *** ROUTINE Agrif_Sponge_dyn *** 158 90 !!--------------------------------------------- 159 #include "domzgr_substitute.h90"160 91 !! 161 92 INTEGER :: ji,jj,jk 162 INTEGER :: spongearea163 93 REAL(wp) :: timecoeff 164 94 REAL(wp) :: ze2u, ze1v, zua, zva, zbtr 165 REAL(wp), POINTER, DIMENSION(:,:) :: localviscsponge166 95 REAL(wp), POINTER, DIMENSION(:,:,:) :: ubdiff, vbdiff 167 96 REAL(wp), POINTER, DIMENSION(:,:,:) :: rotdiff, hdivdiff … … 169 98 170 99 #if defined SPONGE 171 CALL wrk_alloc( jpi, jpj, localviscsponge )172 100 CALL wrk_alloc( jpi, jpj, jpk, ztab, ubdiff, vbdiff, rotdiff, hdivdiff ) 173 101 … … 180 108 Agrif_UseSpecialValue = .FALSE. 181 109 182 ubdiff(:,:,:) = ( ub(:,:,:) - ztab(:,:,:))*umask(:,:,:)110 ubdiff(:,:,:) = ( ub(:,:,:) - ztab(:,:,:) ) * umask(:,:,:) 183 111 184 112 ztab = 0.e0 … … 188 116 Agrif_UseSpecialValue = .FALSE. 189 117 190 vbdiff(:,:,:) = (vb(:,:,:) - ztab(:,:,:))*vmask(:,:,:) 191 192 spongearea = 2 + 2 * Agrif_irhox() 193 194 localviscsponge = 0. 195 196 IF (.NOT. spongedoneU) THEN 197 spe1ur2(:,:) = 0. 198 spe2vr2(:,:) = 0. 199 200 IF ((nbondi == -1).OR.(nbondi == 2)) THEN 201 DO ji = 2, spongearea 202 localviscsponge(ji,:) = visc_dyn * (spongearea-ji)/real(spongearea-2) 203 ENDDO 204 205 spe1ur2(2:spongearea-1,:)=0.5 * (localviscsponge(2:spongearea-1,:) + localviscsponge(3:spongearea,:)) 206 207 spe2vr2(2:spongearea,1:jpjm1) = 0.5 * (localviscsponge(2:spongearea,1:jpjm1) + & 208 localviscsponge(2:spongearea,2:jpj)) 209 ENDIF 210 211 IF ((nbondi == 1).OR.(nbondi == 2)) THEN 212 DO ji = nlci-spongearea + 1,nlci-1 213 localviscsponge(ji,:) = visc_dyn * (ji - (nlci-spongearea+1))/real(spongearea-2) 214 ENDDO 215 216 spe1ur2(nlci-spongearea + 1:nlci-2,:)=0.5 * (localviscsponge(nlci-spongearea + 1:nlci-2,:) + & 217 localviscsponge(nlci-spongearea + 2:nlci-1,:)) 218 219 spe2vr2(nlci-spongearea + 1:nlci-1,1:jpjm1) = 0.5 * (localviscsponge(nlci-spongearea + 1:nlci-1,1:jpjm1) & 220 + localviscsponge(nlci-spongearea + 1:nlci-1,2:jpj)) 221 ENDIF 222 223 224 IF ((nbondj == -1).OR.(nbondj == 2)) THEN 225 DO jj = 2, spongearea 226 localviscsponge(:,jj) = visc_dyn * (spongearea-jj)/real(spongearea-2) 227 ENDDO 228 229 spe1ur2(1:jpim1,2:spongearea)=0.5 * (localviscsponge(1:jpim1,2:spongearea) + & 230 localviscsponge(2:jpi,2:spongearea)) 231 232 spe2vr2(:,2:spongearea-1) = 0.5 * (localviscsponge(:,2:spongearea-1) + & 233 localviscsponge(:,3:spongearea)) 234 ENDIF 235 236 IF ((nbondj == 1).OR.(nbondj == 2)) THEN 237 DO jj = nlcj-spongearea + 1,nlcj-1 238 localviscsponge(:,jj) = visc_dyn * (jj - (nlcj-spongearea+1))/real(spongearea-2) 239 ENDDO 240 241 spe1ur2(1:jpim1,nlcj-spongearea + 1:nlcj-1)=0.5 * (localviscsponge(1:jpim1,nlcj-spongearea + 1:nlcj-1) + & 242 localviscsponge(2:jpi,nlcj-spongearea + 1:nlcj-1)) 243 244 spe2vr2(:,nlcj-spongearea + 1:nlcj-2) = 0.5 * (localviscsponge(:,nlcj-spongearea + 1:nlcj-2) + & 245 localviscsponge(:,nlcj-spongearea + 2:nlcj-1)) 246 ENDIF 247 248 spongedoneU = .TRUE. 249 250 spbtr3(:,:) = 1./( e1f(:,:) * e2f(:,:)) 251 ENDIF 252 253 IF (.NOT. spongedoneT) THEN 254 spbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:)) 255 ENDIF 256 257 DO jk=1,jpkm1 258 ubdiff(:,:,jk) = ubdiff(:,:,jk) * spe1ur2(:,:) 259 vbdiff(:,:,jk) = vbdiff(:,:,jk) * spe2vr2(:,:) 118 vbdiff(:,:,:) = ( vb(:,:,:) - ztab(:,:,:) ) * vmask(:,:,:) 119 120 CALL Agrif_Sponge 121 122 DO jk = 1,jpkm1 123 ubdiff(:,:,jk) = ubdiff(:,:,jk) * spe1ur2(:,:) 124 vbdiff(:,:,jk) = vbdiff(:,:,jk) * spe2vr2(:,:) 260 125 ENDDO 261 126 … … 272 137 DO ji = 2, jpim1 ! vector opt. 273 138 zbtr = spbtr2(ji,jj) / fse3t(ji,jj,jk) 274 hdivdiff(ji,jj,jk) = & 275 ( e2u(ji,jj)*fse3u(ji,jj,jk) * & 276 ubdiff(ji,jj,jk) - e2u(ji-1,jj )* & 277 fse3u(ji-1,jj ,jk) * ubdiff(ji-1,jj ,jk) & 278 + e1v(ji,jj)*fse3v(ji,jj,jk) * & 279 vbdiff(ji,jj,jk) - e1v(ji ,jj-1)* & 280 fse3v(ji ,jj-1,jk) * vbdiff(ji ,jj-1,jk) ) * zbtr 139 hdivdiff(ji,jj,jk) = ( e2u(ji ,jj ) * fse3u(ji ,jj ,jk) * ubdiff(ji ,jj ,jk) & 140 & - e2u(ji-1,jj ) * fse3u(ji-1,jj ,jk) * ubdiff(ji-1,jj ,jk) & 141 & + e1v(ji ,jj ) * fse3v(ji ,jj ,jk) * vbdiff(ji ,jj ,jk) & 142 & - e1v(ji ,jj-1) * fse3v(ji ,jj-1,jk) * vbdiff(ji ,jj-1,jk) ) * zbtr 281 143 END DO 282 144 END DO … … 286 148 zbtr = spbtr3(ji,jj) * fse3f(ji,jj,jk) 287 149 rotdiff(ji,jj,jk) = ( e2v(ji+1,jj ) * vbdiff(ji+1,jj ,jk) - e2v(ji,jj) * vbdiff(ji,jj,jk) & 288 & - e1u(ji ,jj+1) * ubdiff(ji ,jj+1,jk) + e1u(ji,jj) * ubdiff(ji,jj,jk) ) &289 & * fmask(ji,jj,jk) * zbtr150 & - e1u(ji ,jj+1) * ubdiff(ji ,jj+1,jk) + e1u(ji,jj) * ubdiff(ji,jj,jk) ) & 151 & * fmask(ji,jj,jk) * zbtr 290 152 END DO 291 153 END DO … … 298 160 DO jj = 2, jpjm1 299 161 DO ji = 2, jpim1 ! vector opt. 300 ze2u = rotdiff (ji,jj,jk)301 ze1v = hdivdiff(ji,jj,jk)302 162 ! horizontal diffusive trends 303 zua = - ( ze2u - rotdiff (ji,jj-1,jk)) / ( e2u(ji,jj) * fse3u(ji,jj,jk) ) & 304 + ( hdivdiff(ji+1,jj,jk) - ze1v & 305 ) / e1u(ji,jj) 306 307 zva = + ( ze2u - rotdiff (ji-1,jj,jk)) / ( e1v(ji,jj) * fse3v(ji,jj,jk) ) & 308 + ( hdivdiff(ji,jj+1,jk) - ze1v & 309 ) / e2v(ji,jj) 310 163 zua = - ( rotdiff (ji ,jj,jk) - rotdiff (ji,jj-1,jk) ) / ( e2u(ji,jj) * fse3u(ji,jj,jk) ) & 164 + ( hdivdiff(ji+1,jj,jk) - hdivdiff(ji,jj ,jk) ) / e1u(ji,jj) 165 166 zva = + ( rotdiff (ji,jj ,jk) - rotdiff (ji-1,jj,jk) ) / ( e1v(ji,jj) * fse3v(ji,jj,jk) ) & 167 + ( hdivdiff(ji,jj+1,jk) - hdivdiff(ji ,jj,jk) ) / e2v(ji,jj) 311 168 ! add it to the general momentum trends 312 169 ua(ji,jj,jk) = ua(ji,jj,jk) + zua … … 317 174 END DO ! End of slab 318 175 ! ! =============== 319 CALL wrk_dealloc( jpi, jpj, localviscsponge )320 176 CALL wrk_dealloc( jpi, jpj, jpk, ztab, ubdiff, vbdiff, rotdiff, hdivdiff ) 321 322 177 #endif 323 178 324 179 END SUBROUTINE Agrif_Sponge_dyn 325 180 181 SUBROUTINE Agrif_Sponge 182 !!--------------------------------------------- 183 !! *** ROUTINE Agrif_Sponge *** 184 !!--------------------------------------------- 185 INTEGER :: ji,jj,jk 186 INTEGER :: ispongearea, ilci, ilcj 187 REAL(wp) :: z1spongearea 188 REAL(wp), POINTER, DIMENSION(:,:) :: zlocalviscsponge 189 190 #if defined SPONGE || defined SPONGE_TOP 191 192 CALL wrk_alloc( jpi, jpj, zlocalviscsponge ) 193 194 ispongearea = 2 + 2 * Agrif_irhox() 195 ilci = nlci - ispongearea 196 ilcj = nlcj - ispongearea 197 z1spongearea = 1._wp / REAL( ispongearea - 2 ) 198 spbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:) ) 199 200 ! Tracers 201 IF( .NOT. spongedoneT ) THEN 202 zlocalviscsponge(:,:) = 0. 203 spe1ur(:,:) = 0. 204 spe2vr(:,:) = 0. 205 206 IF( (nbondi == -1) .OR. (nbondi == 2) ) THEN 207 DO ji = 2, ispongearea 208 zlocalviscsponge(ji,:) = visc_tra * ( ispongearea-ji ) * z1spongearea 209 ENDDO 210 spe1ur(2:ispongearea-1,: ) = 0.5 * ( zlocalviscsponge(2:ispongearea-1,: ) + zlocalviscsponge(3:ispongearea,: ) ) & 211 & * e2u(2:ispongearea-1,: ) / e1u(2:ispongearea-1,: ) 212 spe2vr(2:ispongearea ,1:jpjm1) = 0.5 * ( zlocalviscsponge(2:ispongearea ,1:jpjm1) + zlocalviscsponge(2:ispongearea,2:jpj) ) & 213 & * e1v(2:ispongearea ,1:jpjm1) / e2v(2:ispongearea ,1:jpjm1) 214 ENDIF 215 216 IF( (nbondi == 1) .OR. (nbondi == 2) ) THEN 217 DO ji = ilci+1,nlci-1 218 zlocalviscsponge(ji,:) = visc_tra * (ji - (ilci+1) ) * z1spongearea 219 ENDDO 220 221 spe1ur(ilci+1:nlci-2,: ) = 0.5 * ( zlocalviscsponge(ilci+1:nlci-2,:) + zlocalviscsponge(ilci+2:nlci-1,:) ) & 222 & * e2u(ilci+1:nlci-2,:) / e1u(ilci+1:nlci-2,:) 223 224 spe2vr(ilci+1:nlci-1,1:jpjm1) = 0.5 * ( zlocalviscsponge(ilci+1:nlci-1,1:jpjm1) + zlocalviscsponge(ilci+1:nlci-1,2:jpj ) ) & 225 & * e1v(ilci+1:nlci-1,1:jpjm1) / e2v(ilci+1:nlci-1,1:jpjm1) 226 ENDIF 227 228 IF( (nbondj == -1) .OR. (nbondj == 2) ) THEN 229 DO jj = 2, ispongearea 230 zlocalviscsponge(:,jj) = visc_tra * ( ispongearea-jj ) * z1spongearea 231 ENDDO 232 spe1ur(1:jpim1,2:ispongearea ) = 0.5 * ( zlocalviscsponge(1:jpim1,2:ispongearea) + zlocalviscsponge(2:jpi,2:ispongearea) ) & 233 & * e2u(1:jpim1,2:ispongearea) / e1u(1:jpim1,2:ispongearea) 234 235 spe2vr(: ,2:ispongearea-1) = 0.5 * ( zlocalviscsponge(:,2:ispongearea-1) + zlocalviscsponge(:,3:ispongearea) ) & 236 & * e1v(:,2:ispongearea-1) / e2v(:,2:ispongearea-1) 237 ENDIF 238 239 IF( (nbondj == 1) .OR. (nbondj == 2) ) THEN 240 DO jj = ilcj+1,nlcj-1 241 zlocalviscsponge(:,jj) = visc_tra * (jj - (ilcj+1) ) * z1spongearea 242 ENDDO 243 spe1ur(1:jpim1,ilcj+1:nlcj-1) = 0.5 * ( zlocalviscsponge(1:jpim1,ilcj+1:nlcj-1) + zlocalviscsponge(2:jpi,ilcj+1:nlcj-1) ) & 244 & * e2u(1:jpim1,ilcj+1:nlcj-1) / e1u(1:jpim1,ilcj+1:nlcj-1) 245 spe2vr(: ,ilcj+1:nlcj-2) = 0.5 * ( zlocalviscsponge(:,ilcj+1:nlcj-2 ) + zlocalviscsponge(:,ilcj+2:nlcj-1) ) & 246 & * e1v(:,ilcj+1:nlcj-2) / e2v(:,ilcj+1:nlcj-2) 247 ENDIF 248 spongedoneT = .TRUE. 249 ENDIF 250 251 ! Dynamics 252 IF( .NOT. spongedoneU ) THEN 253 zlocalviscsponge(:,:) = 0. 254 spe1ur2(:,:) = 0. 255 spe2vr2(:,:) = 0. 256 257 IF( (nbondi == -1) .OR. (nbondi == 2) ) THEN 258 DO ji = 2, ispongearea 259 zlocalviscsponge(ji,:) = visc_dyn * ( ispongearea-ji ) * z1spongearea 260 ENDDO 261 spe1ur2(2:ispongearea-1,: ) = 0.5 * ( zlocalviscsponge(2:ispongearea-1,: ) + zlocalviscsponge(3:ispongearea,: ) ) 262 spe2vr2(2:ispongearea ,1:jpjm1) = 0.5 * ( zlocalviscsponge(2:ispongearea ,1:jpjm1) + zlocalviscsponge(2:ispongearea,2:jpj) ) 263 ENDIF 264 265 IF( (nbondi == 1) .OR. (nbondi == 2) ) THEN 266 DO ji = ilci+1,nlci-1 267 zlocalviscsponge(ji,:) = visc_dyn * (ji - (ilci+1) ) * z1spongearea 268 ENDDO 269 spe1ur2(ilci+1:nlci-2,: ) = 0.5 * ( zlocalviscsponge(ilci+1:nlci-2,:) + zlocalviscsponge(ilci+2:nlci-1,:) ) 270 spe2vr2(ilci+1:nlci-1,1:jpjm1) = 0.5 * ( zlocalviscsponge(ilci+1:nlci-1,1:jpjm1) + zlocalviscsponge(ilci+1:nlci-1,2:jpj ) ) 271 ENDIF 272 273 IF( (nbondj == -1) .OR. (nbondj == 2) ) THEN 274 DO jj = 2, ispongearea 275 zlocalviscsponge(:,jj) = visc_dyn * ( ispongearea-jj ) * z1spongearea 276 ENDDO 277 spe1ur2(1:jpim1,2:ispongearea ) = 0.5 * ( zlocalviscsponge(1:jpim1,2:ispongearea) + zlocalviscsponge(2:jpi,2:ispongearea) ) 278 spe2vr2(: ,2:ispongearea-1) = 0.5 * ( zlocalviscsponge(:,2:ispongearea-1) + zlocalviscsponge(:,3:ispongearea) ) 279 ENDIF 280 281 IF( (nbondj == 1) .OR. (nbondj == 2) ) THEN 282 DO jj = ilcj+1,nlcj-1 283 zlocalviscsponge(:,jj) = visc_dyn * (jj - (ilcj+1) ) * z1spongearea 284 ENDDO 285 spe1ur2(1:jpim1,ilcj+1:nlcj-1) = 0.5 * ( zlocalviscsponge(1:jpim1,ilcj+1:nlcj-1) + zlocalviscsponge(2:jpi,ilcj+1:nlcj-1) ) 286 spe2vr2(: ,ilcj+1:nlcj-2) = 0.5 * ( zlocalviscsponge(:,ilcj+1:nlcj-2 ) + zlocalviscsponge(:,ilcj+2:nlcj-1) ) 287 ENDIF 288 spongedoneU = .TRUE. 289 spbtr3(:,:) = 1. / ( e1f(:,:) * e2f(:,:) ) 290 ENDIF 291 ! 292 CALL wrk_dealloc( jpi, jpj, zlocalviscsponge ) 293 ! 294 #endif 295 296 END SUBROUTINE Agrif_Sponge 297 326 298 SUBROUTINE interptsn(tabres,i1,i2,j1,j2,k1,k2,n1,n2) 327 299 !!--------------------------------------------- 328 300 !! *** ROUTINE interptsn *** 329 301 !!--------------------------------------------- 330 # include "domzgr_substitute.h90"331 332 302 INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2,n1,n2 333 303 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres … … 341 311 !! *** ROUTINE interpun *** 342 312 !!--------------------------------------------- 343 # include "domzgr_substitute.h90"344 345 313 INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2 346 314 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: tabres … … 354 322 !! *** ROUTINE interpvn *** 355 323 !!--------------------------------------------- 356 # include "domzgr_substitute.h90"357 358 324 INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2 359 325 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: tabres -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/NST_SRC/agrif_top_interp.F90
r3294 r3680 27 27 28 28 SUBROUTINE Agrif_trc 29 !!--------------------------------------------- 30 !! *** ROUTINE Agrif_trc *** 31 !!--------------------------------------------- 32 33 INTEGER :: ji,jj,jk,jn 34 REAL(wp) :: zrhox 35 REAL(wp) :: alpha1, alpha2, alpha3, alpha4 36 REAL(wp) :: alpha5, alpha6, alpha7 29 !!---------------------------------------------------------------------- 30 !! *** ROUTINE Agrif_Tra *** 31 !!---------------------------------------------------------------------- 32 !! 33 INTEGER :: ji, jj, jk, jn ! dummy loop indices 34 REAL(wp) :: zrhox , alpha1, alpha2, alpha3 35 REAL(wp) :: alpha4, alpha5, alpha6, alpha7 37 36 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztra 38 39 IF (Agrif_Root()) RETURN 37 !!---------------------------------------------------------------------- 38 ! 39 IF( Agrif_Root() ) RETURN 40 40 41 41 CALL wrk_alloc( jpi, jpj, jpk, jptra, ztra ) 42 42 43 Agrif_SpecialValue =0.43 Agrif_SpecialValue = 0.e0 44 44 Agrif_UseSpecialValue = .TRUE. 45 ztra = 0.e045 ztra(:,:,:,:) = 0.e0 46 46 47 CALL Agrif_Bc_variable( ztra,trn_id, procname =interptrn )47 CALL Agrif_Bc_variable( ztra, trn_id, procname=interptrn ) 48 48 Agrif_UseSpecialValue = .FALSE. 49 49 50 50 zrhox = Agrif_Rhox() 51 51 52 alpha1 = ( zrhox-1.)/2.53 alpha2 = 1. -alpha152 alpha1 = ( zrhox - 1. ) * 0.5 53 alpha2 = 1. - alpha1 54 54 55 alpha3 = ( zrhox-1)/(zrhox+1)56 alpha4 = 1. -alpha355 alpha3 = ( zrhox - 1. ) / ( zrhox + 1. ) 56 alpha4 = 1. - alpha3 57 57 58 alpha6 = 2. *(zrhox-1.)/(zrhox+1.)59 alpha7 = -(zrhox-1)/(zrhox+3)58 alpha6 = 2. * ( zrhox - 1. ) / ( zrhox + 1. ) 59 alpha7 = - ( zrhox - 1. ) / ( zrhox + 3. ) 60 60 alpha5 = 1. - alpha6 - alpha7 61 IF( nbondi == 1 .OR. nbondi == 2 ) THEN 61 62 62 IF ((nbondi == 1).OR.(nbondi == 2)) THEN 63 tra(nlci,:,:,:) = alpha1 * ztra(nlci,:,:,:) + alpha2 * ztra(nlci-1,:,:,:) 64 DO jn=1,jptra 65 DO jk=1,jpk 66 DO jj=1,jpj 67 IF (umask(nlci-2,jj,jk).EQ.0.) THEN 63 DO jn = 1, jptra 64 tra(nlci,:,:,jn) = alpha1 * ztra(nlci,:,:,jn) + alpha2 * ztra(nlci-1,:,:,jn) 65 DO jk = 1, jpkm1 66 DO jj = 1, jpj 67 IF( umask(nlci-2,jj,jk) == 0.e0 ) THEN 68 68 tra(nlci-1,jj,jk,jn) = tra(nlci,jj,jk,jn) * tmask(nlci-1,jj,jk) 69 69 ELSE 70 70 tra(nlci-1,jj,jk,jn)=(alpha4*tra(nlci,jj,jk,jn)+alpha3*tra(nlci-2,jj,jk,jn))*tmask(nlci-1,jj,jk) 71 IF (un(nlci-2,jj,jk).GT.0.) THEN 72 tra(nlci-1,jj,jk,jn)=(alpha6*tra(nlci-2,jj,jk,jn)+alpha5*tra(nlci,jj,jk,jn) & 73 +alpha7*tra(nlci-3,jj,jk,jn))*tmask(nlci-1,jj,jk) 71 IF( un(nlci-2,jj,jk) > 0.e0 ) THEN 72 tra(nlci-1,jj,jk,jn)=( alpha6*tra(nlci-2,jj,jk,jn)+alpha5*tra(nlci,jj,jk,jn) & 73 & + alpha7*tra(nlci-3,jj,jk,jn) ) * tmask(nlci-1,jj,jk) 74 ENDIF 75 ENDIF 76 END DO 77 END DO 78 ENDDO 79 ENDIF 80 81 IF( nbondj == 1 .OR. nbondj == 2 ) THEN 82 83 DO jn = 1, jptra 84 tra(:,nlcj,:,jn) = alpha1 * ztra(:,nlcj,:,jn) + alpha2 * ztra(:,nlcj-1,:,jn) 85 DO jk = 1, jpkm1 86 DO ji = 1, jpi 87 IF( vmask(ji,nlcj-2,jk) == 0.e0 ) THEN 88 tra(ji,nlcj-1,jk,jn) = tra(ji,nlcj,jk,jn) * tmask(ji,nlcj-1,jk) 89 ELSE 90 tra(ji,nlcj-1,jk,jn)=(alpha4*tra(ji,nlcj,jk,jn)+alpha3*tra(ji,nlcj-2,jk,jn))*tmask(ji,nlcj-1,jk) 91 IF (vn(ji,nlcj-2,jk) > 0.e0 ) THEN 92 tra(ji,nlcj-1,jk,jn)=( alpha6*tra(ji,nlcj-2,jk,jn)+alpha5*tra(ji,nlcj,jk,jn) & 93 & + alpha7*tra(ji,nlcj-3,jk,jn) ) * tmask(ji,nlcj-1,jk) 94 ENDIF 95 ENDIF 96 END DO 97 END DO 98 ENDDO 99 ENDIF 100 IF( nbondi == -1 .OR. nbondi == 2 ) THEN 101 DO jn = 1, jptra 102 tra(1,:,:,jn) = alpha1 * ztra(1,:,:,jn) + alpha2 * ztra(2,:,:,jn) 103 DO jk = 1, jpkm1 104 DO jj = 1, jpj 105 IF( umask(2,jj,jk) == 0.e0 ) THEN 106 tra(2,jj,jk,jn) = tra(1,jj,jk,jn) * tmask(2,jj,jk) 107 ELSE 108 tra(2,jj,jk,jn)=(alpha4*tra(1,jj,jk,jn)+alpha3*tra(3,jj,jk,jn))*tmask(2,jj,jk) 109 IF( un(2,jj,jk) < 0.e0 ) THEN 110 tra(2,jj,jk,jn)=(alpha6*tra(3,jj,jk,jn)+alpha5*tra(1,jj,jk,jn)+alpha7*tra(4,jj,jk,jn))*tmask(2,jj,jk) 74 111 ENDIF 75 112 ENDIF … … 79 116 ENDIF 80 117 81 IF ((nbondj == 1).OR.(nbondj == 2)) THEN82 tra(:,nlcj,:,:) = alpha1 * ztra(:,nlcj,:,:) + alpha2 * ztra(:,nlcj-1,:,:)83 DO jn=1, jptra84 DO jk=1,jpk 118 IF( nbondj == -1 .OR. nbondj == 2 ) THEN 119 DO jn = 1, jptra 120 tra(:,1,:,jn) = alpha1 * ztra(:,1,:,jn) + alpha2 * ztra(:,2,:,jn) 121 DO jk=1,jpk 85 122 DO ji=1,jpi 86 IF (vmask(ji,nlcj-2,jk).EQ.0.) THEN87 tra(ji, nlcj-1,jk,jn) = tra(ji,nlcj,jk,jn) * tmask(ji,nlcj-1,jk)123 IF( vmask(ji,2,jk) == 0.e0 ) THEN 124 tra(ji,2,jk,jn)=tra(ji,1,jk,jn) * tmask(ji,2,jk) 88 125 ELSE 89 tra(ji,nlcj-1,jk,jn)=(alpha4*tra(ji,nlcj,jk,jn)+alpha3*tra(ji,nlcj-2,jk,jn))*tmask(ji,nlcj-1,jk) 90 IF (vn(ji,nlcj-2,jk) .GT. 0.) THEN 91 tra(ji,nlcj-1,jk,jn)=(alpha6*tra(ji,nlcj-2,jk,jn)+alpha5*tra(ji,nlcj,jk,jn) & 92 +alpha7*tra(ji,nlcj-3,jk,jn))*tmask(ji,nlcj-1,jk) 126 tra(ji,2,jk,jn)=(alpha4*tra(ji,1,jk,jn)+alpha3*tra(ji,3,jk,jn))*tmask(ji,2,jk) 127 IF( vn(ji,2,jk) < 0.e0 ) THEN 128 tra(ji,2,jk,jn)=(alpha6*tra(ji,3,jk,jn)+alpha5*tra(ji,1,jk,jn)+alpha7*tra(ji,4,jk,jn))*tmask(ji,2,jk) 93 129 ENDIF 94 130 ENDIF 95 131 END DO 96 132 END DO 97 END 133 ENDDO 98 134 ENDIF 99 100 IF ((nbondi == -1).OR.(nbondi == 2)) THEN 101 tra(1,:,:,:) = alpha1 * ztra(1,:,:,:) + alpha2 * ztra(2,:,:,:) 102 DO jn=1, jptra 103 DO jk=1,jpk 104 DO jj=1,jpj 105 IF (umask(2,jj,jk).EQ.0.) THEN 106 tra(2,jj,jk,jn) = tra(1,jj,jk,jn) * tmask(2,jj,jk) 107 ELSE 108 tra(2,jj,jk,jn)=(alpha4*tra(1,jj,jk,jn)+alpha3*tra(3,jj,jk,jn))*tmask(2,jj,jk) 109 IF (un(2,jj,jk).LT.0.) THEN 110 tra(2,jj,jk,jn)=(alpha6*tra(3,jj,jk,jn)+alpha5*tra(1,jj,jk,jn) & 111 +alpha7*tra(4,jj,jk,jn))*tmask(2,jj,jk) 112 ENDIF 113 ENDIF 114 END DO 115 END DO 116 END DO 117 ENDIF 118 119 IF ((nbondj == -1).OR.(nbondj == 2)) THEN 120 tra(:,1,:,:) = alpha1 * ztra(:,1,:,:) + alpha2 * ztra(:,2,:,:) 121 DO jn=1, jptra 122 DO jk=1,jpk 123 DO ji=1,jpi 124 IF (vmask(ji,2,jk).EQ.0.) THEN 125 tra(ji,2,jk,jn)=tra(ji,1,jk,jn) * tmask(ji,2,jk) 126 ELSE 127 tra(ji,2,jk,jn)=(alpha4*tra(ji,1,jk,jn)+alpha3*tra(ji,3,jk,jn))*tmask(ji,2,jk) 128 IF (vn(ji,2,jk) .LT. 0.) THEN 129 tra(ji,2,jk,jn)=(alpha6*tra(ji,3,jk,jn)+alpha5*tra(ji,1,jk,jn)& 130 +alpha7*tra(ji,4,jk,jn))*tmask(ji,2,jk) 131 ENDIF 132 ENDIF 133 END DO 134 END DO 135 END DO 136 ENDIF 137 135 ! 138 136 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztra ) 137 ! 139 138 140 139 END SUBROUTINE Agrif_trc -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/NST_SRC/agrif_top_sponge.F90
r3294 r3680 8 8 USE in_out_manager 9 9 USE agrif_oce 10 USE agrif_opa_sponge 10 11 USE trc 11 12 USE lib_mpp … … 17 18 PUBLIC Agrif_Sponge_Trc, interptrn 18 19 20 !! * Substitutions 21 # include "domzgr_substitute.h90" 19 22 !!---------------------------------------------------------------------- 20 23 !! NEMO/NST 3.3 , NEMO Consortium (2010) … … 29 32 !! *** ROUTINE Agrif_Sponge_Trc *** 30 33 !!--------------------------------------------- 31 #include "domzgr_substitute.h90"32 34 !! 33 INTEGER :: ji,jj,jk,jl 34 INTEGER :: spongearea 35 INTEGER :: ji,jj,jk,jn 35 36 REAL(wp) :: timecoeff 36 37 REAL(wp) :: ztra, zabe1, zabe2, zbtr 37 REAL(wp), POINTER, DIMENSION(:,:) :: localviscsponge 38 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: trbdiff, ztru, ztrv, ztab 38 REAL(wp), POINTER, DIMENSION(:,:) :: ztru, ztrv 39 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztabr 40 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: trbdiff 39 41 40 42 #if defined SPONGE_TOP 41 CALL wrk_alloc( jpi, jpj, localviscsponge)42 CALL wrk_alloc( jpi, jpj, jpk, jptra, trbdiff, ztru, ztrv, ztab)43 CALL wrk_alloc( jpi, jpj, ztru, ztrv ) 44 CALL wrk_alloc( jpi, jpj, jpk, jptra, ztabr, trbdiff ) 43 45 44 46 timecoeff = REAL(Agrif_NbStepint(),wp)/Agrif_rhot() … … 46 48 Agrif_SpecialValue=0. 47 49 Agrif_UseSpecialValue = .TRUE. 48 ztab = 0.e049 CALL Agrif_Bc_Variable(ztab , tra_id,calledweight=timecoeff,procname=interptrn)50 ztabr = 0.e0 51 CALL Agrif_Bc_Variable(ztabr, tra_id,calledweight=timecoeff,procname=interptrn) 50 52 Agrif_UseSpecialValue = .FALSE. 51 53 52 trbdiff(:,:,:,:) = trb(:,:,:,:) - ztab (:,:,:,:)54 trbdiff(:,:,:,:) = trb(:,:,:,:) - ztabr(:,:,:,:) 53 55 54 spongearea = 2 + 2 * Agrif_irhox()56 CALL Agrif_sponge 55 57 56 localviscsponge = 0. 57 58 IF (.NOT. spongedoneT) THEN 59 spe1ur(:,:) = 0. 60 spe2vr(:,:) = 0. 58 DO jn = 1, jptra 59 DO jk = 1, jpkm1 60 ! 61 DO jj = 1, jpjm1 62 DO ji = 1, jpim1 63 zabe1 = umask(ji,jj,jk) * spe1ur(ji,jj) * fse3u(ji,jj,jk) 64 zabe2 = vmask(ji,jj,jk) * spe2vr(ji,jj) * fse3v(ji,jj,jk) 65 ztru(ji,jj) = zabe1 * ( trbdiff(ji+1,jj ,jk,jn) - trbdiff(ji,jj,jk,jn) ) 66 ztrv(ji,jj) = zabe2 * ( trbdiff(ji ,jj+1,jk,jn) - trbdiff(ji,jj,jk,jn) ) 67 ENDDO 68 ENDDO 61 69 62 IF ((nbondi == -1).OR.(nbondi == 2)) THEN 63 DO ji = 2, spongearea 64 localviscsponge(ji,:) = visc_tra * (spongearea-ji)/real(spongearea-2) 70 DO jj = 2,jpjm1 71 DO ji = 2,jpim1 72 zbtr = spbtr2(ji,jj) / fse3t(ji,jj,jk) 73 ! horizontal diffusive trends 74 ztra = zbtr * ( ztru(ji,jj) - ztru(ji-1,jj) + ztrv(ji,jj) - ztrv(ji,jj-1) ) 75 ! add it to the general tracer trends 76 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 77 END DO 78 END DO 79 ! 65 80 ENDDO 66 67 spe1ur(2:spongearea-1,:)=0.5 * (localviscsponge(2:spongearea-1,:) + localviscsponge(3:spongearea,:)) &68 * e2u(2:spongearea-1,:) / e1u(2:spongearea-1,:)69 70 spe2vr(2:spongearea,1:jpjm1) = 0.5 * (localviscsponge(2:spongearea,1:jpjm1) + &71 localviscsponge(2:spongearea,2:jpj)) &72 * e1v(2:spongearea,1:jpjm1) / e2v(2:spongearea,1:jpjm1)73 ENDIF74 75 IF ((nbondi == 1).OR.(nbondi == 2)) THEN76 DO ji = nlci-spongearea + 1,nlci-177 localviscsponge(ji,:) = visc_tra * (ji - (nlci-spongearea+1))/real(spongearea-2)78 ENDDO79 80 spe1ur(nlci-spongearea + 1:nlci-2,:)=0.5 * (localviscsponge(nlci-spongearea + 1:nlci-2,:) + &81 localviscsponge(nlci-spongearea + 2:nlci-1,:)) &82 * e2u(nlci-spongearea + 1:nlci-2,:) / e1u(nlci-spongearea + 1:nlci-2,:)83 84 spe2vr(nlci-spongearea + 1:nlci-1,1:jpjm1) = 0.5 * (localviscsponge(nlci-spongearea + 1:nlci-1,1:jpjm1) &85 + localviscsponge(nlci-spongearea + 1:nlci-1,2:jpj)) &86 * e1v(nlci-spongearea + 1:nlci-1,1:jpjm1) / e2v(nlci-spongearea + 1:nlci-1,1:jpjm1)87 ENDIF88 89 90 IF ((nbondj == -1).OR.(nbondj == 2)) THEN91 DO jj = 2, spongearea92 localviscsponge(:,jj) = visc_tra * (spongearea-jj)/real(spongearea-2)93 ENDDO94 95 spe1ur(1:jpim1,2:spongearea)=0.5 * (localviscsponge(1:jpim1,2:spongearea) + &96 localviscsponge(2:jpi,2:spongearea)) &97 * e2u(1:jpim1,2:spongearea) / e1u(1:jpim1,2:spongearea)98 99 spe2vr(:,2:spongearea-1) = 0.5 * (localviscsponge(:,2:spongearea-1) + &100 localviscsponge(:,3:spongearea)) &101 * e1v(:,2:spongearea-1) / e2v(:,2:spongearea-1)102 ENDIF103 104 IF ((nbondj == 1).OR.(nbondj == 2)) THEN105 DO jj = nlcj-spongearea + 1,nlcj-1106 localviscsponge(:,jj) = visc_tra * (jj - (nlcj-spongearea+1))/real(spongearea-2)107 ENDDO108 109 spe1ur(1:jpim1,nlcj-spongearea + 1:nlcj-1)=0.5 * (localviscsponge(1:jpim1,nlcj-spongearea + 1:nlcj-1) + &110 localviscsponge(2:jpi,nlcj-spongearea + 1:nlcj-1)) &111 * e2u(1:jpim1,nlcj-spongearea + 1:nlcj-1) / e1u(1:jpim1,nlcj-spongearea + 1:nlcj-1)112 113 spe2vr(:,nlcj-spongearea + 1:nlcj-2) = 0.5 * (localviscsponge(:,nlcj-spongearea + 1:nlcj-2) + &114 localviscsponge(:,nlcj-spongearea + 2:nlcj-1)) &115 * e1v(:,nlcj-spongearea + 1:nlcj-2) / e2v(:,nlcj-spongearea + 1:nlcj-2)116 ENDIF117 118 spbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:))119 120 spongedoneT = .TRUE.121 ENDIF122 123 DO jl = 1, jptra124 DO jk = 1, jpkm1125 DO jj = 1, jpjm1126 DO ji = 1, jpim1127 zabe1 = umask(ji,jj,jk) * spe1ur(ji,jj) * fse3u(ji,jj,jk)128 zabe2 = vmask(ji,jj,jk) * spe2vr(ji,jj) * fse3v(ji,jj,jk)129 ztru(ji,jj,jk,jl) = zabe1 * ( trbdiff(ji+1,jj ,jk,jl) - trbdiff(ji,jj,jk,jl) )130 ztrv(ji,jj,jk,jl) = zabe2 * ( trbdiff(ji ,jj+1,jk,jl) - trbdiff(ji,jj,jk,jl) )131 ENDDO132 ENDDO133 134 DO jj = 2,jpjm1135 DO ji = 2,jpim1136 zbtr = spbtr2(ji,jj) / fse3t(ji,jj,jk)137 ! horizontal diffusive trends138 ztra = zbtr * ( ztru(ji,jj,jk,jl) - ztru(ji-1,jj,jk,jl) &139 & + ztrv(ji,jj,jk,jl) - ztrv(ji,jj-1,jk,jl) )140 ! add it to the general tracer trends141 tra(ji,jj,jk,jl) = (tra(ji,jj,jk,jl) + ztra)142 END DO143 END DO144 145 ENDDO146 81 ENDDO 147 82 148 CALL wrk_dealloc( jpi, jpj, localviscsponge)149 CALL wrk_dealloc( jpi, jpj, jpk, jptra, trbdiff, zt ru, ztrv, ztab)83 CALL wrk_dealloc( jpi, jpj, ztru, ztrv ) 84 CALL wrk_dealloc( jpi, jpj, jpk, jptra, trbdiff, ztabr ) 150 85 151 86 #endif … … 153 88 END SUBROUTINE Agrif_Sponge_Trc 154 89 155 SUBROUTINE interptrn(tabres,i1,i2,j1,j2,k1,k2, l1,l2)90 SUBROUTINE interptrn(tabres,i1,i2,j1,j2,k1,k2,n1,n2) 156 91 !!--------------------------------------------- 157 92 !! *** ROUTINE interptn *** 158 93 !!--------------------------------------------- 159 # include "domzgr_substitute.h90" 160 161 INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2,l1,l2 162 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2,l1:l2), INTENT(inout) :: tabres 163 164 tabres(i1:i2,j1:j2,k1:k2,l1:l2) = trn(i1:i2,j1:j2,k1:k2,l1:l2) 94 INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2,n1,n2 95 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres 96 ! 97 tabres(i1:i2,j1:j2,k1:k2,n1:n2) = trn(i1:i2,j1:j2,k1:k2,n1:n2) 165 98 166 99 END SUBROUTINE interptrn -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/NST_SRC/agrif_top_update.F90
r3294 r3680 38 38 39 39 #if defined TWO_WAY 40 CALL wrk_alloc( jpi, jpj, jpk, jpt s, ztra )40 CALL wrk_alloc( jpi, jpj, jpk, jptra, ztra ) 41 41 42 42 Agrif_UseSpecialValueInUpdate = .TRUE. … … 52 52 nbcline_trc = nbcline_trc + 1 53 53 54 CALL wrk_dealloc( jpi, jpj, jpk, jpt s, ztra )54 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztra ) 55 55 #endif 56 56 57 57 END SUBROUTINE Agrif_Update_Trc 58 58 59 SUBROUTINE updateTRC(tabres,i1,i2,j1,j2,k1,k2, l1,l2,before)59 SUBROUTINE updateTRC(tabres,i1,i2,j1,j2,k1,k2,n1,n2,before) 60 60 !!--------------------------------------------- 61 61 !! *** ROUTINE UpdateTrc *** 62 62 !!--------------------------------------------- 63 # include "domzgr_substitute.h90" 64 65 INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2,l1,l2 66 REAL, DIMENSION(i1:i2,j1:j2,k1:k2,l1:l2), INTENT(inout) :: tabres 63 INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2,n1,n2 64 REAL, DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres 67 65 LOGICAL, INTENT(in) :: before 68 66 69 INTEGER :: ji,jj,jk,j l67 INTEGER :: ji,jj,jk,jn 70 68 71 IF (before) THEN72 DO j l=l1,l273 DO jk =k1,k274 DO jj =j1,j275 DO ji =i1,i276 tabres(ji,jj,jk,j l) = trn(ji,jj,jk,jl)69 IF( before ) THEN 70 DO jn = n1, n2 71 DO jk = k1, k2 72 DO jj = j1, j2 73 DO ji = i1, i2 74 tabres(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 77 75 ENDDO 78 76 ENDDO … … 80 78 ENDDO 81 79 ELSE 82 DO j l=l1,l283 DO jk =k1,k284 DO jj =j1,j285 DO ji =i1,i286 IF (tabres(ji,jj,jk,jl).NE.0.) THEN87 trn(ji,jj,jk,j l) = tabres(ji,jj,jk,jl) * tmask(ji,jj,jk)80 DO jn = n1, n2 81 DO jk = k1, k2 82 DO jj = j1, j2 83 DO ji = i1, i2 84 IF( tabres(ji,jj,jk,jn) .NE. 0. ) THEN 85 trn(ji,jj,jk,jn) = tabres(ji,jj,jk,jn) * tmask(ji,jj,jk) 88 86 ENDIF 89 87 ENDDO -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/NST_SRC/agrif_user.F90
r3294 r3680 1 1 #if defined key_agrif 2 !!---------------------------------------------------------------------- 3 !! NEMO/NST 3.3 , NEMO Consortium (2010) 4 !! $Id$ 5 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 6 !!---------------------------------------------------------------------- 7 SUBROUTINE agrif_before_regridding 8 END SUBROUTINE 9 10 SUBROUTINE Agrif_InitWorkspace 11 !!---------------------------------------------------------------------- 12 !! *** ROUTINE Agrif_InitWorkspace *** 13 !!---------------------------------------------------------------------- 14 USE par_oce 15 USE dom_oce 16 USE Agrif_Util 17 USE nemogcm 18 ! 19 IMPLICIT NONE 20 !!---------------------------------------------------------------------- 21 ! 22 IF( .NOT. Agrif_Root() ) THEN 23 jpni = Agrif_Parent(jpni) 24 jpnj = Agrif_Parent(jpnj) 25 jpnij = Agrif_Parent(jpnij) 26 jpiglo = nbcellsx + 2 + 2*nbghostcells 27 jpjglo = nbcellsy + 2 + 2*nbghostcells 28 jpi = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 29 jpj = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 30 jpk = jpkdta 31 jpim1 = jpi-1 32 jpjm1 = jpj-1 33 jpkm1 = jpk-1 34 jpij = jpi*jpj 35 jpidta = jpiglo 36 jpjdta = jpjglo 37 jpizoom = 1 38 jpjzoom = 1 39 nperio = 0 40 jperio = 0 41 ENDIF 42 ! 43 END SUBROUTINE Agrif_InitWorkspace 44 45 46 SUBROUTINE Agrif_InitValues 47 !!---------------------------------------------------------------------- 48 !! *** ROUTINE Agrif_InitValues *** 49 !! 50 !! ** Purpose :: Declaration of variables to be interpolated 51 !!---------------------------------------------------------------------- 52 USE Agrif_Util 53 USE oce 54 USE dom_oce 55 USE nemogcm 56 USE tradmp 57 USE obc_par 58 USE bdy_par 59 60 IMPLICIT NONE 61 !!---------------------------------------------------------------------- 62 63 ! 0. Initializations 64 !------------------- 2 !!---------------------------------------------------------------------- 3 !! NEMO/NST 3.4 , NEMO Consortium (2012) 4 !! $Id$ 5 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 6 !!---------------------------------------------------------------------- 7 SUBROUTINE agrif_user 8 END SUBROUTINE agrif_user 9 10 SUBROUTINE agrif_before_regridding 11 END SUBROUTINE agrif_before_regridding 12 13 SUBROUTINE Agrif_InitWorkspace 14 !!---------------------------------------------------------------------- 15 !! *** ROUTINE Agrif_InitWorkspace *** 16 !!---------------------------------------------------------------------- 17 USE par_oce 18 USE dom_oce 19 USE Agrif_Util 20 USE nemogcm 21 ! 22 IMPLICIT NONE 23 !!---------------------------------------------------------------------- 24 ! 25 IF( .NOT. Agrif_Root() ) THEN 26 jpni = Agrif_Parent(jpni) 27 jpnj = Agrif_Parent(jpnj) 28 jpnij = Agrif_Parent(jpnij) 29 jpiglo = nbcellsx + 2 + 2*nbghostcells 30 jpjglo = nbcellsy + 2 + 2*nbghostcells 31 jpi = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 32 jpj = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 33 jpk = jpkdta 34 jpim1 = jpi-1 35 jpjm1 = jpj-1 36 jpkm1 = jpk-1 37 jpij = jpi*jpj 38 jpidta = jpiglo 39 jpjdta = jpjglo 40 jpizoom = 1 41 jpjzoom = 1 42 nperio = 0 43 jperio = 0 44 ENDIF 45 ! 46 END SUBROUTINE Agrif_InitWorkspace 47 48 49 SUBROUTINE Agrif_InitValues 50 !!---------------------------------------------------------------------- 51 !! *** ROUTINE Agrif_InitValues *** 52 !! 53 !! ** Purpose :: Declaration of variables to be interpolated 54 !!---------------------------------------------------------------------- 55 USE Agrif_Util 56 USE oce 57 USE dom_oce 58 USE nemogcm 59 USE tradmp 60 USE obc_par 61 USE bdy_par 62 63 IMPLICIT NONE 64 !!---------------------------------------------------------------------- 65 66 ! 0. Initializations 67 !------------------- 65 68 #if defined key_orca_r025 || defined key_orca_r05 || defined key_orca_r2 || defined key_orca_r4 66 67 69 jp_cfg = -1 ! set special value for jp_cfg on fine grids 70 cp_cfg = "default" 68 71 #endif 69 72 70 ! Specific fine grid Initializations 71 ! no tracer damping on fine grids 72 ln_tradmp = .FALSE. 73 ! no open boundary on fine grids 74 lk_obc = .FALSE. 75 lk_bdy = .FALSE. 76 77 CALL nemo_init ! Initializations of each fine grid 78 CALL agrif_nemo_init 73 ! Specific fine grid Initializations 74 ! no tracer damping on fine grids 75 ln_tradmp = .FALSE. 76 ! no open boundary on fine grids 77 lk_obc = .FALSE. 78 lk_bdy = .FALSE. 79 80 CALL nemo_init ! Initializations of each fine grid 81 CALL agrif_nemo_init 82 CALL Agrif_InitValues_cont_dom 79 83 # if ! defined key_offline 80 84 CALL Agrif_InitValues_cont 81 85 # endif 82 86 # if defined key_top 83 87 CALL Agrif_InitValues_cont_top 84 88 # endif 85 END SUBROUTINE Agrif_initvalues 89 END SUBROUTINE Agrif_initvalues 90 91 92 SUBROUTINE Agrif_InitValues_cont_dom 93 !!---------------------------------------------------------------------- 94 !! *** ROUTINE Agrif_InitValues_cont *** 95 !! 96 !! ** Purpose :: Declaration of variables to be interpolated 97 !!---------------------------------------------------------------------- 98 USE Agrif_Util 99 USE oce 100 USE dom_oce 101 USE nemogcm 102 USE sol_oce 103 USE in_out_manager 104 USE agrif_opa_update 105 USE agrif_opa_interp 106 USE agrif_opa_sponge 107 ! 108 IMPLICIT NONE 109 ! 110 !!---------------------------------------------------------------------- 111 112 ! Declaration of the type of variable which have to be interpolated 113 !--------------------------------------------------------------------- 114 CALL agrif_declare_var_dom 115 ! 116 END SUBROUTINE Agrif_InitValues_cont_dom 117 118 119 SUBROUTINE agrif_declare_var_dom 120 !!---------------------------------------------------------------------- 121 !! *** ROUTINE agrif_declarE_var *** 122 !! 123 !! ** Purpose :: Declaration of variables to be interpolated 124 !!---------------------------------------------------------------------- 125 USE agrif_util 126 USE par_oce ! ONLY : jpts 127 USE oce 128 IMPLICIT NONE 129 !!---------------------------------------------------------------------- 130 131 ! 1. Declaration of the type of variable which have to be interpolated 132 !--------------------------------------------------------------------- 133 CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e1u_id) 134 CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e2v_id) 135 136 137 ! 2. Type of interpolation 138 !------------------------- 139 Call Agrif_Set_bcinterp(e1u_id,interp1=Agrif_linear,interp2=AGRIF_ppm) 140 Call Agrif_Set_bcinterp(e2v_id,interp1=AGRIF_ppm,interp2=Agrif_linear) 141 142 ! 3. Location of interpolation 143 !----------------------------- 144 Call Agrif_Set_bc(e1u_id,(/0,0/)) 145 Call Agrif_Set_bc(e2v_id,(/0,0/)) 146 147 ! 5. Update type 148 !--------------- 149 Call Agrif_Set_Updatetype(e1u_id,update1 = Agrif_Update_Copy, update2=Agrif_Update_Average) 150 Call Agrif_Set_Updatetype(e2v_id,update1 = Agrif_Update_Average, update2=Agrif_Update_Copy) 151 152 END SUBROUTINE agrif_declare_var_dom 153 86 154 87 155 # if ! defined key_offline 88 156 89 SUBROUTINE Agrif_InitValues_cont 90 !!---------------------------------------------------------------------- 91 !! *** ROUTINE Agrif_InitValues_cont *** 92 !! 93 !! ** Purpose :: Declaration of variables to be interpolated 94 !!---------------------------------------------------------------------- 95 USE Agrif_Util 96 USE oce 97 USE dom_oce 98 USE nemogcm 99 USE sol_oce 100 USE in_out_manager 101 USE agrif_opa_update 102 USE agrif_opa_interp 103 USE agrif_opa_sponge 104 ! 105 IMPLICIT NONE 106 ! 107 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: tabtstemp 108 REAL(wp), DIMENSION(:,:,: ), ALLOCATABLE :: tabuvtemp 109 LOGICAL :: check_namelist 110 !!---------------------------------------------------------------------- 111 112 ALLOCATE( tabtstemp(jpi, jpj, jpk, jpts) ) 113 ALLOCATE( tabuvtemp(jpi, jpj, jpk) ) 114 115 116 ! 1. Declaration of the type of variable which have to be interpolated 117 !--------------------------------------------------------------------- 118 CALL agrif_declare_var 119 120 ! 2. First interpolations of potentially non zero fields 121 !------------------------------------------------------- 122 Agrif_SpecialValue=0. 123 Agrif_UseSpecialValue = .TRUE. 124 Call Agrif_Bc_variable(tabtstemp,tsn_id,calledweight=1.,procname=interptsn) 125 Call Agrif_Bc_variable(tabtstemp,tsa_id,calledweight=1.,procname=interptsn) 126 127 Call Agrif_Bc_variable(tabuvtemp,un_id,calledweight=1.,procname=interpu) 128 Call Agrif_Bc_variable(tabuvtemp,vn_id,calledweight=1.,procname=interpv) 129 Call Agrif_Bc_variable(tabuvtemp,ua_id,calledweight=1.,procname=interpun) 130 Call Agrif_Bc_variable(tabuvtemp,va_id,calledweight=1.,procname=interpvn) 131 Agrif_UseSpecialValue = .FALSE. 132 133 ! 3. Some controls 134 !----------------- 135 check_namelist = .true. 136 137 IF( check_namelist ) THEN 138 139 ! Check time steps 140 IF( NINT(Agrif_Rhot()) * nint(rdt) /= Agrif_Parent(rdt) ) THEN 141 WRITE(*,*) 'incompatible time step between grids' 142 WRITE(*,*) 'parent grid value : ',Agrif_Parent(rdt) 143 WRITE(*,*) 'child grid value : ',nint(rdt) 144 WRITE(*,*) 'value on parent grid should be : ',rdt*Agrif_Rhot() 157 SUBROUTINE Agrif_InitValues_cont 158 !!---------------------------------------------------------------------- 159 !! *** ROUTINE Agrif_InitValues_cont *** 160 !! 161 !! ** Purpose :: Declaration of variables to be interpolated 162 !!---------------------------------------------------------------------- 163 USE Agrif_Util 164 USE oce 165 USE dom_oce 166 USE nemogcm 167 USE sol_oce 168 USE in_out_manager 169 USE agrif_opa_update 170 USE agrif_opa_interp 171 USE agrif_opa_sponge 172 ! 173 IMPLICIT NONE 174 ! 175 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: tabtstemp 176 REAL(wp), DIMENSION(:,:,: ), ALLOCATABLE :: tabuvtemp 177 LOGICAL :: check_namelist 178 !!---------------------------------------------------------------------- 179 180 ALLOCATE( tabtstemp(jpi, jpj, jpk, jpts) ) 181 ALLOCATE( tabuvtemp(jpi, jpj, jpk) ) 182 183 184 ! 1. Declaration of the type of variable which have to be interpolated 185 !--------------------------------------------------------------------- 186 CALL agrif_declare_var 187 188 ! 2. First interpolations of potentially non zero fields 189 !------------------------------------------------------- 190 Agrif_SpecialValue=0. 191 Agrif_UseSpecialValue = .TRUE. 192 Call Agrif_Bc_variable(tabtstemp,tsn_id,calledweight=1.,procname=interptsn) 193 Call Agrif_Bc_variable(tabtstemp,tsa_id,calledweight=1.,procname=interptsn) 194 195 Call Agrif_Bc_variable(tabuvtemp,un_id,calledweight=1.,procname=interpu) 196 Call Agrif_Bc_variable(tabuvtemp,vn_id,calledweight=1.,procname=interpv) 197 Call Agrif_Bc_variable(tabuvtemp,ua_id,calledweight=1.,procname=interpun) 198 Call Agrif_Bc_variable(tabuvtemp,va_id,calledweight=1.,procname=interpvn) 199 Agrif_UseSpecialValue = .FALSE. 200 201 ! 3. Some controls 202 !----------------- 203 check_namelist = .true. 204 205 IF( check_namelist ) THEN 206 207 ! Check time steps 208 IF( NINT(Agrif_Rhot()) * nint(rdt) /= Agrif_Parent(rdt) ) THEN 209 WRITE(*,*) 'incompatible time step between grids' 210 WRITE(*,*) 'parent grid value : ',Agrif_Parent(rdt) 211 WRITE(*,*) 'child grid value : ',nint(rdt) 212 WRITE(*,*) 'value on parent grid should be : ',rdt*Agrif_Rhot() 213 STOP 214 ENDIF 215 216 ! Check run length 217 IF( Agrif_IRhot() * (Agrif_Parent(nitend)- & 218 Agrif_Parent(nit000)+1) .ne. (nitend-nit000+1) ) THEN 219 WRITE(*,*) 'incompatible run length between grids' 220 WRITE(*,*) 'parent grid value : ',(Agrif_Parent(nitend)- & 221 Agrif_Parent(nit000)+1),' time step' 222 WRITE(*,*) 'child grid value : ', & 223 (nitend-nit000+1),' time step' 224 WRITE(*,*) 'value on child grid should be : ', & 225 Agrif_IRhot() * (Agrif_Parent(nitend)- & 226 Agrif_Parent(nit000)+1) 227 STOP 228 ENDIF 229 230 ! Check coordinates 231 IF( ln_zps ) THEN 232 ! check parameters for partial steps 233 IF( Agrif_Parent(e3zps_min) .ne. e3zps_min ) THEN 234 WRITE(*,*) 'incompatible e3zps_min between grids' 235 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_min) 236 WRITE(*,*) 'child grid :',e3zps_min 237 WRITE(*,*) 'those values should be identical' 145 238 STOP 146 239 ENDIF 147 148 ! Check run length 149 IF( Agrif_IRhot() * (Agrif_Parent(nitend)- & 150 Agrif_Parent(nit000)+1) .ne. (nitend-nit000+1) ) THEN 151 WRITE(*,*) 'incompatible run length between grids' 152 WRITE(*,*) 'parent grid value : ',(Agrif_Parent(nitend)- & 153 Agrif_Parent(nit000)+1),' time step' 154 WRITE(*,*) 'child grid value : ', & 155 (nitend-nit000+1),' time step' 156 WRITE(*,*) 'value on child grid should be : ', & 157 Agrif_IRhot() * (Agrif_Parent(nitend)- & 158 Agrif_Parent(nit000)+1) 240 IF( Agrif_Parent(e3zps_rat) /= e3zps_rat ) THEN 241 WRITE(*,*) 'incompatible e3zps_rat between grids' 242 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_rat) 243 WRITE(*,*) 'child grid :',e3zps_rat 244 WRITE(*,*) 'those values should be identical' 159 245 STOP 160 246 ENDIF 161 162 ! Check coordinates 163 IF( ln_zps ) THEN 164 ! check parameters for partial steps 165 IF( Agrif_Parent(e3zps_min) .ne. e3zps_min ) THEN 166 WRITE(*,*) 'incompatible e3zps_min between grids' 167 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_min) 168 WRITE(*,*) 'child grid :',e3zps_min 169 WRITE(*,*) 'those values should be identical' 170 STOP 171 ENDIF 172 IF( Agrif_Parent(e3zps_rat) /= e3zps_rat ) THEN 173 WRITE(*,*) 'incompatible e3zps_rat between grids' 174 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_rat) 175 WRITE(*,*) 'child grid :',e3zps_rat 176 WRITE(*,*) 'those values should be identical' 177 STOP 178 ENDIF 247 ENDIF 248 ENDIF 249 250 CALL Agrif_Update_tra(0) 251 CALL Agrif_Update_dyn(0) 252 253 nbcline = 0 254 ! 255 DEALLOCATE(tabtstemp) 256 DEALLOCATE(tabuvtemp) 257 ! 258 END SUBROUTINE Agrif_InitValues_cont 259 260 261 SUBROUTINE agrif_declare_var 262 !!---------------------------------------------------------------------- 263 !! *** ROUTINE agrif_declarE_var *** 264 !! 265 !! ** Purpose :: Declaration of variables to be interpolated 266 !!---------------------------------------------------------------------- 267 USE agrif_util 268 USE par_oce ! ONLY : jpts 269 USE oce 270 IMPLICIT NONE 271 !!---------------------------------------------------------------------- 272 273 ! 1. Declaration of the type of variable which have to be interpolated 274 !--------------------------------------------------------------------- 275 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts/),tsn_id) 276 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts/),tsa_id) 277 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts/),tsb_id) 278 279 CALL agrif_declare_variable((/1,2,0/),(/2,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),un_id) 280 CALL agrif_declare_variable((/2,1,0/),(/3,2,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),vn_id) 281 CALL agrif_declare_variable((/1,2,0/),(/2,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),ua_id) 282 CALL agrif_declare_variable((/2,1,0/),(/3,2,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),va_id) 283 284 CALL agrif_declare_variable((/2,2/),(/3,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),sshn_id) 285 CALL agrif_declare_variable((/2,2/),(/3,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),gcb_id) 286 287 ! 2. Type of interpolation 288 !------------------------- 289 CALL Agrif_Set_bcinterp(tsn_id,interp=AGRIF_linear) 290 CALL Agrif_Set_bcinterp(tsa_id,interp=AGRIF_linear) 291 292 Call Agrif_Set_bcinterp(un_id,interp1=Agrif_linear,interp2=AGRIF_ppm) 293 Call Agrif_Set_bcinterp(vn_id,interp1=AGRIF_ppm,interp2=Agrif_linear) 294 295 Call Agrif_Set_bcinterp(ua_id,interp1=Agrif_linear,interp2=AGRIF_ppm) 296 Call Agrif_Set_bcinterp(va_id,interp1=AGRIF_ppm,interp2=Agrif_linear) 297 298 ! 3. Location of interpolation 299 !----------------------------- 300 Call Agrif_Set_bc(un_id,(/0,1/)) 301 Call Agrif_Set_bc(vn_id,(/0,1/)) 302 303 Call Agrif_Set_bc(tsn_id,(/0,1/)) 304 Call Agrif_Set_bc(tsa_id,(/-3*Agrif_irhox(),0/)) 305 306 Call Agrif_Set_bc(ua_id,(/-2*Agrif_irhox(),0/)) 307 Call Agrif_Set_bc(va_id,(/-2*Agrif_irhox(),0/)) 308 309 ! 5. Update type 310 !--------------- 311 Call Agrif_Set_Updatetype(tsn_id, update = AGRIF_Update_Average) 312 Call Agrif_Set_Updatetype(tsb_id, update = AGRIF_Update_Average) 313 314 Call Agrif_Set_Updatetype(sshn_id, update = AGRIF_Update_Average) 315 Call Agrif_Set_Updatetype(gcb_id,update = AGRIF_Update_Average) 316 317 Call Agrif_Set_Updatetype(un_id,update1 = Agrif_Update_Copy, update2 = Agrif_Update_Average) 318 Call Agrif_Set_Updatetype(vn_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy) 319 320 END SUBROUTINE agrif_declare_var 321 # endif 322 323 # if defined key_lim2 324 SUBROUTINE Agrif_InitValues_cont_lim2 325 !!---------------------------------------------------------------------- 326 !! *** ROUTINE Agrif_InitValues_cont_lim2 *** 327 !! 328 !! ** Purpose :: Initialisation of variables to be interpolated for LIM2 329 !!---------------------------------------------------------------------- 330 USE Agrif_Util 331 USE ice_2 332 USE agrif_ice 333 USE in_out_manager 334 USE agrif_lim2_update 335 USE agrif_lim2_interp 336 USE lib_mpp 337 ! 338 IMPLICIT NONE 339 ! 340 REAL(wp), DIMENSION(:,:) , ALLOCATABLE :: zvel 341 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zadv 342 !!---------------------------------------------------------------------- 343 344 ALLOCATE( zvel(jpi,jpj), zadv(jpi,jpj,7)) 345 346 ! 1. Declaration of the type of variable which have to be interpolated 347 !--------------------------------------------------------------------- 348 CALL agrif_declare_var_lim2 349 350 ! 2. First interpolations of potentially non zero fields 351 !------------------------------------------------------- 352 Agrif_SpecialValue=-9999. 353 Agrif_UseSpecialValue = .TRUE. 354 ! Call Agrif_Bc_variable(zadv ,adv_ice_id ,calledweight=1.,procname=interp_adv_ice ) 355 ! Call Agrif_Bc_variable(zvel ,u_ice_id ,calledweight=1.,procname=interp_u_ice ) 356 ! Call Agrif_Bc_variable(zvel ,v_ice_id ,calledweight=1.,procname=interp_v_ice ) 357 Agrif_SpecialValue=0. 358 Agrif_UseSpecialValue = .FALSE. 359 360 ! 3. Some controls 361 !----------------- 362 363 # if ! defined key_lim2_vp 364 lim_nbstep = 1. 365 CALL agrif_rhg_lim2_load 366 CALL agrif_trp_lim2_load 367 lim_nbstep = 0. 368 # endif 369 !RB mandatory but why ??? 370 ! IF( nbclineupdate /= nn_fsbc .AND. nn_ice == 2 )THEN 371 ! CALL ctl_warn ('With ice model on child grid, nbclineupdate is set to nn_fsbc') 372 ! nbclineupdate = nn_fsbc 373 ! ENDIF 374 CALL Agrif_Update_lim2(0) 375 ! 376 DEALLOCATE( zvel, zadv ) 377 ! 378 END SUBROUTINE Agrif_InitValues_cont_lim2 379 380 SUBROUTINE agrif_declare_var_lim2 381 !!---------------------------------------------------------------------- 382 !! *** ROUTINE agrif_declare_var_lim2 *** 383 !! 384 !! ** Purpose :: Declaration of variables to be interpolated for LIM2 385 !!---------------------------------------------------------------------- 386 USE agrif_util 387 USE ice_2 388 389 IMPLICIT NONE 390 !!---------------------------------------------------------------------- 391 392 ! 1. Declaration of the type of variable which have to be interpolated 393 !--------------------------------------------------------------------- 394 CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj, 7/),adv_ice_id ) 395 # if defined key_lim2_vp 396 CALL agrif_declare_variable((/1,1/),(/3,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),u_ice_id) 397 CALL agrif_declare_variable((/1,1/),(/3,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),v_ice_id) 398 # else 399 CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),u_ice_id) 400 CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/jpi,jpj/),v_ice_id) 401 # endif 402 403 ! 2. Type of interpolation 404 !------------------------- 405 CALL Agrif_Set_bcinterp(adv_ice_id ,interp=AGRIF_linear) 406 Call Agrif_Set_bcinterp(u_ice_id,interp1=Agrif_linear,interp2=AGRIF_ppm) 407 Call Agrif_Set_bcinterp(v_ice_id,interp1=AGRIF_ppm,interp2=Agrif_linear) 408 409 ! 3. Location of interpolation 410 !----------------------------- 411 Call Agrif_Set_bc(adv_ice_id ,(/0,1/)) 412 Call Agrif_Set_bc(u_ice_id,(/0,1/)) 413 Call Agrif_Set_bc(v_ice_id,(/0,1/)) 414 415 ! 5. Update type 416 !--------------- 417 Call Agrif_Set_Updatetype(adv_ice_id , update = AGRIF_Update_Average) 418 Call Agrif_Set_Updatetype(u_ice_id,update1 = Agrif_Update_Copy, update2 = Agrif_Update_Average) 419 Call Agrif_Set_Updatetype(v_ice_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy) 420 421 END SUBROUTINE agrif_declare_var_lim2 422 # endif 423 424 425 # if defined key_top 426 SUBROUTINE Agrif_InitValues_cont_top 427 !!---------------------------------------------------------------------- 428 !! *** ROUTINE Agrif_InitValues_cont_top *** 429 !! 430 !! ** Purpose :: Declaration of variables to be interpolated 431 !!---------------------------------------------------------------------- 432 USE Agrif_Util 433 USE oce 434 USE dom_oce 435 USE nemogcm 436 USE par_trc 437 USE trc 438 USE in_out_manager 439 USE agrif_top_update 440 USE agrif_top_interp 441 USE agrif_top_sponge 442 ! 443 IMPLICIT NONE 444 ! 445 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: tabtrtemp 446 LOGICAL :: check_namelist 447 !!---------------------------------------------------------------------- 448 449 ALLOCATE( tabtrtemp(jpi,jpj,jpk,jptra) ) 450 451 452 ! 1. Declaration of the type of variable which have to be interpolated 453 !--------------------------------------------------------------------- 454 CALL agrif_declare_var_top 455 456 ! 2. First interpolations of potentially non zero fields 457 !------------------------------------------------------- 458 Agrif_SpecialValue=0. 459 Agrif_UseSpecialValue = .TRUE. 460 Call Agrif_Bc_variable(tabtrtemp,trn_id,calledweight=1.,procname=interptrn) 461 Call Agrif_Bc_variable(tabtrtemp,tra_id,calledweight=1.,procname=interptrn) 462 Agrif_UseSpecialValue = .FALSE. 463 464 ! 3. Some controls 465 !----------------- 466 check_namelist = .true. 467 468 IF( check_namelist ) THEN 469 # if defined offline 470 ! Check time steps 471 IF( nint(Agrif_Rhot()) * nint(rdt) .ne. Agrif_Parent(rdt) ) THEN 472 WRITE(*,*) 'incompatible time step between grids' 473 WRITE(*,*) 'parent grid value : ',Agrif_Parent(rdt) 474 WRITE(*,*) 'child grid value : ',nint(rdt) 475 WRITE(*,*) 'value on parent grid should be : ',rdt*Agrif_Rhot() 476 STOP 477 ENDIF 478 479 ! Check run length 480 IF( Agrif_IRhot() * (Agrif_Parent(nitend)- & 481 Agrif_Parent(nit000)+1) .ne. (nitend-nit000+1) ) THEN 482 WRITE(*,*) 'incompatible run length between grids' 483 WRITE(*,*) 'parent grid value : ',(Agrif_Parent(nitend)- & 484 Agrif_Parent(nit000)+1),' time step' 485 WRITE(*,*) 'child grid value : ', & 486 (nitend-nit000+1),' time step' 487 WRITE(*,*) 'value on child grid should be : ', & 488 Agrif_IRhot() * (Agrif_Parent(nitend)- & 489 Agrif_Parent(nit000)+1) 490 STOP 491 ENDIF 492 493 ! Check coordinates 494 IF( ln_zps ) THEN 495 ! check parameters for partial steps 496 IF( Agrif_Parent(e3zps_min) .ne. e3zps_min ) THEN 497 WRITE(*,*) 'incompatible e3zps_min between grids' 498 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_min) 499 WRITE(*,*) 'child grid :',e3zps_min 500 WRITE(*,*) 'those values should be identical' 501 STOP 502 ENDIF 503 IF( Agrif_Parent(e3zps_rat) .ne. e3zps_rat ) THEN 504 WRITE(*,*) 'incompatible e3zps_rat between grids' 505 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_rat) 506 WRITE(*,*) 'child grid :',e3zps_rat 507 WRITE(*,*) 'those values should be identical' 508 STOP 179 509 ENDIF 180 510 ENDIF 181 182 CALL Agrif_Update_tra(0) 183 CALL Agrif_Update_dyn(0) 184 185 nbcline = 0 186 ! 187 DEALLOCATE(tabtstemp) 188 DEALLOCATE(tabuvtemp) 189 ! 190 END SUBROUTINE Agrif_InitValues_cont 191 192 193 SUBROUTINE agrif_declare_var 194 !!---------------------------------------------------------------------- 195 !! *** ROUTINE agrif_declarE_var *** 196 !! 197 !! ** Purpose :: Declaration of variables to be interpolated 198 !!---------------------------------------------------------------------- 199 USE agrif_util 200 USE par_oce ! ONLY : jpts 201 USE oce 202 IMPLICIT NONE 203 !!---------------------------------------------------------------------- 204 205 ! 1. Declaration of the type of variable which have to be interpolated 206 !--------------------------------------------------------------------- 207 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts/),tsn_id) 208 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts/),tsa_id) 209 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jpts/),tsb_id) 210 211 CALL agrif_declare_variable((/1,2,0/),(/2,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),un_id) 212 CALL agrif_declare_variable((/2,1,0/),(/3,2,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),vn_id) 213 CALL agrif_declare_variable((/1,2,0/),(/2,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),ua_id) 214 CALL agrif_declare_variable((/2,1,0/),(/3,2,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),va_id) 215 216 CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e1u_id) 217 CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e2v_id) 218 219 CALL agrif_declare_variable((/2,2/),(/3,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),sshn_id) 220 CALL agrif_declare_variable((/2,2/),(/3,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),gcb_id) 221 222 ! 2. Type of interpolation 223 !------------------------- 224 CALL Agrif_Set_bcinterp(tsn_id,interp=AGRIF_linear) 225 CALL Agrif_Set_bcinterp(tsa_id,interp=AGRIF_linear) 226 227 Call Agrif_Set_bcinterp(un_id,interp1=Agrif_linear,interp2=AGRIF_ppm) 228 Call Agrif_Set_bcinterp(vn_id,interp1=AGRIF_ppm,interp2=Agrif_linear) 229 230 Call Agrif_Set_bcinterp(ua_id,interp1=Agrif_linear,interp2=AGRIF_ppm) 231 Call Agrif_Set_bcinterp(va_id,interp1=AGRIF_ppm,interp2=Agrif_linear) 232 233 Call Agrif_Set_bcinterp(e1u_id,interp1=Agrif_linear,interp2=AGRIF_ppm) 234 Call Agrif_Set_bcinterp(e2v_id,interp1=AGRIF_ppm,interp2=Agrif_linear) 235 236 ! 3. Location of interpolation 237 !----------------------------- 238 Call Agrif_Set_bc(un_id,(/0,1/)) 239 Call Agrif_Set_bc(vn_id,(/0,1/)) 240 241 Call Agrif_Set_bc(e1u_id,(/0,0/)) 242 Call Agrif_Set_bc(e2v_id,(/0,0/)) 243 244 Call Agrif_Set_bc(tsn_id,(/0,1/)) 245 Call Agrif_Set_bc(tsa_id,(/-3*Agrif_irhox(),0/)) 246 247 Call Agrif_Set_bc(ua_id,(/-2*Agrif_irhox(),0/)) 248 Call Agrif_Set_bc(va_id,(/-2*Agrif_irhox(),0/)) 249 250 ! 5. Update type 251 !--------------- 252 Call Agrif_Set_Updatetype(tsn_id, update = AGRIF_Update_Average) 253 Call Agrif_Set_Updatetype(tsb_id, update = AGRIF_Update_Average) 254 255 Call Agrif_Set_Updatetype(sshn_id, update = AGRIF_Update_Average) 256 Call Agrif_Set_Updatetype(gcb_id,update = AGRIF_Update_Average) 257 258 Call Agrif_Set_Updatetype(un_id,update1 = Agrif_Update_Copy, update2 = Agrif_Update_Average) 259 Call Agrif_Set_Updatetype(vn_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy) 260 261 Call Agrif_Set_Updatetype(e1u_id,update1 = Agrif_Update_Copy, update2=Agrif_Update_Average) 262 Call Agrif_Set_Updatetype(e2v_id,update1 = Agrif_Update_Average, update2=Agrif_Update_Copy) 263 264 END SUBROUTINE agrif_declare_var 511 # endif 512 ! Check passive tracer cell 513 IF( nn_dttrc .ne. 1 ) THEN 514 WRITE(*,*) 'nn_dttrc should be equal to 1' 515 ENDIF 516 ENDIF 517 518 !ch CALL Agrif_Update_trc(0) 519 nbcline_trc = 0 520 ! 521 DEALLOCATE(tabtrtemp) 522 ! 523 END SUBROUTINE Agrif_InitValues_cont_top 524 525 526 SUBROUTINE agrif_declare_var_top 527 !!---------------------------------------------------------------------- 528 !! *** ROUTINE agrif_declare_var_top *** 529 !! 530 !! ** Purpose :: Declaration of TOP variables to be interpolated 531 !!---------------------------------------------------------------------- 532 USE agrif_util 533 USE dom_oce 534 USE trc 535 536 IMPLICIT NONE 537 538 ! 1. Declaration of the type of variable which have to be interpolated 539 !--------------------------------------------------------------------- 540 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jptra/),trn_id) 541 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jptra/),trb_id) 542 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jptra/),tra_id) 543 544 ! 2. Type of interpolation 545 !------------------------- 546 CALL Agrif_Set_bcinterp(trn_id,interp=AGRIF_linear) 547 CALL Agrif_Set_bcinterp(tra_id,interp=AGRIF_linear) 548 549 ! 3. Location of interpolation 550 !----------------------------- 551 Call Agrif_Set_bc(trn_id,(/0,1/)) 552 Call Agrif_Set_bc(tra_id,(/-3*Agrif_irhox(),0/)) 553 554 ! 5. Update type 555 !--------------- 556 Call Agrif_Set_Updatetype(trn_id, update = AGRIF_Update_Average) 557 Call Agrif_Set_Updatetype(trb_id, update = AGRIF_Update_Average) 558 559 560 END SUBROUTINE agrif_declare_var_top 265 561 # endif 266 267 # if defined key_top 268 SUBROUTINE Agrif_InitValues_cont_top 269 !!---------------------------------------------------------------------- 270 !! *** ROUTINE Agrif_InitValues_cont_top *** 271 !! 272 !! ** Purpose :: Declaration of variables to be interpolated 273 !!---------------------------------------------------------------------- 274 USE Agrif_Util 275 USE oce 276 USE dom_oce 277 USE nemogcm 278 USE trc 279 USE in_out_manager 280 USE agrif_top_update 281 USE agrif_top_interp 282 USE agrif_top_sponge 283 ! 284 IMPLICIT NONE 285 ! 286 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: tabtrtemp 287 LOGICAL :: check_namelist 288 !!---------------------------------------------------------------------- 289 290 ALLOCATE( tabtrtemp(jpi,jpj,jpk,jptra) ) 291 292 293 ! 1. Declaration of the type of variable which have to be interpolated 294 !--------------------------------------------------------------------- 295 CALL agrif_declare_var_top 296 297 ! 2. First interpolations of potentially non zero fields 298 !------------------------------------------------------- 299 Agrif_SpecialValue=0. 300 Agrif_UseSpecialValue = .TRUE. 301 Call Agrif_Bc_variable(tabtrtemp,trn_id,calledweight=1.) 302 Call Agrif_Bc_variable(tabtrtemp,tra_id,calledweight=1.,procname=interptrn) 303 Agrif_UseSpecialValue = .FALSE. 304 305 ! 3. Some controls 306 !----------------- 307 check_namelist = .true. 308 309 IF( check_namelist ) THEN 310 # if defined offline 311 ! Check time steps 312 IF( nint(Agrif_Rhot()) * nint(rdt) .ne. Agrif_Parent(rdt) ) THEN 313 WRITE(*,*) 'incompatible time step between grids' 314 WRITE(*,*) 'parent grid value : ',Agrif_Parent(rdt) 315 WRITE(*,*) 'child grid value : ',nint(rdt) 316 WRITE(*,*) 'value on parent grid should be : ',rdt*Agrif_Rhot() 317 STOP 318 ENDIF 319 320 ! Check run length 321 IF( Agrif_IRhot() * (Agrif_Parent(nitend)- & 322 Agrif_Parent(nit000)+1) .ne. (nitend-nit000+1) ) THEN 323 WRITE(*,*) 'incompatible run length between grids' 324 WRITE(*,*) 'parent grid value : ',(Agrif_Parent(nitend)- & 325 Agrif_Parent(nit000)+1),' time step' 326 WRITE(*,*) 'child grid value : ', & 327 (nitend-nit000+1),' time step' 328 WRITE(*,*) 'value on child grid should be : ', & 329 Agrif_IRhot() * (Agrif_Parent(nitend)- & 330 Agrif_Parent(nit000)+1) 331 STOP 332 ENDIF 333 334 ! Check coordinates 335 IF( ln_zps ) THEN 336 ! check parameters for partial steps 337 IF( Agrif_Parent(e3zps_min) .ne. e3zps_min ) THEN 338 WRITE(*,*) 'incompatible e3zps_min between grids' 339 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_min) 340 WRITE(*,*) 'child grid :',e3zps_min 341 WRITE(*,*) 'those values should be identical' 342 STOP 343 ENDIF 344 IF( Agrif_Parent(e3zps_rat) .ne. e3zps_rat ) THEN 345 WRITE(*,*) 'incompatible e3zps_rat between grids' 346 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_rat) 347 WRITE(*,*) 'child grid :',e3zps_rat 348 WRITE(*,*) 'those values should be identical' 349 STOP 350 ENDIF 351 ENDIF 352 # endif 353 ! Check passive tracer cell 354 IF( nn_dttrc .ne. 1 ) THEN 355 WRITE(*,*) 'nn_dttrc should be equal to 1' 356 ENDIF 357 ENDIF 358 359 CALL Agrif_Update_trc(0) 360 nbcline_trc = 0 361 ! 362 DEALLOCATE(tabtrtemp) 363 ! 364 END SUBROUTINE Agrif_InitValues_cont_top 365 366 367 SUBROUTINE agrif_declare_var_top 368 !!---------------------------------------------------------------------- 369 !! *** ROUTINE agrif_declare_var_top *** 370 !! 371 !! ** Purpose :: Declaration of TOP variables to be interpolated 372 !!---------------------------------------------------------------------- 373 USE agrif_util 374 USE dom_oce 375 USE trc 376 377 IMPLICIT NONE 378 379 ! 1. Declaration of the type of variable which have to be interpolated 380 !--------------------------------------------------------------------- 381 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jptra/),trn_id) 382 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jptra/),trb_id) 383 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/jpi,jpj,jpk,jptra/),tra_id) 384 # if defined key_offline 385 CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e1u_id) 386 CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e2v_id) 387 # endif 388 389 ! 2. Type of interpolation 390 !------------------------- 391 CALL Agrif_Set_bcinterp(trn_id,interp=AGRIF_linear) 392 CALL Agrif_Set_bcinterp(tra_id,interp=AGRIF_linear) 393 394 # if defined key_offline 395 Call Agrif_Set_bcinterp(e1u_id,interp1=Agrif_linear,interp2=AGRIF_ppm) 396 Call Agrif_Set_bcinterp(e2v_id,interp1=AGRIF_ppm,interp2=Agrif_linear) 397 # endif 398 399 ! 3. Location of interpolation 400 !----------------------------- 401 # if defined key_offline 402 Call Agrif_Set_bc(e1u_id,(/0,0/)) 403 Call Agrif_Set_bc(e2v_id,(/0,0/)) 404 # endif 405 Call Agrif_Set_bc(trn_id,(/0,1/)) 406 Call Agrif_Set_bc(tra_id,(/-3*Agrif_irhox(),0/)) 407 408 ! 5. Update type 409 !--------------- 410 Call Agrif_Set_Updatetype(trn_id, update = AGRIF_Update_Average) 411 Call Agrif_Set_Updatetype(trb_id, update = AGRIF_Update_Average) 412 413 # if defined key_offline 414 Call Agrif_Set_Updatetype(e1u_id,update1 = Agrif_Update_Copy, update2=Agrif_Update_Average) 415 Call Agrif_Set_Updatetype(e2v_id,update1 = Agrif_Update_Average, update2=Agrif_Update_Copy) 416 # endif 417 418 END SUBROUTINE agrif_declare_var_top 562 563 SUBROUTINE Agrif_detect( kg, ksizex ) 564 !!---------------------------------------------------------------------- 565 !! *** ROUTINE Agrif_detect *** 566 !!---------------------------------------------------------------------- 567 USE Agrif_Types 568 ! 569 INTEGER, DIMENSION(2) :: ksizex 570 INTEGER, DIMENSION(ksizex(1),ksizex(2)) :: kg 571 !!---------------------------------------------------------------------- 572 ! 573 RETURN 574 ! 575 END SUBROUTINE Agrif_detect 576 577 578 SUBROUTINE agrif_nemo_init 579 !!---------------------------------------------------------------------- 580 !! *** ROUTINE agrif_init *** 581 !!---------------------------------------------------------------------- 582 USE agrif_oce 583 USE agrif_ice 584 USE in_out_manager 585 USE lib_mpp 586 IMPLICIT NONE 587 ! 588 NAMELIST/namagrif/ nn_cln_update, rn_sponge_tra, rn_sponge_dyn, ln_spc_dyn 589 !!---------------------------------------------------------------------- 590 ! 591 REWIND( numnam ) ! Read namagrif namelist 592 READ ( numnam, namagrif ) 593 ! 594 IF(lwp) THEN ! control print 595 WRITE(numout,*) 596 WRITE(numout,*) 'agrif_nemo_init : AGRIF parameters' 597 WRITE(numout,*) '~~~~~~~~~~~~~~~' 598 WRITE(numout,*) ' Namelist namagrif : set AGRIF parameters' 599 WRITE(numout,*) ' baroclinic update frequency nn_cln_update = ', nn_cln_update 600 WRITE(numout,*) ' sponge coefficient for tracers rn_sponge_tra = ', rn_sponge_tra, ' s' 601 WRITE(numout,*) ' sponge coefficient for dynamics rn_sponge_tra = ', rn_sponge_dyn, ' s' 602 WRITE(numout,*) ' use special values for dynamics ln_spc_dyn = ', ln_spc_dyn 603 WRITE(numout,*) 604 ENDIF 605 ! 606 ! convert DOCTOR namelist name into OLD names 607 nbclineupdate = nn_cln_update 608 visc_tra = rn_sponge_tra 609 visc_dyn = rn_sponge_dyn 610 ! 611 IF( agrif_oce_alloc() > 0 ) CALL ctl_warn('agrif sol_oce_alloc: allocation of arrays failed') 612 # if defined key_lim2 613 IF( agrif_ice_alloc() > 0 ) CALL ctl_stop('agrif agrif_ice_alloc: allocation of arrays failed') 419 614 # endif 420 421 SUBROUTINE Agrif_detect( kg, ksizex ) 422 !!---------------------------------------------------------------------- 423 !! *** ROUTINE Agrif_detect *** 424 !!---------------------------------------------------------------------- 425 USE Agrif_Types 426 ! 427 INTEGER, DIMENSION(2) :: ksizex 428 INTEGER, DIMENSION(ksizex(1),ksizex(2)) :: kg 429 !!---------------------------------------------------------------------- 430 ! 431 RETURN 432 ! 433 END SUBROUTINE Agrif_detect 434 435 436 SUBROUTINE agrif_nemo_init 437 !!---------------------------------------------------------------------- 438 !! *** ROUTINE agrif_init *** 439 !!---------------------------------------------------------------------- 440 USE agrif_oce 441 USE in_out_manager 442 USE lib_mpp 443 IMPLICIT NONE 444 ! 445 NAMELIST/namagrif/ nn_cln_update, rn_sponge_tra, rn_sponge_dyn, ln_spc_dyn 446 !!---------------------------------------------------------------------- 447 ! 448 REWIND( numnam ) ! Read namagrif namelist 449 READ ( numnam, namagrif ) 450 ! 451 IF(lwp) THEN ! control print 452 WRITE(numout,*) 453 WRITE(numout,*) 'agrif_nemo_init : AGRIF parameters' 454 WRITE(numout,*) '~~~~~~~~~~~~~~~' 455 WRITE(numout,*) ' Namelist namagrif : set AGRIF parameters' 456 WRITE(numout,*) ' baroclinic update frequency nn_cln_update = ', nn_cln_update 457 WRITE(numout,*) ' sponge coefficient for tracers rn_sponge_tra = ', rn_sponge_tra, ' s' 458 WRITE(numout,*) ' sponge coefficient for dynamics rn_sponge_tra = ', rn_sponge_dyn, ' s' 459 WRITE(numout,*) ' use special values for dynamics ln_spc_dyn = ', ln_spc_dyn 460 WRITE(numout,*) 461 ENDIF 462 ! 463 ! convert DOCTOR namelist name into OLD names 464 nbclineupdate = nn_cln_update 465 visc_tra = rn_sponge_tra 466 visc_dyn = rn_sponge_dyn 467 ! 468 IF( agrif_oce_alloc() > 0 ) CALL ctl_warn('agrif sol_oce_alloc: allocation of arrays failed') 469 ! 470 END SUBROUTINE agrif_nemo_init 615 ! 616 END SUBROUTINE agrif_nemo_init 471 617 472 618 # if defined key_mpp_mpi 473 619 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 620 SUBROUTINE Agrif_InvLoc( indloc, nprocloc, i, indglob ) 621 !!---------------------------------------------------------------------- 622 !! *** ROUTINE Agrif_detect *** 623 !!---------------------------------------------------------------------- 624 USE dom_oce 625 IMPLICIT NONE 626 ! 627 INTEGER :: indglob, indloc, nprocloc, i 628 !!---------------------------------------------------------------------- 629 ! 630 SELECT CASE( i ) 631 CASE(1) ; indglob = indloc + nimppt(nprocloc+1) - 1 632 CASE(2) ; indglob = indloc + njmppt(nprocloc+1) - 1 633 CASE(3) ; indglob = indloc 634 CASE(4) ; indglob = indloc 635 END SELECT 636 ! 637 END SUBROUTINE Agrif_InvLoc 492 638 493 639 # endif 494 640 495 641 #else 496 497 498 499 500 501 642 SUBROUTINE Subcalledbyagrif 643 !!---------------------------------------------------------------------- 644 !! *** ROUTINE Subcalledbyagrif *** 645 !!---------------------------------------------------------------------- 646 WRITE(*,*) 'Impossible to be here' 647 END SUBROUTINE Subcalledbyagrif 502 648 #endif -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OFF_SRC/domrea.F90
r3294 r3680 113 113 CALL iom_get( inum2, jpdom_data, 'vmask', vmask ) 114 114 CALL iom_get( inum2, jpdom_data, 'fmask', fmask ) 115 116 CALL lbc_lnk( tmask, 'T', 1._wp ) ! Lateral boundary conditions 117 CALL lbc_lnk( umask, 'U', 1._wp ) 118 CALL lbc_lnk( vmask, 'V', 1._wp ) 119 CALL lbc_lnk( fmask, 'F', 1._wp ) 115 120 116 121 #if defined key_c1d -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90
r3625 r3680 61 61 INTEGER , SAVE :: jf_mld ! index of mixed layer deptht 62 62 INTEGER , SAVE :: jf_emp ! index of water flux 63 INTEGER , SAVE :: jf_emps ! index of water flux - concentr/dilution 63 64 INTEGER , SAVE :: jf_qsr ! index of solar radiation 64 65 INTEGER , SAVE :: jf_wnd ! index of wind speed … … 242 243 ENDIF 243 244 ! 244 tsn(:,:,:,jp_tem) = sf_dyn(jf_tem)%fnow(:,:,:) * tmask(:,:,:) ! temperature245 tsn(:,:,:,jp_sal) = sf_dyn(jf_sal)%fnow(:,:,:) * tmask(:,:,:) ! salinity245 tsn(:,:,:,jp_tem) = sf_dyn(jf_tem)%fnow(:,:,:) * tmask(:,:,:) ! temperature 246 tsn(:,:,:,jp_sal) = sf_dyn(jf_sal)%fnow(:,:,:) * tmask(:,:,:) ! salinity 246 247 ! 247 248 CALL eos ( tsn, rhd, rhop ) ! In any case, we need rhop 248 249 CALL zdf_mxl( kt ) ! In any case, we need mxl 249 250 ! 250 avt(:,:,:) = sf_dyn(jf_avt)%fnow(:,:,:) * tmask(:,:,:) ! vertical diffusive coefficient251 un (:,:,:) = sf_dyn(jf_uwd)%fnow(:,:,:) * umask(:,:,:) ! u-velocity252 vn (:,:,:) = sf_dyn(jf_vwd)%fnow(:,:,:) * vmask(:,:,:) ! v-velocity251 avt(:,:,:) = sf_dyn(jf_avt)%fnow(:,:,:) * tmask(:,:,:) ! vertical diffusive coefficient 252 un (:,:,:) = sf_dyn(jf_uwd)%fnow(:,:,:) * umask(:,:,:) ! u-velocity 253 vn (:,:,:) = sf_dyn(jf_vwd)%fnow(:,:,:) * vmask(:,:,:) ! v-velocity 253 254 IF( .NOT.ln_dynwzv ) & ! w-velocity read in file 254 255 wn (:,:,:) = sf_dyn(jf_wwd)%fnow(:,:,:) * tmask(:,:,:) … … 305 306 CALL prt_ctl(tab2d_1=hmld , clinfo1=' hmld - : ', mask1=tmask, ovlap=1 ) 306 307 CALL prt_ctl(tab2d_1=sfx , clinfo1=' sfx - : ', mask1=tmask, ovlap=1 ) 308 CALL prt_ctl(tab2d_1=emp , clinfo1=' emp - : ', mask1=tmask, ovlap=1 ) 307 309 CALL prt_ctl(tab2d_1=wndm , clinfo1=' wspd - : ', mask1=tmask, ovlap=1 ) 308 310 CALL prt_ctl(tab2d_1=qsr , clinfo1=' qsr - : ', mask1=tmask, ovlap=1 ) … … 349 351 sn_sal = FLD_N( 'dyna_grid_T' , 120 , 'vosaline' , .true. , .true. , 'yearly' , '' , '' ) 350 352 sn_mld = FLD_N( 'dyna_grid_T' , 120 , 'somixght' , .true. , .true. , 'yearly' , '' , '' ) 351 sn_emp = FLD_N( 'dyna_grid_T' , 120 , 'sowaflcd' , .true. , .true. , 'yearly' , '' , '' ) 353 sn_emp = FLD_N( 'dyna_grid_T' , 120 , 'sowaflup' , .true. , .true. , 'yearly' , '' , '' ) 354 sn_emps = FLD_N( 'dyna_grid_T' , 120 , 'sowaflcd' , .true. , .true. , 'yearly' , '' , '' ) 352 355 !! sn_emp = FLD_N( 'dyna_grid_T' , 120 , 'sowaflup' , .true. , .true. , 'yearly' , '' , '' ) ! v3.5+ 353 356 sn_sfx = FLD_N( 'dyna_grid_T' , 120 , 'sosfldow' , .true. , .true. , 'yearly' , '' , '' ) ! v3.5+ … … 392 395 ENDIF 393 396 394 jf_tem = 1 ; jf_sal = 2 ; jf_mld = 3 ; jf_emp = 4 ; jf_ ice = 5 ; jf_qsr = 6395 jf_wnd = 7 ; jf_uwd = 8 ; jf_vwd = 9 ; jf_wwd = 10 ; jf_avt = 11 ; jfld = 11396 ! 397 slf_d(jf_tem) = sn_tem ; slf_d(jf_sal) = sn_sal ; slf_d(jf_mld) = sn_mld398 slf_d(jf_emp) = sn_emp ; slf_d(jf_ ice) = sn_ice ; slf_d(jf_qsr) = sn_qsr399 slf_d(jf_ wnd) = sn_wnd ; slf_d(jf_uwd) = sn_uwd ; slf_d(jf_vwd) = sn_vwd400 slf_d(jf_ wwd) = sn_wwd ; slf_d(jf_avt) = sn_avt397 jf_tem = 1 ; jf_sal = 2 ; jf_mld = 3 ; jf_emp = 4 ; jf_emps = 5 ; jf_ice = 6 ; jf_qsr = 7 398 jf_wnd = 8 ; jf_uwd = 9 ; jf_vwd = 10 ; jf_wwd = 11 ; jf_avt = 12 ; jfld = 12 399 ! 400 slf_d(jf_tem) = sn_tem ; slf_d(jf_sal) = sn_sal ; slf_d(jf_mld) = sn_mld 401 slf_d(jf_emp) = sn_emp ; slf_d(jf_emps) = sn_emps ; slf_d(jf_ice) = sn_ice 402 slf_d(jf_qsr) = sn_qsr ; slf_d(jf_wnd) = sn_wnd ; slf_d(jf_avt) = sn_avt 403 slf_d(jf_uwd) = sn_uwd ; slf_d(jf_vwd) = sn_vwd ; slf_d(jf_wwd) = sn_wwd 401 404 ! 402 405 IF( .NOT.ln_degrad ) THEN ! no degrad option 403 406 IF( lk_traldf_eiv .AND. ln_dynbbl ) THEN ! eiv & bbl 404 jf_ubl = 1 2 ; jf_vbl = 13 ; jf_eiw = 14 ; jfld = 14407 jf_ubl = 13 ; jf_vbl = 14 ; jf_eiw = 15 ; jfld = 15 405 408 slf_d(jf_ubl) = sn_ubl ; slf_d(jf_vbl) = sn_vbl ; slf_d(jf_eiw) = sn_eiw 406 409 ENDIF 407 410 IF( .NOT.lk_traldf_eiv .AND. ln_dynbbl ) THEN ! no eiv & bbl 408 jf_ubl = 1 2 ; jf_vbl = 13 ; jfld = 13411 jf_ubl = 13 ; jf_vbl = 14 ; jfld = 14 409 412 slf_d(jf_ubl) = sn_ubl ; slf_d(jf_vbl) = sn_vbl 410 413 ENDIF 411 414 IF( lk_traldf_eiv .AND. .NOT.ln_dynbbl ) THEN ! eiv & no bbl 412 jf_eiw = 1 2 ; jfld = 12; slf_d(jf_eiw) = sn_eiw415 jf_eiw = 13 ; jfld = 13 ; slf_d(jf_eiw) = sn_eiw 413 416 ENDIF 414 417 ELSE 415 jf_ahu = 1 2 ; jf_ahv = 13 ; jf_ahw = 14 ; jfld = 14418 jf_ahu = 13 ; jf_ahv = 14 ; jf_ahw = 15 ; jfld = 15 416 419 slf_d(jf_ahu) = sn_ahu ; slf_d(jf_ahv) = sn_ahv ; slf_d(jf_ahw) = sn_ahw 417 420 IF( lk_traldf_eiv .AND. ln_dynbbl ) THEN ! eiv & bbl 418 jf_ubl = 1 5 ; jf_vbl = 16421 jf_ubl = 16 ; jf_vbl = 17 419 422 slf_d(jf_ubl) = sn_ubl ; slf_d(jf_vbl) = sn_vbl 420 jf_eiu = 1 7 ; jf_eiv = 18 ; jf_eiw = 19 ; jfld = 19423 jf_eiu = 18 ; jf_eiv = 19 ; jf_eiw = 20 ; jfld = 20 421 424 slf_d(jf_eiu) = sn_eiu ; slf_d(jf_eiv) = sn_eiv ; slf_d(jf_eiw) = sn_eiw 422 425 ENDIF 423 426 IF( .NOT.lk_traldf_eiv .AND. ln_dynbbl ) THEN ! no eiv & bbl 424 jf_ubl = 1 5 ; jf_vbl = 16 ; jfld = 16427 jf_ubl = 16 ; jf_vbl = 17 ; jfld = 17 425 428 slf_d(jf_ubl) = sn_ubl ; slf_d(jf_vbl) = sn_vbl 426 429 ENDIF 427 430 IF( lk_traldf_eiv .AND. .NOT.ln_dynbbl ) THEN ! eiv & no bbl 428 jf_eiu = 1 5 ; jf_eiv = 16 ; jf_eiw = 17 ; jfld = 17431 jf_eiu = 16 ; jf_eiv = 17 ; jf_eiw = 18 ; jfld = 18 429 432 slf_d(jf_eiu) = sn_eiu ; slf_d(jf_eiv) = sn_eiv ; slf_d(jf_eiw) = sn_eiw 430 433 ENDIF … … 440 443 ! Open file for each variable to get his number of dimension 441 444 DO ifpr = 1, jfld 442 CALL iom_open( slf_d(ifpr)%clname, inum )445 CALL iom_open( TRIM( cn_dir )//TRIM( slf_d(ifpr)%clname ), inum ) 443 446 idv = iom_varid( inum , slf_d(ifpr)%clvar ) ! id of the variable sdjf%clvar 444 447 idimv = iom_file ( inum )%ndims(idv) ! number of dimension for variable sdjf%clvar -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
r3294 r3680 184 184 ! 185 185 WRITE(numout,*) 186 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean'186 WRITE(numout,*) ' CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' 187 187 WRITE(numout,*) ' NEMO team' 188 188 WRITE(numout,*) ' Ocean General Circulation Model' 189 WRITE(numout,*) ' version 3. 3 (2010) '189 WRITE(numout,*) ' version 3.5 (2012) ' 190 190 WRITE(numout,*) 191 191 WRITE(numout,*) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn2d.F90
r3294 r3680 5 5 !!====================================================================== 6 6 !! History : 3.4 ! 2011 (D. Storkey) new module as part of BDY rewrite 7 !! 3.5 ! 2012 (S. Mocavero, I. Epicoco) Optimization of BDY communications 7 8 !!---------------------------------------------------------------------- 8 9 #if defined key_bdy … … 51 52 CYCLE 52 53 CASE(jp_frs) 53 CALL bdy_dyn2d_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy) )54 CALL bdy_dyn2d_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy), ib_bdy ) 54 55 CASE(jp_flather) 55 CALL bdy_dyn2d_fla( idx_bdy(ib_bdy), dta_bdy(ib_bdy) )56 CALL bdy_dyn2d_fla( idx_bdy(ib_bdy), dta_bdy(ib_bdy), ib_bdy ) 56 57 CASE DEFAULT 57 58 CALL ctl_stop( 'bdy_dyn2d : unrecognised option for open boundaries for barotropic variables' ) … … 61 62 END SUBROUTINE bdy_dyn2d 62 63 63 SUBROUTINE bdy_dyn2d_frs( idx, dta )64 SUBROUTINE bdy_dyn2d_frs( idx, dta, ib_bdy ) 64 65 !!---------------------------------------------------------------------- 65 66 !! *** SUBROUTINE bdy_dyn2d_frs *** … … 74 75 TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices 75 76 TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data 77 INTEGER, INTENT(in) :: ib_bdy ! BDY set index 76 78 !! 77 79 INTEGER :: jb, jk ! dummy loop indices … … 97 99 pv2d(ii,ij) = ( pv2d(ii,ij) + zwgt * ( dta%v2d(jb) - pv2d(ii,ij) ) ) * vmask(ii,ij,1) 98 100 END DO 99 CALL lbc_ lnk( pu2d, 'U', -1.)100 CALL lbc_ lnk( pv2d, 'V', -1.) ! Boundary points should be updated101 CALL lbc_bdy_lnk( pu2d, 'U', -1., ib_bdy ) 102 CALL lbc_bdy_lnk( pv2d, 'V', -1., ib_bdy) ! Boundary points should be updated 101 103 ! 102 104 IF( nn_timing == 1 ) CALL timing_stop('bdy_dyn2d_frs') … … 106 108 107 109 108 SUBROUTINE bdy_dyn2d_fla( idx, dta )110 SUBROUTINE bdy_dyn2d_fla( idx, dta, ib_bdy ) 109 111 !!---------------------------------------------------------------------- 110 112 !! *** SUBROUTINE bdy_dyn2d_fla *** … … 127 129 TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices 128 130 TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data 131 INTEGER, INTENT(in) :: ib_bdy ! BDY set index 129 132 130 133 INTEGER :: jb, igrd ! dummy loop indices … … 177 180 pv2d(ii,ij) = zforc + zcorr * vmask(ii,ij,1) 178 181 END DO 179 CALL lbc_ lnk( pu2d, 'U', -1.) ! Boundary points should be updated180 CALL lbc_ lnk( pv2d, 'V', -1.) !182 CALL lbc_bdy_lnk( pu2d, 'U', -1., ib_bdy ) ! Boundary points should be updated 183 CALL lbc_bdy_lnk( pv2d, 'V', -1., ib_bdy ) ! 181 184 ! 182 185 IF( nn_timing == 1 ) CALL timing_stop('bdy_dyn2d_fla') -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn3d.F90
r3651 r3680 5 5 !!====================================================================== 6 6 !! History : 3.4 ! 2011 (D. Storkey) new module as part of BDY rewrite 7 !! 3.5 ! 2012 (S. Mocavero, I. Epicoco) Optimization of BDY communications 7 8 !!---------------------------------------------------------------------- 8 9 #if defined key_bdy … … 59 60 CYCLE 60 61 CASE(jp_frs) 61 CALL bdy_dyn3d_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt )62 CALL bdy_dyn3d_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt, ib_bdy ) 62 63 CASE(2) 63 CALL bdy_dyn3d_spe( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt )64 CALL bdy_dyn3d_spe( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt, ib_bdy ) 64 65 CASE(3) 65 CALL bdy_dyn3d_zro( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt )66 CALL bdy_dyn3d_zro( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt, ib_bdy ) 66 67 CASE DEFAULT 67 68 CALL ctl_stop( 'bdy_dyn3d : unrecognised option for open boundaries for baroclinic velocities' ) … … 71 72 END SUBROUTINE bdy_dyn3d 72 73 73 SUBROUTINE bdy_dyn3d_spe( idx, dta, kt )74 SUBROUTINE bdy_dyn3d_spe( idx, dta, kt , ib_bdy ) 74 75 !!---------------------------------------------------------------------- 75 76 !! *** SUBROUTINE bdy_dyn3d_spe *** … … 82 83 TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices 83 84 TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data 85 INTEGER, INTENT(in) :: ib_bdy ! BDY set index 84 86 !! 85 87 INTEGER :: jb, jk ! dummy loop indices … … 107 109 END DO 108 110 END DO 109 CALL lbc_ lnk( ua, 'U', -1. ) ; CALL lbc_lnk( va, 'V', -1.) ! Boundary points should be updated111 CALL lbc_bdy_lnk( ua, 'U', -1., ib_bdy ) ; CALL lbc_bdy_lnk( va, 'V', -1.,ib_bdy ) ! Boundary points should be updated 110 112 ! 111 113 IF( kt .eq. nit000 ) CLOSE( unit = 102 ) … … 115 117 END SUBROUTINE bdy_dyn3d_spe 116 118 117 SUBROUTINE bdy_dyn3d_zro( idx, dta, kt )119 SUBROUTINE bdy_dyn3d_zro( idx, dta, kt, ib_bdy ) 118 120 !!---------------------------------------------------------------------- 119 121 !! *** SUBROUTINE bdy_dyn3d_zro *** … … 125 127 TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices 126 128 TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data 129 INTEGER, INTENT(in) :: ib_bdy ! BDY set index 127 130 !! 128 131 INTEGER :: ib, ik ! dummy loop indices … … 151 154 END DO 152 155 ! 153 CALL lbc_ lnk( ua, 'U', -1. ) ; CALL lbc_lnk( va, 'V', -1.) ! Boundary points should be updated156 CALL lbc_bdy_lnk( ua, 'U', -1., ib_bdy ) ; CALL lbc_bdy_lnk( va, 'V', -1.,ib_bdy ) ! Boundary points should be updated 154 157 ! 155 158 IF( kt .eq. nit000 ) CLOSE( unit = 102 ) … … 159 162 END SUBROUTINE bdy_dyn3d_zro 160 163 161 SUBROUTINE bdy_dyn3d_frs( idx, dta, kt )164 SUBROUTINE bdy_dyn3d_frs( idx, dta, kt, ib_bdy ) 162 165 !!---------------------------------------------------------------------- 163 166 !! *** SUBROUTINE bdy_dyn3d_frs *** … … 173 176 TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices 174 177 TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data 178 INTEGER, INTENT(in) :: ib_bdy ! BDY set index 175 179 !! 176 180 INTEGER :: jb, jk ! dummy loop indices … … 200 204 END DO 201 205 END DO 202 CALL lbc_ lnk( ua, 'U', -1. ) ; CALL lbc_lnk( va, 'V', -1.) ! Boundary points should be updated206 CALL lbc_bdy_lnk( ua, 'U', -1., ib_bdy ) ; CALL lbc_bdy_lnk( va, 'V', -1.,ib_bdy ) ! Boundary points should be updated 203 207 ! 204 208 IF( kt .eq. nit000 ) CLOSE( unit = 102 ) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim2.F90
r3610 r3680 6 6 !! History : 3.3 ! 2010-09 (D. Storkey) Original code 7 7 !! 3.4 ! 2011 (D. Storkey) rewrite in preparation for OBC-BDY merge 8 !! 3.5 ! 2012 (S. Mocavero, I. Epicoco) Optimization of BDY communications 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_bdy && defined key_lim2 … … 53 54 CYCLE 54 55 CASE(jp_frs) 55 CALL bdy_ice_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy) )56 CALL bdy_ice_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy), ib_bdy ) 56 57 CASE DEFAULT 57 58 CALL ctl_stop( 'bdy_ice_lim_2 : unrecognised option for open boundaries for ice fields' ) … … 61 62 END SUBROUTINE bdy_ice_lim_2 62 63 63 SUBROUTINE bdy_ice_frs( idx, dta )64 SUBROUTINE bdy_ice_frs( idx, dta, ib_bdy ) 64 65 !!------------------------------------------------------------------------------ 65 66 !! *** SUBROUTINE bdy_ice_frs *** … … 73 74 TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices 74 75 TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data 76 INTEGER, INTENT(in) :: ib_bdy ! BDY set index 75 77 !! 76 78 INTEGER :: jb, jk, jgrd ! dummy loop indices … … 94 96 END DO 95 97 END DO 96 CALL lbc_ lnk( frld, 'T', 1.) ! lateral boundary conditions97 CALL lbc_ lnk( hicif, 'T', 1. ) ; CALL lbc_lnk( hsnif, 'T', 1.)98 CALL lbc_bdy_lnk( frld, 'T', 1., ib_bdy ) ! lateral boundary conditions 99 CALL lbc_bdy_lnk( hicif, 'T', 1., ib_bdy ) ; CALL lbc_bdy_lnk( hsnif, 'T', 1., ib_bdy ) 98 100 ! 99 101 IF( nn_timing == 1 ) CALL timing_stop('bdy_ice_frs') -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90
r3651 r3680 12 12 !! 3.4 ! 2011 (D. Storkey) rewrite in preparation for OBC-BDY merge 13 13 !! 3.4 ! 2012 (J. Chanut) straight open boundary case update 14 !! 3.5 ! 2012 (S. Mocavero, I. Epicoco) Updates for the 15 !! optimization of BDY communications 14 16 !!---------------------------------------------------------------------- 15 17 #if defined key_bdy … … 85 87 INTEGER, ALLOCATABLE, DIMENSION(:,:,:) :: nbrdta ! Discrete distance from rim points 86 88 CHARACTER(LEN=1),DIMENSION(jpbgrd) :: cgrid 89 INTEGER :: com_east, com_west, com_south, com_north ! Flags for boundaries sending 90 INTEGER :: com_east_b, com_west_b, com_south_b, com_north_b ! Flags for boundaries receiving 91 INTEGER :: iw_b(4), ie_b(4), is_b(4), in_b(4) ! Arrays for neighbours coordinates 92 87 93 !! 88 94 NAMELIST/nambdy/ nb_bdy, ln_coords_file, cn_coords_file, & … … 673 679 in = mjg(1) + nlcj - jpjzoom - 1 ! if monotasking and no zoom, in=jpjm1 674 680 681 ALLOCATE( nbondi_bdy(nb_bdy)) 682 ALLOCATE( nbondj_bdy(nb_bdy)) 683 nbondi_bdy(:)=2 684 nbondj_bdy(:)=2 685 ALLOCATE( nbondi_bdy_b(nb_bdy)) 686 ALLOCATE( nbondj_bdy_b(nb_bdy)) 687 nbondi_bdy_b(:)=2 688 nbondj_bdy_b(:)=2 689 690 ! Work out dimensions of boundary data on each neighbour process 691 IF(nbondi .eq. 0) THEN 692 iw_b(1) = jpizoom + nimppt(nowe+1) 693 ie_b(1) = jpizoom + nimppt(nowe+1)+nlcit(nowe+1)-3 694 is_b(1) = jpjzoom + njmppt(nowe+1) 695 in_b(1) = jpjzoom + njmppt(nowe+1)+nlcjt(nowe+1)-3 696 697 iw_b(2) = jpizoom + nimppt(noea+1) 698 ie_b(2) = jpizoom + nimppt(noea+1)+nlcit(noea+1)-3 699 is_b(2) = jpjzoom + njmppt(noea+1) 700 in_b(2) = jpjzoom + njmppt(noea+1)+nlcjt(noea+1)-3 701 ELSEIF(nbondi .eq. 1) THEN 702 iw_b(1) = jpizoom + nimppt(nowe+1) 703 ie_b(1) = jpizoom + nimppt(nowe+1)+nlcit(nowe+1)-3 704 is_b(1) = jpjzoom + njmppt(nowe+1) 705 in_b(1) = jpjzoom + njmppt(nowe+1)+nlcjt(nowe+1)-3 706 ELSEIF(nbondi .eq. -1) THEN 707 iw_b(2) = jpizoom + nimppt(noea+1) 708 ie_b(2) = jpizoom + nimppt(noea+1)+nlcit(noea+1)-3 709 is_b(2) = jpjzoom + njmppt(noea+1) 710 in_b(2) = jpjzoom + njmppt(noea+1)+nlcjt(noea+1)-3 711 ENDIF 712 713 IF(nbondj .eq. 0) THEN 714 iw_b(3) = jpizoom + nimppt(noso+1) 715 ie_b(3) = jpizoom + nimppt(noso+1)+nlcit(noso+1)-3 716 is_b(3) = jpjzoom + njmppt(noso+1) 717 in_b(3) = jpjzoom + njmppt(noso+1)+nlcjt(noso+1)-3 718 719 iw_b(4) = jpizoom + nimppt(nono+1) 720 ie_b(4) = jpizoom + nimppt(nono+1)+nlcit(nono+1)-3 721 is_b(4) = jpjzoom + njmppt(nono+1) 722 in_b(4) = jpjzoom + njmppt(nono+1)+nlcjt(nono+1)-3 723 ELSEIF(nbondj .eq. 1) THEN 724 iw_b(3) = jpizoom + nimppt(noso+1) 725 ie_b(3) = jpizoom + nimppt(noso+1)+nlcit(noso+1)-3 726 is_b(3) = jpjzoom + njmppt(noso+1) 727 in_b(3) = jpjzoom + njmppt(noso+1)+nlcjt(noso+1)-3 728 ELSEIF(nbondj .eq. -1) THEN 729 iw_b(4) = jpizoom + nimppt(nono+1) 730 ie_b(4) = jpizoom + nimppt(nono+1)+nlcit(nono+1)-3 731 is_b(4) = jpjzoom + njmppt(nono+1) 732 in_b(4) = jpjzoom + njmppt(nono+1)+nlcjt(nono+1)-3 733 ENDIF 734 675 735 DO ib_bdy = 1, nb_bdy 676 736 DO igrd = 1, jpbgrd … … 716 776 ! ----------------------------------------------------------------- 717 777 778 com_east = 0 779 com_west = 0 780 com_south = 0 781 com_north = 0 782 783 com_east_b = 0 784 com_west_b = 0 785 com_south_b = 0 786 com_north_b = 0 718 787 DO igrd = 1, jpbgrd 719 788 icount = 0 … … 734 803 idx_bdy(ib_bdy)%nbi(icount,igrd) = nbidta(ib,igrd,ib_bdy)- mig(1)+jpizoom 735 804 idx_bdy(ib_bdy)%nbj(icount,igrd) = nbjdta(ib,igrd,ib_bdy)- mjg(1)+jpjzoom 805 ! check if point has to be sent 806 ii = idx_bdy(ib_bdy)%nbi(icount,igrd) 807 ij = idx_bdy(ib_bdy)%nbj(icount,igrd) 808 if((com_east .ne. 1) .and. (ii .eq. (nlci-1)) .and. (nbondi .le. 0)) then 809 com_east = 1 810 elseif((com_west .ne. 1) .and. (ii .eq. 2) .and. (nbondi .ge. 0) .and. (nbondi .ne. 2)) then 811 com_west = 1 812 endif 813 if((com_south .ne. 1) .and. (ij .eq. 2) .and. (nbondj .ge. 0) .and. (nbondj .ne. 2)) then 814 com_south = 1 815 elseif((com_north .ne. 1) .and. (ij .eq. (nlcj-1)) .and. (nbondj .le. 0)) then 816 com_north = 1 817 endif 736 818 idx_bdy(ib_bdy)%nbr(icount,igrd) = nbrdta(ib,igrd,ib_bdy) 737 819 idx_bdy(ib_bdy)%nbmap(icount,igrd) = ib 738 820 ENDIF 821 ! check if point has to be received from a neighbour 822 IF(nbondi .eq. 0) THEN 823 IF( nbidta(ib,igrd,ib_bdy) >= iw_b(1) .AND. nbidta(ib,igrd,ib_bdy) <= ie_b(1) .AND. & 824 & nbjdta(ib,igrd,ib_bdy) >= is_b(1) .AND. nbjdta(ib,igrd,ib_bdy) <= in_b(1) .AND. & 825 & nbrdta(ib,igrd,ib_bdy) == ir ) THEN 826 ii = nbidta(ib,igrd,ib_bdy)- iw_b(1)+2 827 if((com_west_b .ne. 1) .and. (ii .eq. (nlcit(nowe+1)-1))) then 828 ij = nbjdta(ib,igrd,ib_bdy) - is_b(1)+2 829 if((ij .eq. 2) .and. (nbondj .eq. 0 .or. nbondj .eq. 1)) then 830 com_south = 1 831 elseif((ij .eq. nlcjt(nowe+1)-1) .and. (nbondj .eq. 0 .or. nbondj .eq. -1)) then 832 com_north = 1 833 endif 834 com_west_b = 1 835 endif 836 ENDIF 837 IF( nbidta(ib,igrd,ib_bdy) >= iw_b(2) .AND. nbidta(ib,igrd,ib_bdy) <= ie_b(2) .AND. & 838 & nbjdta(ib,igrd,ib_bdy) >= is_b(2) .AND. nbjdta(ib,igrd,ib_bdy) <= in_b(2) .AND. & 839 & nbrdta(ib,igrd,ib_bdy) == ir ) THEN 840 ii = nbidta(ib,igrd,ib_bdy)- iw_b(2)+2 841 if((com_east_b .ne. 1) .and. (ii .eq. 2)) then 842 ij = nbjdta(ib,igrd,ib_bdy) - is_b(2)+2 843 if((ij .eq. 2) .and. (nbondj .eq. 0 .or. nbondj .eq. 1)) then 844 com_south = 1 845 elseif((ij .eq. nlcjt(noea+1)-1) .and. (nbondj .eq. 0 .or. nbondj .eq. -1)) then 846 com_north = 1 847 endif 848 com_east_b = 1 849 endif 850 ENDIF 851 ELSEIF(nbondi .eq. 1) THEN 852 IF( nbidta(ib,igrd,ib_bdy) >= iw_b(1) .AND. nbidta(ib,igrd,ib_bdy) <= ie_b(1) .AND. & 853 & nbjdta(ib,igrd,ib_bdy) >= is_b(1) .AND. nbjdta(ib,igrd,ib_bdy) <= in_b(1) .AND. & 854 & nbrdta(ib,igrd,ib_bdy) == ir ) THEN 855 ii = nbidta(ib,igrd,ib_bdy)- iw_b(1)+2 856 if((com_west_b .ne. 1) .and. (ii .eq. (nlcit(nowe+1)-1))) then 857 ij = nbjdta(ib,igrd,ib_bdy) - is_b(1)+2 858 if((ij .eq. 2) .and. (nbondj .eq. 0 .or. nbondj .eq. 1)) then 859 com_south = 1 860 elseif((ij .eq. nlcjt(nowe+1)-1) .and. (nbondj .eq. 0 .or. nbondj .eq. -1)) then 861 com_north = 1 862 endif 863 com_west_b = 1 864 endif 865 ENDIF 866 ELSEIF(nbondi .eq. -1) THEN 867 IF( nbidta(ib,igrd,ib_bdy) >= iw_b(2) .AND. nbidta(ib,igrd,ib_bdy) <= ie_b(2) .AND. & 868 & nbjdta(ib,igrd,ib_bdy) >= is_b(2) .AND. nbjdta(ib,igrd,ib_bdy) <= in_b(2) .AND. & 869 & nbrdta(ib,igrd,ib_bdy) == ir ) THEN 870 ii = nbidta(ib,igrd,ib_bdy)- iw_b(2)+2 871 if((com_east_b .ne. 1) .and. (ii .eq. 2)) then 872 ij = nbjdta(ib,igrd,ib_bdy) - is_b(2)+2 873 if((ij .eq. 2) .and. (nbondj .eq. 0 .or. nbondj .eq. 1)) then 874 com_south = 1 875 elseif((ij .eq. nlcjt(noea+1)-1) .and. (nbondj .eq. 0 .or. nbondj .eq. -1)) then 876 com_north = 1 877 endif 878 com_east_b = 1 879 endif 880 ENDIF 881 ENDIF 882 IF(nbondj .eq. 0) THEN 883 IF(com_north_b .ne. 1 .AND. (nbidta(ib,igrd,ib_bdy) == iw_b(4)-1 .OR. nbidta(ib,igrd,ib_bdy) == ie_b(4)+1) .AND. & 884 & nbjdta(ib,igrd,ib_bdy) == is_b(4) .AND. nbrdta(ib,igrd,ib_bdy) == ir) THEN 885 com_north_b = 1 886 ENDIF 887 IF(com_south_b .ne. 1 .AND. (nbidta(ib,igrd,ib_bdy) == iw_b(3)-1 .OR. nbidta(ib,igrd,ib_bdy) == ie_b(3)+1) .AND. & 888 & nbjdta(ib,igrd,ib_bdy) == in_b(3) .AND. nbrdta(ib,igrd,ib_bdy) == ir) THEN 889 com_south_b = 1 890 ENDIF 891 IF( nbidta(ib,igrd,ib_bdy) >= iw_b(3) .AND. nbidta(ib,igrd,ib_bdy) <= ie_b(3) .AND. & 892 & nbjdta(ib,igrd,ib_bdy) >= is_b(3) .AND. nbjdta(ib,igrd,ib_bdy) <= in_b(3) .AND. & 893 & nbrdta(ib,igrd,ib_bdy) == ir ) THEN 894 ij = nbjdta(ib,igrd,ib_bdy)- is_b(3)+2 895 if((com_south_b .ne. 1) .and. (ij .eq. (nlcjt(noso+1)-1))) then 896 com_south_b = 1 897 endif 898 ENDIF 899 IF( nbidta(ib,igrd,ib_bdy) >= iw_b(4) .AND. nbidta(ib,igrd,ib_bdy) <= ie_b(4) .AND. & 900 & nbjdta(ib,igrd,ib_bdy) >= is_b(4) .AND. nbjdta(ib,igrd,ib_bdy) <= in_b(4) .AND. & 901 & nbrdta(ib,igrd,ib_bdy) == ir ) THEN 902 ij = nbjdta(ib,igrd,ib_bdy)- is_b(4)+2 903 if((com_north_b .ne. 1) .and. (ij .eq. 2)) then 904 com_north_b = 1 905 endif 906 ENDIF 907 ELSEIF(nbondj .eq. 1) THEN 908 IF(com_south_b .ne. 1 .AND. (nbidta(ib,igrd,ib_bdy) == iw_b(3)-1 .OR. nbidta(ib,igrd,ib_bdy) == ie_b(3)+1) .AND. & 909 & nbjdta(ib,igrd,ib_bdy) == in_b(3) .AND. nbrdta(ib,igrd,ib_bdy) == ir) THEN 910 com_south_b = 1 911 ENDIF 912 IF( nbidta(ib,igrd,ib_bdy) >= iw_b(3) .AND. nbidta(ib,igrd,ib_bdy) <= ie_b(3) .AND. & 913 & nbjdta(ib,igrd,ib_bdy) >= is_b(3) .AND. nbjdta(ib,igrd,ib_bdy) <= in_b(3) .AND. & 914 & nbrdta(ib,igrd,ib_bdy) == ir ) THEN 915 ij = nbjdta(ib,igrd,ib_bdy)- is_b(3)+2 916 if((com_south_b .ne. 1) .and. (ij .eq. (nlcjt(noso+1)-1))) then 917 com_south_b = 1 918 endif 919 ENDIF 920 ELSEIF(nbondj .eq. -1) THEN 921 IF(com_north_b .ne. 1 .AND. (nbidta(ib,igrd,ib_bdy) == iw_b(4)-1 .OR. nbidta(ib,igrd,ib_bdy) == ie_b(4)+1) .AND. & 922 & nbjdta(ib,igrd,ib_bdy) == is_b(4) .AND. nbrdta(ib,igrd,ib_bdy) == ir) THEN 923 com_north_b = 1 924 ENDIF 925 IF( nbidta(ib,igrd,ib_bdy) >= iw_b(4) .AND. nbidta(ib,igrd,ib_bdy) <= ie_b(4) .AND. & 926 & nbjdta(ib,igrd,ib_bdy) >= is_b(4) .AND. nbjdta(ib,igrd,ib_bdy) <= in_b(4) .AND. & 927 & nbrdta(ib,igrd,ib_bdy) == ir ) THEN 928 ij = nbjdta(ib,igrd,ib_bdy)- is_b(4)+2 929 if((com_north_b .ne. 1) .and. (ij .eq. 2)) then 930 com_north_b = 1 931 endif 932 ENDIF 933 ENDIF 739 934 ENDDO 740 935 ENDDO 741 936 ENDDO 937 ! definition of the i- and j- direction local boundaries arrays 938 ! used for sending the boudaries 939 IF((com_east .eq. 1) .and. (com_west .eq. 1)) THEN 940 nbondi_bdy(ib_bdy) = 0 941 ELSEIF ((com_east .eq. 1) .and. (com_west .eq. 0)) THEN 942 nbondi_bdy(ib_bdy) = -1 943 ELSEIF ((com_east .eq. 0) .and. (com_west .eq. 1)) THEN 944 nbondi_bdy(ib_bdy) = 1 945 ENDIF 946 947 IF((com_north .eq. 1) .and. (com_south .eq. 1)) THEN 948 nbondj_bdy(ib_bdy) = 0 949 ELSEIF ((com_north .eq. 1) .and. (com_south .eq. 0)) THEN 950 nbondj_bdy(ib_bdy) = -1 951 ELSEIF ((com_north .eq. 0) .and. (com_south .eq. 1)) THEN 952 nbondj_bdy(ib_bdy) = 1 953 ENDIF 954 955 ! definition of the i- and j- direction local boundaries arrays 956 ! used for receiving the boudaries 957 IF((com_east_b .eq. 1) .and. (com_west_b .eq. 1)) THEN 958 nbondi_bdy_b(ib_bdy) = 0 959 ELSEIF ((com_east_b .eq. 1) .and. (com_west_b .eq. 0)) THEN 960 nbondi_bdy_b(ib_bdy) = -1 961 ELSEIF ((com_east_b .eq. 0) .and. (com_west_b .eq. 1)) THEN 962 nbondi_bdy_b(ib_bdy) = 1 963 ENDIF 964 965 IF((com_north_b .eq. 1) .and. (com_south_b .eq. 1)) THEN 966 nbondj_bdy_b(ib_bdy) = 0 967 ELSEIF ((com_north_b .eq. 1) .and. (com_south_b .eq. 0)) THEN 968 nbondj_bdy_b(ib_bdy) = -1 969 ELSEIF ((com_north_b .eq. 0) .and. (com_south_b .eq. 1)) THEN 970 nbondj_bdy_b(ib_bdy) = 1 971 ENDIF 742 972 743 973 ! Compute rim weights for FRS scheme -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/BDY/bdytra.F90
r3651 r3680 7 7 !! 3.0 ! 2008-04 (NEMO team) add in the reference version 8 8 !! 3.4 ! 2011 (D. Storkey) rewrite in preparation for OBC-BDY merge 9 !! 3.5 ! 2012 (S. Mocavero, I. Epicoco) Optimization of BDY communications 9 10 !!---------------------------------------------------------------------- 10 11 #if defined key_bdy … … 54 55 CYCLE 55 56 CASE(jp_frs) 56 CALL bdy_tra_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt )57 CALL bdy_tra_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt, ib_bdy ) 57 58 CASE(2) 58 59 CALL bdy_tra_spe( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt ) … … 72 73 END SUBROUTINE bdy_tra 73 74 74 SUBROUTINE bdy_tra_frs( idx, dta, kt )75 SUBROUTINE bdy_tra_frs( idx, dta, kt, ib_bdy ) 75 76 !!---------------------------------------------------------------------- 76 77 !! *** SUBROUTINE bdy_tra_frs *** … … 83 84 TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices 84 85 TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data 86 INTEGER, INTENT(in) :: ib_bdy ! BDY set index 85 87 !! 86 88 REAL(wp) :: zwgt ! boundary weight … … 101 103 END DO 102 104 END DO 105 CALL lbc_bdy_lnk( tsa(:,:,:,jp_tem), 'T', 1., ib_bdy ) ; CALL lbc_bdy_lnk( tsa(:,:,:,jp_sal), 'T', 1., ib_bdy ) ! Boundary points should be updated 103 106 ! 104 107 IF( kt .eq. nit000 ) CLOSE( unit = 102 ) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90
r3294 r3680 19 19 USE dyncor_c1d ! Coriolis term (c1d case) (dyn_cor_1d ) 20 20 USE dynnxt_c1d ! time-stepping (dyn_nxt routine) 21 USE restart ! restart 21 22 22 23 IMPLICIT NONE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90
r3632 r3680 21 21 !!---------------------------------------------------------------------- 22 22 !!---------------------------------------------------------------------- 23 !! dia_dct : compute the transport through a sec.24 !! dia_dct_init : read namelist.25 !! readsec : read sections description and pathway26 !! removepoints : remove points which are common to 2 procs23 !! dia_dct : Compute the transport through a sec. 24 !! dia_dct_init : Read namelist. 25 !! readsec : Read sections description and pathway 26 !! removepoints : Remove points which are common to 2 procs 27 27 !! transport : Compute transport for each sections 28 !! dia_dct_wri : write tranports results in ascii files29 !! interp : compute Temperature/Salinity/density onU-point or V-point28 !! dia_dct_wri : Write tranports results in ascii files 29 !! interp : Compute temperature/salinity/density at U-point or V-point 30 30 !! 31 31 !!---------------------------------------------------------------------- … … 52 52 53 53 !! * Routine accessibility 54 PUBLIC dia_dct ! routine called by step.F90 55 PUBLIC dia_dct_init! routine called by opa.F90 54 PUBLIC dia_dct ! routine called by step.F90 55 PUBLIC dia_dct_init ! routine called by opa.F90 56 PUBLIC diadct_alloc ! routine called by nemo_init in nemogcm.F90 56 57 PRIVATE readsec 57 58 PRIVATE removepoints … … 72 73 INTEGER, PARAMETER :: nb_sec_max = 150 73 74 INTEGER, PARAMETER :: nb_point_max = 2000 74 INTEGER, PARAMETER :: nb_type_class = 14 75 INTEGER, PARAMETER :: nb_type_class = 10 76 INTEGER, PARAMETER :: nb_3d_vars = 3 77 INTEGER, PARAMETER :: nb_2d_vars = 2 75 78 INTEGER :: nb_sec 76 79 … … 92 95 INTEGER :: nb_class ! number of boundaries for density classes 93 96 INTEGER, DIMENSION(nb_point_max) :: direction ! vector direction of the point in the section 94 CHARACTER(len=40),DIMENSION(nb_class_max) :: classname ! c aracteristics of the class97 CHARACTER(len=40),DIMENSION(nb_class_max) :: classname ! characteristics of the class 95 98 REAL(wp), DIMENSION(nb_class_max) :: zsigi ,&! in-situ density classes (99 if you don't want) 96 99 zsigp ,&! potential density classes (99 if you don't want) … … 106 109 TYPE(SECTION),DIMENSION(nb_sec_max) :: secs ! Array of sections 107 110 108 111 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: transports_3d 112 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: transports_2d 113 109 114 CONTAINS 115 116 117 INTEGER FUNCTION diadct_alloc() 118 !!---------------------------------------------------------------------- 119 !! *** FUNCTION diadct_alloc *** 120 !!---------------------------------------------------------------------- 121 INTEGER :: ierr(2) 122 !!---------------------------------------------------------------------- 123 124 ALLOCATE(transports_3d(nb_3d_vars,nb_sec_max,nb_point_max,jpk), STAT=ierr(1) ) 125 ALLOCATE(transports_2d(nb_2d_vars,nb_sec_max,nb_point_max) , STAT=ierr(2) ) 126 127 diadct_alloc = MAXVAL( ierr ) 128 IF( diadct_alloc /= 0 ) CALL ctl_warn('diadct_alloc: failed to allocate arrays') 129 130 END FUNCTION diadct_alloc 110 131 111 132 SUBROUTINE dia_dct_init … … 113 134 !! *** ROUTINE diadct *** 114 135 !! 115 !! ** Purpose: Read the namelist paramet res136 !! ** Purpose: Read the namelist parameters 116 137 !! Open output files 117 138 !! … … 154 175 ENDIF 155 176 177 ! Initialise arrays to zero 178 transports_3d(:,:,:,:)=0.0 179 transports_2d(:,:,:) =0.0 180 156 181 IF( nn_timing == 1 ) CALL timing_stop('dia_dct_init') 157 182 ! … … 163 188 !! *** ROUTINE diadct *** 164 189 !! 165 !! ** Purpose: Compute sections tranport and write it in numdct file 190 !! Purpose :: Compute section transports and write it in numdct files 191 !! 192 !! Method :: All arrays initialised to zero in dct_init 193 !! Each nn_dct time step call subroutine 'transports' for 194 !! each section to sum the transports over each grid cell. 195 !! Each nn_dctwri time step: 196 !! Divide the arrays by the number of summations to gain 197 !! an average value 198 !! Call dia_dct_sum to sum relevant grid boxes to obtain 199 !! totals for each class (density, depth, temp or sal) 200 !! Call dia_dct_wri to write the transports into file 201 !! Reinitialise all relevant arrays to zero 166 202 !!--------------------------------------------------------------------- 167 203 !! * Arguments … … 170 206 !! * Local variables 171 207 INTEGER :: jsec, &! loop on sections 172 iost, &! error for opening fileout173 208 itotal ! nb_sec_max*nb_type_class*nb_class_max 174 209 LOGICAL :: lldebug =.FALSE. ! debug a section 175 CHARACTER(len=160) :: clfileout ! fileout name176 177 210 178 211 INTEGER , DIMENSION(1) :: ish ! tmp array for mpp_sum … … 190 223 ENDIF 191 224 225 ! Initialise arrays 226 zwork(:) = 0.0 227 zsum(:,:,:) = 0.0 228 192 229 IF( lwp .AND. kt==nit000+nn_dct-1 ) THEN 193 230 WRITE(numout,*) " " … … 208 245 209 246 !Compute transport through section 210 CALL transport(secs(jsec),lldebug )247 CALL transport(secs(jsec),lldebug,jsec) 211 248 212 249 ENDDO … … 214 251 IF( MOD(kt,nn_dctwri)==0 )THEN 215 252 216 IF( lwp .AND. kt==nit000+nn_dctwri-1 )WRITE(numout,*)" diadct: write at kt = ",kt253 IF( lwp .AND. kt==nit000+nn_dctwri-1 )WRITE(numout,*)" diadct: average transports and write at kt = ",kt 217 254 255 !! divide arrays by nn_dctwri/nn_dct to obtain average 256 transports_3d(:,:,:,:)=transports_3d(:,:,:,:)/(nn_dctwri/nn_dct) 257 transports_2d(:,:,:) =transports_2d(:,:,:) /(nn_dctwri/nn_dct) 258 259 ! Sum over each class 260 DO jsec=1,nb_sec 261 CALL dia_dct_sum(secs(jsec),jsec) 262 ENDDO 263 218 264 !Sum on all procs 219 265 IF( lk_mpp )THEN … … 233 279 234 280 !nullify transports values after writing 281 transports_3d(:,jsec,:,:)=0. 282 transports_2d(:,jsec,: )=0. 235 283 secs(jsec)%transport(:,:)=0. 236 284 … … 265 313 INTEGER :: isec, iiglo, ijglo, iiloc, ijloc,iost,i1 ,i2 ! temporary integer 266 314 INTEGER :: jsec, jpt ! dummy loop indices 267 ! heat/salt tranport is actived268 315 269 316 INTEGER, DIMENSION(2) :: icoord … … 457 504 !! *** function removepoints 458 505 !! 459 !! ** Purpose :: 460 !! remove points which are common to 2 procs 461 !! 506 !! ** Purpose :: Remove points which are common to 2 procs 462 507 !! 463 508 !---------------------------------------------------------------------------- … … 535 580 END SUBROUTINE removepoints 536 581 537 SUBROUTINE transport(sec,ld_debug )582 SUBROUTINE transport(sec,ld_debug,jsec) 538 583 !!------------------------------------------------------------------------------------------- 539 584 !! *** ROUTINE transport *** 540 585 !! 541 !! ** Purpose : Compute the transport through a section 542 !! 543 !! ** Method :Transport through a given section is equal to the sum of transports 544 !! computed on each proc. 545 !! On each proc,transport is equal to the sum of transport computed through 546 !! segments linking each point of sec%listPoint with the next one. 547 !! 548 !! !BE carefull : 549 !! one section is a sum of segments 550 !! one segment is defined by 2 consectuve points in sec%listPoint 551 !! all points of sec%listPoint are positioned on the F-point of the cell. 586 !! Purpose :: Compute the transport for each point in a section 552 587 !! 553 !! There are several loops: 554 !! loop on the density/temperature/salinity/level classes 555 !! loop on the segment between 2 nodes 556 !! loop on the level jk 557 !! test on the density/temperature/salinity/level 558 !! 559 !! ** Output: sec%transport: volume/mass/ice/heat/salt transport in the 2 directions 560 !! 588 !! Method :: Loop over each segment, and each vertical level and add the transport 589 !! Be aware : 590 !! One section is a sum of segments 591 !! One segment is defined by 2 consecutive points in sec%listPoint 592 !! All points of sec%listPoint are positioned on the F-point of the cell 593 !! 594 !! There are two loops: 595 !! loop on the segment between 2 nodes 596 !! loop on the level jk !! 597 !! 598 !! Output :: Arrays containing the volume,density,heat,salt transports for each i 599 !! point in a section, summed over each nn_dct. 561 600 !! 562 601 !!------------------------------------------------------------------------------------------- … … 564 603 TYPE(SECTION),INTENT(INOUT) :: sec 565 604 LOGICAL ,INTENT(IN) :: ld_debug 605 INTEGER ,INTENT(IN) :: jsec ! numeric identifier of section 566 606 567 607 !! * Local variables 568 INTEGER :: jk,jseg,jclass, &!loop on level/segment/classes 569 isgnu , isgnv ! 570 INTEGER :: ii, ij ! local integer 571 REAL(wp):: zumid , zvmid ,&!U/V velocity on a cell segment 572 zumid_ice , zvmid_ice ,&!U/V ice velocity 573 zTnorm ,&!transport of velocity through one cell's sides 574 ztransp1 , ztransp2 ,&!total transport in directions 1 and 2 575 ztemp1 , ztemp2 ,&!temperature transport " 576 zrhoi1 , zrhoi2 ,&!mass transport " 577 zrhop1 , zrhop2 ,&!mass transport " 578 zsal1 , zsal2 ,&!salinity transport " 579 zice_vol_pos , zice_vol_neg ,&!volume ice transport " 580 zice_surf_pos, zice_surf_neg !surface ice transport " 581 REAL(wp):: ztn, zsn, zrhoi, zrhop, zsshn, zfsdep ! temperature/salinity/ssh/potential density /depth at u/v point 608 INTEGER :: jk, jseg, jclass, &!loop on level/segment/classes 609 isgnu, isgnv ! 610 REAL(wp) :: zumid, zvmid, &!U/V velocity on a cell segment 611 zumid_ice, zvmid_ice, &!U/V ice velocity 612 zTnorm !transport of velocity through one cell's sides 613 REAL(wp) :: ztn, zsn, zrhoi, zrhop, zsshn, zfsdep !temperature/salinity/potential density/ssh/depth at u/v point 582 614 583 615 TYPE(POINT_SECTION) :: k 584 REAL(wp), POINTER, DIMENSION(:,:):: zsum ! 2D work array585 616 !!-------------------------------------------------------- 586 CALL wrk_alloc( nb_type_class , nb_class_max , zsum )587 617 588 618 IF( ld_debug )WRITE(numout,*)' Compute transport' 589 590 !----------------!591 ! INITIALIZATION !592 !----------------!593 zsum = 0._wp594 zice_surf_neg = 0._wp ; zice_surf_pos = 0._wp595 zice_vol_pos = 0._wp ; zice_vol_neg = 0._wp596 619 597 620 !---------------------------! … … 670 693 END SELECT 671 694 672 !------------------------------- 673 ! LOOP ON THE DENSITY CLASSES | 674 !------------------------------- 675 !The computation is made for each density class 676 DO jclass=1,MAX(1,sec%nb_class-1) 677 678 ztransp1=0._wp ; zrhoi1=0._wp ; zrhop1=0._wp ; ztemp1=0._wp ;zsal1=0._wp 679 ztransp2=0._wp ; zrhoi2=0._wp ; zrhop2=0._wp ; ztemp2=0._wp ;zsal2=0._wp 680 681 !---------------------------| 682 ! LOOP ON THE LEVEL | 683 !---------------------------| 684 !Sum of the transport on the vertical 685 DO jk=1,jpk 686 687 688 ! compute temparature, salinity, insitu & potential density, ssh and depth at U/V point 689 SELECT CASE( sec%direction(jseg) ) 690 CASE(0,1) 691 ztn = interp(k%I,k%J,jk,'V',tsn(:,:,:,jp_tem) ) 692 zsn = interp(k%I,k%J,jk,'V',tsn(:,:,:,jp_sal) ) 693 zrhop = interp(k%I,k%J,jk,'V',rhop) 694 zrhoi = interp(k%I,k%J,jk,'V',rhd*rau0+rau0) 695 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I,k%J+1) ) * vmask(k%I,k%J,1) 696 CASE(2,3) 697 ztn = interp(k%I,k%J,jk,'U',tsn(:,:,:,jp_tem) ) 698 zsn = interp(k%I,k%J,jk,'U',tsn(:,:,:,jp_sal) ) 699 zrhop = interp(k%I,k%J,jk,'U',rhop) 700 zrhoi = interp(k%I,k%J,jk,'U',rhd*rau0+rau0) 701 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 702 END SELECT 703 704 zfsdep= gdept(k%I,k%J,jk) 705 706 !----------------------------------------------! 707 !TEST ON THE DENSITY/SALINITY/TEMPERATURE/LEVEL! 708 !----------------------------------------------! 709 710 IF ( ( ((( zrhop .GE. (sec%zsigp(jclass)+1000. )) .AND. & 711 ( zrhop .LE. (sec%zsigp(jclass+1)+1000. ))) .OR. & 712 ( sec%zsigp(jclass) .EQ. 99.)) .AND. & 713 ((( zrhoi .GE. (sec%zsigi(jclass) + 1000. )) .AND. & 714 ( zrhoi .LE. (sec%zsigi(jclass+1)+1000. ))) .OR. & 715 ( sec%zsigi(jclass) .EQ. 99.)) .AND. & 716 ((( zsn .GT. sec%zsal(jclass)) .AND. & 717 ( zsn .LE. sec%zsal(jclass+1))) .OR. & 718 ( sec%zsal(jclass) .EQ. 99.)) .AND. & 719 ((( ztn .GE. sec%ztem(jclass)) .AND. & 720 ( ztn .LE. sec%ztem(jclass+1))) .OR. & 721 ( sec%ztem(jclass) .EQ.99.)) .AND. & 722 ((( zfsdep .GE. sec%zlay(jclass)) .AND. & 723 ( zfsdep .LE. sec%zlay(jclass+1))) .OR. & 724 ( sec%zlay(jclass) .EQ. 99. )))) THEN 725 726 727 !compute velocity with the correct direction 728 SELECT CASE( sec%direction(jseg) ) 729 CASE(0,1) 730 zumid=0. 731 zvmid=isgnv*vn(k%I,k%J,jk)*vmask(k%I,k%J,jk) 732 CASE(2,3) 733 zumid=isgnu*un(k%I,k%J,jk)*umask(k%I,k%J,jk) 734 zvmid=0. 735 END SELECT 736 737 !velocity* cell's length * cell's thickness 738 zTnorm=zumid*e2u(k%I,k%J)* fse3u(k%I,k%J,jk)+ & 739 zvmid*e1v(k%I,k%J)* fse3v(k%I,k%J,jk) 695 !---------------------------| 696 ! LOOP ON THE LEVEL | 697 !---------------------------| 698 !Sum of the transport on the vertical 699 DO jk=1,mbathy(k%I,k%J) 700 701 ! compute temperature, salinity, insitu & potential density, ssh and depth at U/V point 702 SELECT CASE( sec%direction(jseg) ) 703 CASE(0,1) 704 ztn = interp(k%I,k%J,jk,'V',tsn(:,:,:,jp_tem) ) 705 zsn = interp(k%I,k%J,jk,'V',tsn(:,:,:,jp_sal) ) 706 zrhop = interp(k%I,k%J,jk,'V',rhop) 707 zrhoi = interp(k%I,k%J,jk,'V',rhd*rau0+rau0) 708 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I,k%J+1) ) * vmask(k%I,k%J,1) 709 CASE(2,3) 710 ztn = interp(k%I,k%J,jk,'U',tsn(:,:,:,jp_tem) ) 711 zsn = interp(k%I,k%J,jk,'U',tsn(:,:,:,jp_sal) ) 712 zrhop = interp(k%I,k%J,jk,'U',rhop) 713 zrhoi = interp(k%I,k%J,jk,'U',rhd*rau0+rau0) 714 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 715 END SELECT 716 717 zfsdep= gdept(k%I,k%J,jk) 718 719 !compute velocity with the correct direction 720 SELECT CASE( sec%direction(jseg) ) 721 CASE(0,1) 722 zumid=0. 723 zvmid=isgnv*vn(k%I,k%J,jk)*vmask(k%I,k%J,jk) 724 CASE(2,3) 725 zumid=isgnu*un(k%I,k%J,jk)*umask(k%I,k%J,jk) 726 zvmid=0. 727 END SELECT 728 729 !zTnorm=transport through one cell; 730 !velocity* cell's length * cell's thickness 731 zTnorm=zumid*e2u(k%I,k%J)* fse3u(k%I,k%J,jk)+ & 732 zvmid*e1v(k%I,k%J)* fse3v(k%I,k%J,jk) 740 733 741 734 #if ! defined key_vvl 742 !add transport due to free surface743 IF( jk==1 )THEN744 zTnorm = zTnorm + zumid* e2u(k%I,k%J) * zsshn * umask(k%I,k%J,jk) + &745 zvmid* e1v(k%I,k%J) * zsshn * vmask(k%I,k%J,jk)746 ENDIF735 !add transport due to free surface 736 IF( jk==1 )THEN 737 zTnorm = zTnorm + zumid* e2u(k%I,k%J) * zsshn * umask(k%I,k%J,jk) + & 738 zvmid* e1v(k%I,k%J) * zsshn * vmask(k%I,k%J,jk) 739 ENDIF 747 740 #endif 748 !COMPUTE TRANSPORT 749 !zTnorm=transport through one cell for one class 750 !ztransp1 or ztransp2=transport through one cell i 751 ! for one class for one direction 752 IF( zTnorm .GE. 0 )THEN 753 754 ztransp1=zTnorm+ztransp1 755 756 IF ( sec%llstrpond ) THEN 757 ztemp1 = ztemp1 + zTnorm * ztn 758 zsal1 = zsal1 + zTnorm * zsn 759 zrhoi1 = zrhoi1 + zTnorm * zrhoi 760 zrhop1 = zrhop1 + zTnorm * zrhop 761 ENDIF 762 763 ELSE 764 765 ztransp2=(zTnorm)+ztransp2 766 767 IF ( sec%llstrpond ) THEN 768 ztemp2 = ztemp2 + zTnorm * ztn 769 zsal2 = zsal2 + zTnorm * zsn 770 zrhoi2 = zrhoi2 + zTnorm * zrhoi 771 zrhop2 = zrhop2 + zTnorm * zrhop 772 ENDIF 773 ENDIF 774 775 776 ENDIF ! end of density test 777 ENDDO!end of loop on the level 778 779 !ZSUM=TRANSPORT FOR EACH CLASSES FOR THE DIRECTIONS 780 !--------------------------------------------------- 781 zsum(1,jclass) = zsum(1,jclass)+ztransp1 782 zsum(2,jclass) = zsum(2,jclass)+ztransp2 783 IF( sec%llstrpond )THEN 784 zsum(3 ,jclass) = zsum( 3,jclass)+zrhoi1 785 zsum(4 ,jclass) = zsum( 4,jclass)+zrhoi2 786 zsum(5 ,jclass) = zsum( 5,jclass)+zrhop1 787 zsum(6 ,jclass) = zsum( 6,jclass)+zrhop2 788 zsum(7 ,jclass) = zsum( 7,jclass)+ztemp1 789 zsum(8 ,jclass) = zsum( 8,jclass)+ztemp2 790 zsum(9 ,jclass) = zsum( 9,jclass)+zsal1 791 zsum(10,jclass) = zsum(10,jclass)+zsal2 741 !COMPUTE TRANSPORT 742 743 transports_3d(1,jsec,jseg,jk) = transports_3d(1,jsec,jseg,jk) + zTnorm 744 745 IF ( sec%llstrpond ) THEN 746 transports_3d(2,jsec,jseg,jk) = transports_3d(2,jsec,jseg,jk) + zTnorm * ztn * zrhop * rcp 747 transports_3d(3,jsec,jseg,jk) = transports_3d(3,jsec,jseg,jk) + zTnorm * zsn * zrhop * 0.001 792 748 ENDIF 793 749 794 ENDDO !end of loop on the density classes750 ENDDO !end of loop on the level 795 751 796 752 #if defined key_lim2 || defined key_lim3 … … 816 772 zTnorm=zumid_ice*e2u(k%I,k%J)+zvmid_ice*e1v(k%I,k%J) 817 773 818 IF( zTnorm .GE. 0)THEN 819 zice_vol_pos = (zTnorm)* & 820 (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & 821 *(hsnif(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J) + & 822 hicif(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & 823 +zice_vol_pos 824 zice_surf_pos = (zTnorm)* & 825 (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & 826 +zice_surf_pos 827 ELSE 828 zice_vol_neg=(zTnorm)* & 829 (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & 830 *(hsnif(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J) + & 831 hicif(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & 832 +zice_vol_neg 833 zice_surf_neg=(zTnorm)* & 834 (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & 835 +zice_surf_neg 836 ENDIF 837 838 zsum(11,1) = zsum(11,1)+zice_vol_pos 839 zsum(12,1) = zsum(12,1)+zice_vol_neg 840 zsum(13,1) = zsum(13,1)+zice_surf_pos 841 zsum(14,1) = zsum(14,1)+zice_surf_neg 774 transports_2d(1,jsec,jseg) = transports_2d(1,jsec,jseg) + (zTnorm)* & 775 (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & 776 *(hsnif(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J) + & 777 hicif(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) 778 transports_2d(2,jsec,jseg) = transports_2d(2,jsec,jseg) + (zTnorm)* & 779 (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) 842 780 843 781 ENDIF !end of ice case … … 846 784 ENDDO !end of loop on the segment 847 785 848 849 ELSE !if sec%nb_point =0 850 zsum(1:2,:)=0. 851 IF (sec%llstrpond) zsum(3:10,:)=0. 852 zsum( 11:14,:)=0. 853 ENDIF !end of sec%nb_point =0 case 854 855 !-------------------------------| 856 !FINISH COMPUTING TRANSPORTS | 857 !-------------------------------| 858 DO jclass=1,MAX(1,sec%nb_class-1) 859 sec%transport(1,jclass)=sec%transport(1,jclass)+zsum(1,jclass)*1.E-6 860 sec%transport(2,jclass)=sec%transport(2,jclass)+zsum(2,jclass)*1.E-6 861 IF( sec%llstrpond ) THEN 862 IF( zsum(1,jclass) .NE. 0._wp ) THEN 863 sec%transport( 3,jclass) = sec%transport( 3,jclass) + zsum( 3,jclass)/zsum(1,jclass) 864 sec%transport( 5,jclass) = sec%transport( 5,jclass) + zsum( 5,jclass)/zsum(1,jclass) 865 sec%transport( 7,jclass) = sec%transport( 7,jclass) + zsum( 7,jclass) 866 sec%transport( 9,jclass) = sec%transport( 9,jclass) + zsum( 9,jclass) 867 ENDIF 868 IF( zsum(2,jclass) .NE. 0._wp )THEN 869 sec%transport( 4,jclass) = sec%transport( 4,jclass) + zsum( 4,jclass)/zsum(2,jclass) 870 sec%transport( 6,jclass) = sec%transport( 6,jclass) + zsum( 6,jclass)/zsum(2,jclass) 871 sec%transport( 8,jclass) = sec%transport( 8,jclass) + zsum( 8,jclass) 872 sec%transport(10,jclass) = sec%transport(10,jclass) + zsum(10,jclass) 873 ENDIF 874 ELSE 875 sec%transport( 3,jclass) = 0._wp 876 sec%transport( 4,jclass) = 0._wp 877 sec%transport( 5,jclass) = 0._wp 878 sec%transport( 6,jclass) = 0._wp 879 sec%transport( 7,jclass) = 0._wp 880 sec%transport( 8,jclass) = 0._wp 881 sec%transport(10,jclass) = 0._wp 882 ENDIF 883 ENDDO 884 885 IF( sec%ll_ice_section ) THEN 886 sec%transport( 9,1)=sec%transport( 9,1)+zsum( 9,1)*1.E-6 887 sec%transport(10,1)=sec%transport(10,1)+zsum(10,1)*1.E-6 888 sec%transport(11,1)=sec%transport(11,1)+zsum(11,1)*1.E-6 889 sec%transport(12,1)=sec%transport(12,1)+zsum(12,1)*1.E-6 890 ENDIF 891 892 CALL wrk_dealloc( nb_type_class , nb_class_max , zsum ) 786 ENDIF !end of sec%nb_point =0 case 893 787 ! 894 788 END SUBROUTINE transport 789 790 SUBROUTINE dia_dct_sum(sec,jsec) 791 !!------------------------------------------------------------- 792 !! Purpose: Average the transport over nn_dctwri time steps 793 !! and sum over the density/salinity/temperature/depth classes 794 !! 795 !! Method: Sum over relevant grid cells to obtain values 796 !! for each class 797 !! There are several loops: 798 !! loop on the segment between 2 nodes 799 !! loop on the level jk 800 !! loop on the density/temperature/salinity/level classes 801 !! test on the density/temperature/salinity/level 802 !! 803 !! Note: Transport through a given section is equal to the sum of transports 804 !! computed on each proc. 805 !! On each proc,transport is equal to the sum of transport computed through 806 !! segments linking each point of sec%listPoint with the next one. 807 !! 808 !!------------------------------------------------------------- 809 !! * arguments 810 TYPE(SECTION),INTENT(INOUT) :: sec 811 INTEGER ,INTENT(IN) :: jsec ! numeric identifier of section 812 813 TYPE(POINT_SECTION) :: k 814 INTEGER :: jk,jseg,jclass ! dummy variables for looping on level/segment/classes 815 REAL(wp) :: ztn, zsn, zrhoi, zrhop, zsshn, zfsdep ! temperature/salinity/ssh/potential density /depth at u/v point 816 !!------------------------------------------------------------- 817 818 !! Sum the relevant segments to obtain values for each class 819 IF(sec%nb_point .NE. 0)THEN 820 821 !--------------------------------------! 822 ! LOOP ON THE SEGMENT BETWEEN 2 NODES ! 823 !--------------------------------------! 824 DO jseg=1,MAX(sec%nb_point-1,0) 825 826 !------------------------------------------------------------------------------------------- 827 ! Select the appropriate coordinate for computing the velocity of the segment 828 ! 829 ! CASE(0) Case (2) 830 ! ------- -------- 831 ! listPoint(jseg) listPoint(jseg+1) listPoint(jseg) F(i,j) 832 ! F(i,j)----------V(i+1,j)-------F(i+1,j) | 833 ! | 834 ! | 835 ! | 836 ! Case (3) U(i,j) 837 ! -------- | 838 ! | 839 ! listPoint(jseg+1) F(i,j+1) | 840 ! | | 841 ! | | 842 ! | listPoint(jseg+1) F(i,j-1) 843 ! | 844 ! | 845 ! U(i,j+1) 846 ! | Case(1) 847 ! | ------ 848 ! | 849 ! | listPoint(jseg+1) listPoint(jseg) 850 ! | F(i-1,j)-----------V(i,j) -------f(jseg) 851 ! listPoint(jseg) F(i,j) 852 ! 853 !------------------------------------------------------------------------------------------- 854 855 SELECT CASE( sec%direction(jseg) ) 856 CASE(0) ; k = sec%listPoint(jseg) 857 CASE(1) ; k = POINT_SECTION(sec%listPoint(jseg)%I+1,sec%listPoint(jseg)%J) 858 CASE(2) ; k = sec%listPoint(jseg) 859 CASE(3) ; k = POINT_SECTION(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J+1) 860 END SELECT 861 862 !---------------------------| 863 ! LOOP ON THE LEVEL | 864 !---------------------------| 865 !Sum of the transport on the vertical 866 DO jk=1,mbathy(k%I,k%J) 867 868 ! compute temperature, salinity, insitu & potential density, ssh and depth at U/V point 869 SELECT CASE( sec%direction(jseg) ) 870 CASE(0,1) 871 ztn = interp(k%I,k%J,jk,'V',tsn(:,:,:,jp_tem) ) 872 zsn = interp(k%I,k%J,jk,'V',tsn(:,:,:,jp_sal) ) 873 zrhop = interp(k%I,k%J,jk,'V',rhop) 874 zrhoi = interp(k%I,k%J,jk,'V',rhd*rau0+rau0) 875 876 CASE(2,3) 877 ztn = interp(k%I,k%J,jk,'U',tsn(:,:,:,jp_tem) ) 878 zsn = interp(k%I,k%J,jk,'U',tsn(:,:,:,jp_sal) ) 879 zrhop = interp(k%I,k%J,jk,'U',rhop) 880 zrhoi = interp(k%I,k%J,jk,'U',rhd*rau0+rau0) 881 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 882 END SELECT 883 884 zfsdep= gdept(k%I,k%J,jk) 885 886 !------------------------------- 887 ! LOOP ON THE DENSITY CLASSES | 888 !------------------------------- 889 !The computation is made for each density/temperature/salinity/depth class 890 DO jclass=1,MAX(1,sec%nb_class-1) 891 892 !----------------------------------------------! 893 !TEST ON THE DENSITY/SALINITY/TEMPERATURE/LEVEL! 894 !----------------------------------------------! 895 896 IF ( ( & 897 ((( zrhop .GE. (sec%zsigp(jclass)+1000. )) .AND. & 898 ( zrhop .LE. (sec%zsigp(jclass+1)+1000. ))) .OR. & 899 ( sec%zsigp(jclass) .EQ. 99.)) .AND. & 900 901 ((( zrhoi .GE. (sec%zsigi(jclass) + 1000. )) .AND. & 902 ( zrhoi .LE. (sec%zsigi(jclass+1)+1000. ))) .OR. & 903 ( sec%zsigi(jclass) .EQ. 99.)) .AND. & 904 905 ((( zsn .GT. sec%zsal(jclass)) .AND. & 906 ( zsn .LE. sec%zsal(jclass+1))) .OR. & 907 ( sec%zsal(jclass) .EQ. 99.)) .AND. & 908 909 ((( ztn .GE. sec%ztem(jclass)) .AND. & 910 ( ztn .LE. sec%ztem(jclass+1))) .OR. & 911 ( sec%ztem(jclass) .EQ.99.)) .AND. & 912 913 ((( zfsdep .GE. sec%zlay(jclass)) .AND. & 914 ( zfsdep .LE. sec%zlay(jclass+1))) .OR. & 915 ( sec%zlay(jclass) .EQ. 99. )) & 916 )) THEN 917 918 !SUM THE TRANSPORTS FOR EACH CLASSES FOR THE POSITIVE AND NEGATIVE DIRECTIONS 919 !---------------------------------------------------------------------------- 920 IF (transports_3d(1,jsec,jseg,jk) .GE. 0.0) THEN 921 sec%transport(1,jclass) = sec%transport(1,jclass)+transports_3d(1,jsec,jseg,jk)*1.E-6 922 ELSE 923 sec%transport(2,jclass) = sec%transport(2,jclass)+transports_3d(1,jsec,jseg,jk)*1.E-6 924 ENDIF 925 IF( sec%llstrpond )THEN 926 927 IF ( transports_3d(2,jsec,jseg,jk) .GE. 0.0 ) THEN 928 sec%transport(3,jclass) = sec%transport(3,jclass)+transports_3d(2,jsec,jseg,jk) 929 ELSE 930 sec%transport(4,jclass) = sec%transport(4,jclass)+transports_3d(2,jsec,jseg,jk) 931 ENDIF 932 933 IF ( transports_3d(3,jsec,jseg,jk) .GE. 0.0 ) THEN 934 sec%transport(5,jclass) = sec%transport(5,jclass)+transports_3d(3,jsec,jseg,jk) 935 ELSE 936 sec%transport(6,jclass) = sec%transport(6,jclass)+transports_3d(3,jsec,jseg,jk) 937 ENDIF 938 939 ELSE 940 sec%transport( 3,jclass) = 0._wp 941 sec%transport( 4,jclass) = 0._wp 942 sec%transport( 5,jclass) = 0._wp 943 sec%transport( 6,jclass) = 0._wp 944 ENDIF 945 946 ENDIF ! end of test if point is in class 947 948 ENDDO ! end of loop on the classes 949 950 ENDDO ! loop over jk 951 952 #if defined key_lim2 || defined key_lim3 953 954 !ICE CASE 955 IF( sec%ll_ice_section )THEN 956 957 IF ( transports_2d(1,jsec,jseg) .GE. 0.0 ) THEN 958 sec%transport( 7,1) = sec%transport( 7,1)+transports_2d(1,jsec,jseg)*1.E-6 959 ELSE 960 sec%transport( 8,1) = sec%transport( 8,1)+transports_2d(1,jsec,jseg)*1.E-6 961 ENDIF 962 963 IF ( transports_2d(3,jsec,jseg) .GE. 0.0 ) THEN 964 sec%transport( 9,1) = sec%transport( 9,1)+transports_2d(2,jsec,jseg)*1.E-6 965 ELSE 966 sec%transport(10,1) = sec%transport(10,1)+transports_2d(2,jsec,jseg)*1.E-6 967 ENDIF 968 969 ENDIF !end of ice case 970 #endif 971 972 ENDDO !end of loop on the segment 973 974 ELSE !if sec%nb_point =0 975 sec%transport(1:2,:)=0. 976 IF (sec%llstrpond) sec%transport(3:6,:)=0. 977 IF (sec%ll_ice_section) sec%transport(7:10,:)=0. 978 ENDIF !end of sec%nb_point =0 case 979 980 END SUBROUTINE dia_dct_sum 895 981 896 982 SUBROUTINE dia_dct_wri(kt,ksec,sec) … … 905 991 !! 906 992 !! 2. Write heat transports in "heat_transport" 907 !! Unit: Peta W : area * Velocity * T * rh au * Cp / 1.e15993 !! Unit: Peta W : area * Velocity * T * rhop * Cp * 1.e-15 908 994 !! 909 995 !! 3. Write salt transports in "salt_transport" 910 !! Unit: 10^9 g m^3 / s : area * Velocity * S / 1.e6996 !! Unit: 10^9 Kg/m^2/s : area * Velocity * S * rhop * 1.e-9 911 997 !! 912 998 !!------------------------------------------------------------- … … 917 1003 918 1004 !!local declarations 919 INTEGER :: jcl ,ji! Dummy loop1005 INTEGER :: jclass ! Dummy loop 920 1006 CHARACTER(len=2) :: classe ! Classname 921 1007 REAL(wp) :: zbnd1,zbnd2 ! Class bounds 922 1008 REAL(wp) :: zslope ! section's slope coeff 923 1009 ! 924 REAL(wp), POINTER, DIMENSION(:):: zsumclass ! 1D workspace1010 REAL(wp), POINTER, DIMENSION(:):: zsumclasses ! 1D workspace 925 1011 !!------------------------------------------------------------- 926 CALL wrk_alloc(nb_type_class , zsumclass )927 928 zsumclass (:)=0._wp1012 CALL wrk_alloc(nb_type_class , zsumclasses ) 1013 1014 zsumclasses(:)=0._wp 929 1015 zslope = sec%slopeSection 930 1016 931 1017 932 DO jcl=1,MAX(1,sec%nb_class-1) 933 934 ! Mean computation 935 sec%transport(:,jcl)=sec%transport(:,jcl)/(nn_dctwri/nn_dct) 1018 DO jclass=1,MAX(1,sec%nb_class-1) 1019 936 1020 classe = 'N ' 937 1021 zbnd1 = 0._wp 938 1022 zbnd2 = 0._wp 939 zsumclass (1:nb_type_class)=zsumclass(1:nb_type_class)+sec%transport(1:nb_type_class,jcl)1023 zsumclasses(1:nb_type_class)=zsumclasses(1:nb_type_class)+sec%transport(1:nb_type_class,jclass) 940 1024 941 1025 942 1026 !insitu density classes transports 943 IF( ( sec%zsigi(jcl ) .NE. 99._wp ) .AND. &944 ( sec%zsigi(jcl +1) .NE. 99._wp ) )THEN1027 IF( ( sec%zsigi(jclass) .NE. 99._wp ) .AND. & 1028 ( sec%zsigi(jclass+1) .NE. 99._wp ) )THEN 945 1029 classe = 'DI ' 946 zbnd1 = sec%zsigi(jcl )947 zbnd2 = sec%zsigi(jcl +1)1030 zbnd1 = sec%zsigi(jclass) 1031 zbnd2 = sec%zsigi(jclass+1) 948 1032 ENDIF 949 1033 !potential density classes transports 950 IF( ( sec%zsigp(jcl ) .NE. 99._wp ) .AND. &951 ( sec%zsigp(jcl +1) .NE. 99._wp ) )THEN1034 IF( ( sec%zsigp(jclass) .NE. 99._wp ) .AND. & 1035 ( sec%zsigp(jclass+1) .NE. 99._wp ) )THEN 952 1036 classe = 'DP ' 953 zbnd1 = sec%zsigp(jcl )954 zbnd2 = sec%zsigp(jcl +1)1037 zbnd1 = sec%zsigp(jclass) 1038 zbnd2 = sec%zsigp(jclass+1) 955 1039 ENDIF 956 1040 !depth classes transports 957 IF( ( sec%zlay(jcl ) .NE. 99._wp ) .AND. &958 ( sec%zlay(jcl +1) .NE. 99._wp ) )THEN1041 IF( ( sec%zlay(jclass) .NE. 99._wp ) .AND. & 1042 ( sec%zlay(jclass+1) .NE. 99._wp ) )THEN 959 1043 classe = 'Z ' 960 zbnd1 = sec%zlay(jcl )961 zbnd2 = sec%zlay(jcl +1)1044 zbnd1 = sec%zlay(jclass) 1045 zbnd2 = sec%zlay(jclass+1) 962 1046 ENDIF 963 1047 !salinity classes transports 964 IF( ( sec%zsal(jcl ) .NE. 99._wp ) .AND. &965 ( sec%zsal(jcl +1) .NE. 99._wp ) )THEN1048 IF( ( sec%zsal(jclass) .NE. 99._wp ) .AND. & 1049 ( sec%zsal(jclass+1) .NE. 99._wp ) )THEN 966 1050 classe = 'S ' 967 zbnd1 = sec%zsal(jcl )968 zbnd2 = sec%zsal(jcl +1)1051 zbnd1 = sec%zsal(jclass) 1052 zbnd2 = sec%zsal(jclass+1) 969 1053 ENDIF 970 1054 !temperature classes transports 971 IF( ( sec%ztem(jcl ) .NE. 99._wp ) .AND. &972 ( sec%ztem(jcl +1) .NE. 99._wp ) ) THEN1055 IF( ( sec%ztem(jclass) .NE. 99._wp ) .AND. & 1056 ( sec%ztem(jclass+1) .NE. 99._wp ) ) THEN 973 1057 classe = 'T ' 974 zbnd1 = sec%ztem(jcl )975 zbnd2 = sec%ztem(jcl +1)1058 zbnd1 = sec%ztem(jclass) 1059 zbnd2 = sec%ztem(jclass+1) 976 1060 ENDIF 977 1061 978 1062 !write volume transport per class 979 1063 WRITE(numdct_vol,118) ndastp,kt,ksec,sec%name,zslope, & 980 jcl ,classe,zbnd1,zbnd2,&981 sec%transport(1,jcl ),sec%transport(2,jcl), &982 sec%transport(1,jcl )+sec%transport(2,jcl)1064 jclass,classe,zbnd1,zbnd2,& 1065 sec%transport(1,jclass),sec%transport(2,jclass), & 1066 sec%transport(1,jclass)+sec%transport(2,jclass) 983 1067 984 1068 IF( sec%llstrpond )THEN … … 986 1070 !write heat transport per class: 987 1071 WRITE(numdct_heat,119) ndastp,kt,ksec,sec%name,zslope, & 988 jcl ,classe,zbnd1,zbnd2,&989 sec%transport( 7,jcl)*1000._wp*rcp/1.e15,sec%transport(8,jcl)*1000._wp*rcp/1.e15, &990 ( sec%transport( 7,jcl)+sec%transport(8,jcl) )*1000._wp*rcp/1.e151072 jclass,classe,zbnd1,zbnd2,& 1073 sec%transport(3,jclass)*1.e-15,sec%transport(4,jclass)*1.e-15, & 1074 ( sec%transport(3,jclass)+sec%transport(4,jclass) )*1.e-15 991 1075 !write salt transport per class 992 1076 WRITE(numdct_salt,119) ndastp,kt,ksec,sec%name,zslope, & 993 jcl ,classe,zbnd1,zbnd2,&994 sec%transport( 9,jcl)*1000._wp/1.e9,sec%transport(10,jcl)*1000._wp/1.e9,&995 (sec%transport( 9,jcl)+sec%transport(10,jcl))*1000._wp/1.e91077 jclass,classe,zbnd1,zbnd2,& 1078 sec%transport(5,jclass)*1.e-9,sec%transport(6,jclass)*1.e-9,& 1079 (sec%transport(5,jclass)+sec%transport(6,jclass))*1.e-9 996 1080 ENDIF 997 1081 … … 1000 1084 zbnd1 = 0._wp 1001 1085 zbnd2 = 0._wp 1002 jcl =01086 jclass=0 1003 1087 1004 1088 !write total volume transport 1005 1089 WRITE(numdct_vol,118) ndastp,kt,ksec,sec%name,zslope, & 1006 jcl ,"total",zbnd1,zbnd2,&1007 zsumclass (1),zsumclass(2),zsumclass(1)+zsumclass(2)1090 jclass,"total",zbnd1,zbnd2,& 1091 zsumclasses(1),zsumclasses(2),zsumclasses(1)+zsumclasses(2) 1008 1092 1009 1093 IF( sec%llstrpond )THEN … … 1011 1095 !write total heat transport 1012 1096 WRITE(numdct_heat,119) ndastp,kt,ksec,sec%name,zslope, & 1013 jcl ,"total",zbnd1,zbnd2,&1014 zsumclass (7)* 1000._wp*rcp/1.e15,zsumclass(8)* 1000._wp*rcp/1.e15,&1015 (zsumclass (7)+zsumclass(8) )* 1000._wp*rcp/1.e151097 jclass,"total",zbnd1,zbnd2,& 1098 zsumclasses(3)*1.e-15,zsumclasses(4)*1.e-15,& 1099 (zsumclasses(3)+zsumclasses(4) )*1.e-15 1016 1100 !write total salt transport 1017 1101 WRITE(numdct_salt,119) ndastp,kt,ksec,sec%name,zslope, & 1018 jcl ,"total",zbnd1,zbnd2,&1019 zsumclass (9)*1000._wp/1.e9,zsumclass(10)*1000._wp/1.e9,&1020 (zsumclass (9)+zsumclass(10))*1000._wp/1.e91102 jclass,"total",zbnd1,zbnd2,& 1103 zsumclasses(5)*1.e-9,zsumclasses(6)*1.e-9,& 1104 (zsumclasses(5)+zsumclasses(6))*1.e-9 1021 1105 ENDIF 1022 1106 … … 1025 1109 !write total ice volume transport 1026 1110 WRITE(numdct_vol,118) ndastp,kt,ksec,sec%name,zslope,& 1027 jcl ,"ice_vol",zbnd1,zbnd2,&1028 sec%transport( 9,1),sec%transport(10,1),&1029 sec%transport( 9,1)+sec%transport(10,1)1111 jclass,"ice_vol",zbnd1,zbnd2,& 1112 sec%transport(7,1),sec%transport(8,1),& 1113 sec%transport(7,1)+sec%transport(8,1) 1030 1114 !write total ice surface transport 1031 1115 WRITE(numdct_vol,118) ndastp,kt,ksec,sec%name,zslope,& 1032 jcl ,"ice_surf",zbnd1,zbnd2,&1033 sec%transport( 11,1),sec%transport(12,1), &1034 sec%transport( 11,1)+sec%transport(12,1)1116 jclass,"ice_surf",zbnd1,zbnd2,& 1117 sec%transport(9,1),sec%transport(10,1), & 1118 sec%transport(9,1)+sec%transport(10,1) 1035 1119 ENDIF 1036 1120 … … 1038 1122 119 FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3E15.6) 1039 1123 1040 CALL wrk_dealloc(nb_type_class , zsumclass )1124 CALL wrk_dealloc(nb_type_class , zsumclasses ) 1041 1125 END SUBROUTINE dia_dct_wri 1042 1126 … … 1044 1128 !!---------------------------------------------------------------------- 1045 1129 !! 1046 !! Purpose: compute Temperature/Salinity/density at U-point or V-point1130 !! Purpose: compute temperature/salinity/density at U-point or V-point 1047 1131 !! -------- 1048 1132 !! … … 1053 1137 !! 1054 1138 !! 1055 !! | I | I+1 | Z= Temperature/Salinity/density at U-poinT1139 !! | I | I+1 | Z=temperature/salinity/density at U-poinT 1056 1140 !! | | | 1057 !! ---------------------------------------- 1. Veritcal einterpolation: compute zbis1141 !! ---------------------------------------- 1. Veritcal interpolation: compute zbis 1058 1142 !! | | | interpolation between ptab(I,J,K) and ptab(I,J,K+1) 1059 1143 !! | | | zbis = … … 1136 1220 zdep2 = fsdept(ii2,ij2,kk) - zdepu 1137 1221 1138 ! weights1222 ! weights 1139 1223 zwgt1 = SQRT( ( 0.5 * zet1 ) * ( 0.5 * zet1 ) + ( zdep1 * zdep1 ) ) 1140 1224 zwgt2 = SQRT( ( 0.5 * zet2 ) * ( 0.5 * zet2 ) + ( zdep2 * zdep2 ) ) … … 1163 1247 1164 1248 IF( ze3t >= 0. )THEN 1165 ! zbis1249 ! zbis 1166 1250 zbis = ptab(ii2,ij2,kk) + zwgt1 * ( ptab(ii2,ij2,kk-1) - ptab(ii2,ij2,kk) ) 1167 1251 ! result 1168 1252 interp = umask(ii1,ij1,kk) * ( zet2 * ptab(ii1,ij1,kk) + zet1 * zbis )/( zet1 + zet2 ) 1169 1253 ELSE 1170 ! zbis1254 ! zbis 1171 1255 zbis = ptab(ii1,ij1,kk) + zwgt2 * ( ptab(ii1,ij1,kk-1) - ptab(ii1,ij2,kk) ) 1172 1256 ! result … … 1195 1279 END SUBROUTINE dia_dct_init 1196 1280 1197 SUBROUTINE dia_dct( kt ) 1198 INTEGER, INTENT( in ) :: kt! ocean time-step index1281 SUBROUTINE dia_dct( kt ) ! Dummy routine 1282 INTEGER, INTENT( in ) :: kt ! ocean time-step index 1199 1283 WRITE(*,*) 'dia_dct: You should not have seen this print! error?', kt 1200 1284 END SUBROUTINE dia_dct -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
r3294 r3680 32 32 USE ioipsl, ONLY : ymds2ju ! for calendar 33 33 USE prtctl ! Print control 34 USE restart !35 34 USE trc_oce, ONLY : lk_offline ! offline flag 36 35 USE timing ! Timing 36 USE restart ! restart 37 37 38 38 IMPLICIT NONE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90
r3632 r3680 8 8 !! 3.3 ! 2010-11 (G. Madec) add mbk. arrays associated to the deepest ocean level 9 9 !! 4.0 ! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation 10 !! 3.5 ! 2012 (S. Mocavero, I. Epicoco) Add arrays associated 11 !! to the optimization of BDY communications 10 12 !!---------------------------------------------------------------------- 11 13 … … 80 82 INTEGER, PUBLIC :: narea !: number for local area 81 83 INTEGER, PUBLIC :: nbondi, nbondj !: mark of i- and j-direction local boundaries 84 INTEGER, ALLOCATABLE, PUBLIC :: nbondi_bdy(:) !: mark i-direction local boundaries for BDY open boundaries 85 INTEGER, ALLOCATABLE, PUBLIC :: nbondj_bdy(:) !: mark j-direction local boundaries for BDY open boundaries 86 INTEGER, ALLOCATABLE, PUBLIC :: nbondi_bdy_b(:) !: mark i-direction of neighbours local boundaries for BDY open boundaries 87 INTEGER, ALLOCATABLE, PUBLIC :: nbondj_bdy_b(:) !: mark j-direction of neighbours local boundaries for BDY open boundaries 88 82 89 INTEGER, PUBLIC :: npolj !: north fold mark (0, 3 or 4) 83 90 INTEGER, PUBLIC :: nlci, nldi, nlei !: i-dimensions of the local subdomain and its first and last indoor indices … … 174 181 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hifv , hiff !: interface depth between stretching at V--F 175 182 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hift , hifu !: and quasi-uniform spacing T--U points (m) 183 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rx1 !: Maximum grid stiffness ratio 176 184 177 185 !!---------------------------------------------------------------------- … … 294 302 & scosrf(jpi,jpj) , scobot(jpi,jpj) , & 295 303 & hifv (jpi,jpj) , hiff (jpi,jpj) , & 296 & hift (jpi,jpj) , hifu (jpi,jpj) , STAT=ierr(8) )304 & hift (jpi,jpj) , hifu (jpi,jpj) , rx1 (jpi,jpj) , STAT=ierr(8) ) 297 305 298 306 ALLOCATE( mbathy(jpi,jpj) , bathy(jpi,jpj) , & -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
r3632 r3680 36 36 USE dyncor_c1d ! Coriolis term (c1d case) (cor_c1d routine) 37 37 USE timing ! Timing 38 USE lbclnk ! ocean lateral boundary condition (or mpp link) 38 39 39 40 IMPLICIT NONE … … 84 85 CALL dom_zgr ! Vertical mesh and bathymetry 85 86 CALL dom_msk ! Masks 87 IF( ln_sco ) CALL dom_stiff ! Maximum stiffness ratio/hydrostatic consistency 86 88 IF( lk_vvl ) CALL dom_vvl ! Vertical variable mesh 87 89 ! … … 322 324 END SUBROUTINE dom_ctl 323 325 326 SUBROUTINE dom_stiff 327 !!---------------------------------------------------------------------- 328 !! *** ROUTINE dom_stiff *** 329 !! 330 !! ** Purpose : Diagnose maximum grid stiffness/hydrostatic consistency 331 !! 332 !! ** Method : Compute Haney (1991) hydrostatic condition ratio 333 !! Save the maximum in the vertical direction 334 !! (this number is only relevant in s-coordinates) 335 !! 336 !! Haney, R. L., 1991: On the pressure gradient force 337 !! over steep topography in sigma coordinate ocean models. 338 !! J. Phys. Oceanogr., 21, 610???619. 339 !!---------------------------------------------------------------------- 340 INTEGER :: ji, jj, jk 341 REAL(wp) :: zrxmax 342 REAL(wp), DIMENSION(4) :: zr1 343 !!---------------------------------------------------------------------- 344 rx1(:,:) = 0.e0 345 zrxmax = 0.e0 346 zr1(:) = 0.e0 347 348 DO ji = 2, jpim1 349 DO jj = 2, jpjm1 350 DO jk = 1, jpkm1 351 zr1(1) = umask(ji-1,jj ,jk) *abs( (gdepw(ji ,jj ,jk )-gdepw(ji-1,jj ,jk ) & 352 & +gdepw(ji ,jj ,jk+1)-gdepw(ji-1,jj ,jk+1)) & 353 & /(gdepw(ji ,jj ,jk )+gdepw(ji-1,jj ,jk ) & 354 & -gdepw(ji ,jj ,jk+1)-gdepw(ji-1,jj ,jk+1) + rsmall) ) 355 zr1(2) = umask(ji ,jj ,jk) *abs( (gdepw(ji+1,jj ,jk )-gdepw(ji ,jj ,jk ) & 356 & +gdepw(ji+1,jj ,jk+1)-gdepw(ji ,jj ,jk+1)) & 357 & /(gdepw(ji+1,jj ,jk )+gdepw(ji ,jj ,jk ) & 358 & -gdepw(ji+1,jj ,jk+1)-gdepw(ji ,jj ,jk+1) + rsmall) ) 359 zr1(3) = vmask(ji ,jj ,jk) *abs( (gdepw(ji ,jj+1,jk )-gdepw(ji ,jj ,jk ) & 360 & +gdepw(ji ,jj+1,jk+1)-gdepw(ji ,jj ,jk+1)) & 361 & /(gdepw(ji ,jj+1,jk )+gdepw(ji ,jj ,jk ) & 362 & -gdepw(ji ,jj+1,jk+1)-gdepw(ji ,jj ,jk+1) + rsmall) ) 363 zr1(4) = vmask(ji ,jj-1,jk) *abs( (gdepw(ji ,jj ,jk )-gdepw(ji ,jj-1,jk ) & 364 & +gdepw(ji ,jj ,jk+1)-gdepw(ji ,jj-1,jk+1)) & 365 & /(gdepw(ji ,jj ,jk )+gdepw(ji ,jj-1,jk ) & 366 & -gdepw(ji, jj ,jk+1)-gdepw(ji ,jj-1,jk+1) + rsmall) ) 367 zrxmax = MAXVAL(zr1(1:4)) 368 rx1(ji,jj) = MAX(rx1(ji,jj), zrxmax) 369 END DO 370 END DO 371 END DO 372 373 CALL lbc_lnk( rx1, 'T', 1. ) 374 375 zrxmax = MAXVAL(rx1) 376 377 IF( lk_mpp ) CALL mpp_max( zrxmax ) ! max over the global domain 378 379 IF(lwp) THEN 380 WRITE(numout,*) 381 WRITE(numout,*) 'dom_stiff : maximum grid stiffness ratio: ', zrxmax 382 WRITE(numout,*) '~~~~~~~~~' 383 ENDIF 384 385 END SUBROUTINE dom_stiff 386 387 388 324 389 !!====================================================================== 325 390 END MODULE domain -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/domwri.F90
r3294 r3680 172 172 173 173 IF( ln_sco ) THEN ! s-coordinate 174 CALL iom_rstput( 0, 0, inum4, 'hbatt', hbatt ) ! ! depth175 CALL iom_rstput( 0, 0, inum4, 'hbatu', hbatu ) 174 CALL iom_rstput( 0, 0, inum4, 'hbatt', hbatt ) 175 CALL iom_rstput( 0, 0, inum4, 'hbatu', hbatu ) 176 176 CALL iom_rstput( 0, 0, inum4, 'hbatv', hbatv ) 177 177 CALL iom_rstput( 0, 0, inum4, 'hbatf', hbatf ) … … 187 187 CALL iom_rstput( 0, 0, inum4, 'e3v', e3v ) 188 188 CALL iom_rstput( 0, 0, inum4, 'e3w', e3w ) 189 ! 190 CALL iom_rstput( 0, 0, inum4, 'gdept_0' , gdept_0 ) ! ! stretched system 191 CALL iom_rstput( 0, 0, inum4, 'gdepw_0' , gdepw_0 ) 189 CALL iom_rstput( 0, 0, inum4, 'rx1', rx1 ) ! ! Max. grid stiffness ratio 190 ! 191 CALL iom_rstput( 0, 0, inum4, 'gdept' , gdept ) ! ! stretched system 192 CALL iom_rstput( 0, 0, inum4, 'gdepw' , gdepw ) 192 193 ENDIF 193 194 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
r3632 r3680 15 15 !! 3.2 ! 2009-07 (R. Benshila) Suppression of rigid-lid option 16 16 !! 3.3 ! 2010-11 (G. Madec) add mbk. arrays associated to the deepest ocean level 17 !! 3.4 ! 2012-08 (J. Siddorn) added Siddorn and Furner stretching function 17 18 !!---------------------------------------------------------------------- 18 19 … … 27 28 !! zgr_zps : z-coordinate with partial steps 28 29 !! zgr_sco : s-coordinate 29 !! fssig : sigma coordinate non-dimensional function 30 !! dfssig : derivative of the sigma coordinate function !!gm (currently missing!) 30 !! fssig : tanh stretch function 31 !! fssig1 : Song and Haidvogel 1994 stretch function 32 !! fgamma : Siddorn and Furner 2012 stretching function 31 33 !!--------------------------------------------------------------------- 32 34 USE oce ! ocean variables … … 47 49 48 50 ! !!* Namelist namzgr_sco * 51 LOGICAL :: ln_s_sh94 = .false. ! use hybrid s-sig Song and Haidvogel 1994 stretching function fssig1 (ln_sco=T) 52 LOGICAL :: ln_s_sf12 = .true. ! use hybrid s-z-sig Siddorn and Furner 2012 stretching function fgamma (ln_sco=T) 53 ! 49 54 REAL(wp) :: rn_sbot_min = 300._wp ! minimum depth of s-bottom surface (>0) (m) 50 55 REAL(wp) :: rn_sbot_max = 5250._wp ! maximum depth of s-bottom surface (= ocean depth) (>0) (m) 56 REAL(wp) :: rn_rmax = 0.15_wp ! maximum cut-off r-value allowed (0<rn_rmax<1) 57 REAL(wp) :: rn_hc = 150._wp ! Critical depth for transition from sigma to stretched coordinates 58 ! Song and Haidvogel 1994 stretching parameters 51 59 REAL(wp) :: rn_theta = 6.00_wp ! surface control parameter (0<=rn_theta<=20) 52 60 REAL(wp) :: rn_thetb = 0.75_wp ! bottom control parameter (0<=rn_thetb<= 1) 53 REAL(wp) :: rn_rmax = 0.15_wp ! maximum cut-off r-value allowed (0<rn_rmax<1) 54 LOGICAL :: ln_s_sigma = .false. ! use hybrid s-sigma -coordinate & stretching function fssig1 (ln_sco=T) 55 REAL(wp) :: rn_bb = 0.80_wp ! stretching parameter for song and haidvogel stretching 61 REAL(wp) :: rn_bb = 0.80_wp ! stretching parameter 56 62 ! ! ( rn_bb=0; top only, rn_bb =1; top and bottom) 57 REAL(wp) :: rn_hc = 150._wp ! Critical depth for s-sigma coordinates 63 ! Siddorn and Furner stretching parameters 64 LOGICAL :: ln_sigcrit = .false. ! use sigma coordinates below critical depth (T) or Z coordinates (F) for Siddorn & Furner stretch 65 REAL(wp) :: rn_alpha = 4.4_wp ! control parameter ( > 1 stretch towards surface, < 1 towards seabed) 66 REAL(wp) :: rn_efold = 0.0_wp ! efold length scale for transition to stretched coord 67 REAL(wp) :: rn_zs = 1.0_wp ! depth of surface grid box 68 ! bottom cell depth (Zb) is a linear function of water depth Zb = H*a + b 69 REAL(wp) :: rn_zb_a = 0.024_wp ! bathymetry scaling factor for calculating Zb 70 REAL(wp) :: rn_zb_b = -0.2_wp ! offset for calculating Zb 58 71 59 72 !! * Substitutions … … 1034 1047 END SUBROUTINE zgr_zps 1035 1048 1036 1037 FUNCTION fssig( pk ) RESULT( pf )1038 !!----------------------------------------------------------------------1039 !! *** ROUTINE eos_init ***1040 !!1041 !! ** Purpose : provide the analytical function in s-coordinate1042 !!1043 !! ** Method : the function provide the non-dimensional position of1044 !! T and W (i.e. between 0 and 1)1045 !! T-points at integer values (between 1 and jpk)1046 !! W-points at integer values - 1/2 (between 0.5 and jpk-0.5)1047 !!----------------------------------------------------------------------1048 REAL(wp), INTENT(in) :: pk ! continuous "k" coordinate1049 REAL(wp) :: pf ! sigma value1050 !!----------------------------------------------------------------------1051 !1052 pf = ( TANH( rn_theta * ( -(pk-0.5_wp) / REAL(jpkm1) + rn_thetb ) ) &1053 & - TANH( rn_thetb * rn_theta ) ) &1054 & * ( COSH( rn_theta ) &1055 & + COSH( rn_theta * ( 2._wp * rn_thetb - 1._wp ) ) ) &1056 & / ( 2._wp * SINH( rn_theta ) )1057 !1058 END FUNCTION fssig1059 1060 1061 FUNCTION fssig1( pk1, pbb ) RESULT( pf1 )1062 !!----------------------------------------------------------------------1063 !! *** ROUTINE eos_init ***1064 !!1065 !! ** Purpose : provide the Song and Haidvogel version of the analytical function in s-coordinate1066 !!1067 !! ** Method : the function provides the non-dimensional position of1068 !! T and W (i.e. between 0 and 1)1069 !! T-points at integer values (between 1 and jpk)1070 !! W-points at integer values - 1/2 (between 0.5 and jpk-0.5)1071 !!----------------------------------------------------------------------1072 REAL(wp), INTENT(in) :: pk1 ! continuous "k" coordinate1073 REAL(wp), INTENT(in) :: pbb ! Stretching coefficient1074 REAL(wp) :: pf1 ! sigma value1075 !!----------------------------------------------------------------------1076 !1077 IF ( rn_theta == 0 ) then ! uniform sigma1078 pf1 = - ( pk1 - 0.5_wp ) / REAL( jpkm1 )1079 ELSE ! stretched sigma1080 pf1 = ( 1._wp - pbb ) * ( SINH( rn_theta*(-(pk1-0.5_wp)/REAL(jpkm1)) ) ) / SINH( rn_theta ) &1081 & + pbb * ( (TANH( rn_theta*( (-(pk1-0.5_wp)/REAL(jpkm1)) + 0.5_wp) ) - TANH( 0.5_wp * rn_theta ) ) &1082 & / ( 2._wp * TANH( 0.5_wp * rn_theta ) ) )1083 ENDIF1084 !1085 END FUNCTION fssig11086 1087 1088 1049 SUBROUTINE zgr_sco 1089 1050 !!---------------------------------------------------------------------- … … 1104 1065 !! hbatv = mj( hbatt ) 1105 1066 !! hbatf = mi( mj( hbatt ) ) 1106 !! - Compute gsigt, gsigw, esigt,esigw from an analytical1067 !! - Compute z_gsigt, z_gsigw, z_esigt, z_esigw from an analytical 1107 1068 !! function and its derivative given as function. 1108 !! gsigt(k) = fssig (k )1109 !! gsigw(k) = fssig (k-0.5)1110 !! esigt(k) = fsdsig(k )1111 !! esigw(k) = fsdsig(k-0.5)1112 !! Th is routine is given as an example, it mustbe modified1113 !! following the user s desiderata. nevertheless, the output as1069 !! z_gsigt(k) = fssig (k ) 1070 !! z_gsigw(k) = fssig (k-0.5) 1071 !! z_esigt(k) = fsdsig(k ) 1072 !! z_esigw(k) = fsdsig(k-0.5) 1073 !! Three options for stretching are give, and they can be modified 1074 !! following the users requirements. Nevertheless, the output as 1114 1075 !! well as the way to compute the model levels and scale factors 1115 !! must be respected in order to insure second order a !!uracy1076 !! must be respected in order to insure second order accuracy 1116 1077 !! schemes. 1117 1078 !! 1118 !! Reference : Madec, Lott, Delecluse and Crepon, 1996. JPO, 26, 1393-1408. 1079 !! The three methods for stretching available are: 1080 !! 1081 !! s_sh94 (Song and Haidvogel 1994) 1082 !! a sinh/tanh function that allows sigma and stretched sigma 1083 !! 1084 !! s_sf12 (Siddorn and Furner 2012?) 1085 !! allows the maintenance of fixed surface and or 1086 !! bottom cell resolutions (cf. geopotential coordinates) 1087 !! within an analytically derived stretched S-coordinate framework. 1088 !! 1089 !! s_tanh (Madec et al 1996) 1090 !! a cosh/tanh function that gives stretched coordinates 1091 !! 1119 1092 !!---------------------------------------------------------------------- 1120 1093 ! 1121 1094 INTEGER :: ji, jj, jk, jl ! dummy loop argument 1122 1095 INTEGER :: iip1, ijp1, iim1, ijm1 ! temporary integers 1123 REAL(wp) :: z coeft, zcoefw, zrmax, ztaper ! temporary scalars1096 REAL(wp) :: zrmax, ztaper ! temporary scalars 1124 1097 ! 1125 1098 REAL(wp), POINTER, DIMENSION(:,: ) :: zenv, ztmp, zmsk, zri, zrj, zhbat 1126 REAL(wp), POINTER, DIMENSION(:,:,:) :: gsigw3, gsigt3, gsi3w3 1127 REAL(wp), POINTER, DIMENSION(:,:,:) :: esigt3, esigw3, esigtu3, esigtv3, esigtf3, esigwu3, esigwv3 1128 1129 NAMELIST/namzgr_sco/ rn_sbot_max, rn_sbot_min, rn_theta, rn_thetb, rn_rmax, ln_s_sigma, rn_bb, rn_hc 1130 !!---------------------------------------------------------------------- 1099 1100 NAMELIST/namzgr_sco/ln_s_sh94, ln_s_sf12, ln_sigcrit, rn_sbot_min, rn_sbot_max, rn_hc, rn_rmax,rn_theta, & 1101 rn_thetb, rn_bb, rn_alpha, rn_efold, rn_zs, rn_zb_a, rn_zb_b 1102 !!---------------------------------------------------------------------- 1131 1103 ! 1132 1104 IF( nn_timing == 1 ) CALL timing_start('zgr_sco') 1133 1105 ! 1134 1106 CALL wrk_alloc( jpi, jpj, zenv, ztmp, zmsk, zri, zrj, zhbat ) 1135 CALL wrk_alloc( jpi, jpj, jpk, gsigw3, gsigt3, gsi3w3 )1136 CALL wrk_alloc( jpi, jpj, jpk, esigt3, esigw3, esigtu3, esigtv3, esigtf3, esigwu3, esigwv3 )1137 1107 ! 1138 1108 REWIND( numnam ) ! Read Namelist namzgr_sco : sigma-stretching parameters … … 1144 1114 WRITE(numout,*) '~~~~~~~~~~~' 1145 1115 WRITE(numout,*) ' Namelist namzgr_sco' 1146 WRITE(numout,*) ' sigma-stretching coeffs ' 1147 WRITE(numout,*) ' maximum depth of s-bottom surface (>0) rn_sbot_max = ' ,rn_sbot_max 1148 WRITE(numout,*) ' minimum depth of s-bottom surface (>0) rn_sbot_min = ' ,rn_sbot_min 1149 WRITE(numout,*) ' surface control parameter (0<=rn_theta<=20) rn_theta = ', rn_theta 1150 WRITE(numout,*) ' bottom control parameter (0<=rn_thetb<= 1) rn_thetb = ', rn_thetb 1151 WRITE(numout,*) ' maximum cut-off r-value allowed rn_rmax = ', rn_rmax 1152 WRITE(numout,*) ' Hybrid s-sigma-coordinate ln_s_sigma = ', ln_s_sigma 1153 WRITE(numout,*) ' stretching parameter (song and haidvogel) rn_bb = ', rn_bb 1154 WRITE(numout,*) ' Critical depth rn_hc = ', rn_hc 1155 ENDIF 1156 1157 gsigw3 = 0._wp ; gsigt3 = 0._wp ; gsi3w3 = 0._wp 1158 esigt3 = 0._wp ; esigw3 = 0._wp 1159 esigtu3 = 0._wp ; esigtv3 = 0._wp ; esigtf3 = 0._wp 1160 esigwu3 = 0._wp ; esigwv3 = 0._wp 1116 WRITE(numout,*) ' stretching coeffs ' 1117 WRITE(numout,*) ' maximum depth of s-bottom surface (>0) rn_sbot_max = ',rn_sbot_max 1118 WRITE(numout,*) ' minimum depth of s-bottom surface (>0) rn_sbot_min = ',rn_sbot_min 1119 WRITE(numout,*) ' Critical depth rn_hc = ',rn_hc 1120 WRITE(numout,*) ' maximum cut-off r-value allowed rn_rmax = ',rn_rmax 1121 WRITE(numout,*) ' Song and Haidvogel 1994 stretching ln_s_sh94 = ',ln_s_sh94 1122 WRITE(numout,*) ' Song and Haidvogel 1994 stretching coefficients' 1123 WRITE(numout,*) ' surface control parameter (0<=rn_theta<=20) rn_theta = ',rn_theta 1124 WRITE(numout,*) ' bottom control parameter (0<=rn_thetb<= 1) rn_thetb = ',rn_thetb 1125 WRITE(numout,*) ' stretching parameter (song and haidvogel) rn_bb = ',rn_bb 1126 WRITE(numout,*) ' Siddorn and Furner 2012 stretching ln_s_sf12 = ',ln_s_sf12 1127 WRITE(numout,*) ' switching to sigma (T) or Z (F) at H<Hc ln_sigcrit = ',ln_sigcrit 1128 WRITE(numout,*) ' Siddorn and Furner 2012 stretching coefficients' 1129 WRITE(numout,*) ' stretchin parameter ( >1 surface; <1 bottom) rn_alpha = ',rn_alpha 1130 WRITE(numout,*) ' e-fold length scale for transition region rn_efold = ',rn_efold 1131 WRITE(numout,*) ' Surface cell depth (Zs) (m) rn_zs = ',rn_zs 1132 WRITE(numout,*) ' Bathymetry multiplier for Zb rn_zb_a = ',rn_zb_a 1133 WRITE(numout,*) ' Offset for Zb rn_zb_b = ',rn_zb_b 1134 WRITE(numout,*) ' Bottom cell (Zb) (m) = H*rn_zb_a + rn_zb_b' 1135 ENDIF 1161 1136 1162 1137 hift(:,:) = rn_sbot_min ! set the minimum depth for the s-coordinate … … 1352 1327 ! non-dimensional "sigma" for model level depth at w- and t-levels 1353 1328 1354 IF( ln_s_sigma ) THEN ! Song and Haidvogel style stretched sigma for depths 1355 ! ! below rn_hc, with uniform sigma in shallower waters 1356 DO ji = 1, jpi 1357 DO jj = 1, jpj 1358 1359 IF( hbatt(ji,jj) > rn_hc ) THEN !deep water, stretched sigma 1360 DO jk = 1, jpk 1361 gsigw3(ji,jj,jk) = -fssig1( REAL(jk,wp)-0.5_wp, rn_bb ) 1362 gsigt3(ji,jj,jk) = -fssig1( REAL(jk,wp) , rn_bb ) 1363 END DO 1364 ELSE ! shallow water, uniform sigma 1365 DO jk = 1, jpk 1366 gsigw3(ji,jj,jk) = REAL(jk-1,wp) / REAL(jpk-1,wp) 1367 gsigt3(ji,jj,jk) = ( REAL(jk-1,wp) + 0.5_wp ) / REAL(jpk-1,wp) 1368 END DO 1369 ENDIF 1370 IF( nprint == 1 .AND. lwp ) WRITE(numout,*) 'gsigw3 1 jpk ', gsigw3(ji,jj,1), gsigw3(ji,jj,jpk) 1371 ! 1372 DO jk = 1, jpkm1 1373 esigt3(ji,jj,jk ) = gsigw3(ji,jj,jk+1) - gsigw3(ji,jj,jk) 1374 esigw3(ji,jj,jk+1) = gsigt3(ji,jj,jk+1) - gsigt3(ji,jj,jk) 1375 END DO 1376 esigw3(ji,jj,1 ) = 2._wp * ( gsigt3(ji,jj,1 ) - gsigw3(ji,jj,1 ) ) 1377 esigt3(ji,jj,jpk) = 2._wp * ( gsigt3(ji,jj,jpk) - gsigw3(ji,jj,jpk) ) 1378 ! 1379 ! Coefficients for vertical depth as the sum of e3w scale factors 1380 gsi3w3(ji,jj,1) = 0.5_wp * esigw3(ji,jj,1) 1381 DO jk = 2, jpk 1382 gsi3w3(ji,jj,jk) = gsi3w3(ji,jj,jk-1) + esigw3(ji,jj,jk) 1383 END DO 1384 ! 1385 DO jk = 1, jpk 1386 zcoeft = ( REAL(jk,wp) - 0.5_wp ) / REAL(jpkm1,wp) 1387 zcoefw = ( REAL(jk,wp) - 1.0_wp ) / REAL(jpkm1,wp) 1388 gdept (ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*gsigt3(ji,jj,jk)+rn_hc*zcoeft ) 1389 gdepw (ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*gsigw3(ji,jj,jk)+rn_hc*zcoefw ) 1390 gdep3w(ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*gsi3w3(ji,jj,jk)+rn_hc*zcoeft ) 1391 END DO 1392 ! 1393 END DO ! for all jj's 1394 END DO ! for all ji's 1395 1396 DO ji = 1, jpim1 1397 DO jj = 1, jpjm1 1398 DO jk = 1, jpk 1399 esigtu3(ji,jj,jk) = ( hbatt(ji,jj)*esigt3(ji,jj,jk)+hbatt(ji+1,jj)*esigt3(ji+1,jj,jk) ) & 1400 & / ( hbatt(ji,jj)+hbatt(ji+1,jj) ) 1401 esigtv3(ji,jj,jk) = ( hbatt(ji,jj)*esigt3(ji,jj,jk)+hbatt(ji,jj+1)*esigt3(ji,jj+1,jk) ) & 1402 & / ( hbatt(ji,jj)+hbatt(ji,jj+1) ) 1403 esigtf3(ji,jj,jk) = ( hbatt(ji,jj)*esigt3(ji,jj,jk)+hbatt(ji+1,jj)*esigt3(ji+1,jj,jk) & 1404 & + hbatt(ji,jj+1)*esigt3(ji,jj+1,jk)+hbatt(ji+1,jj+1)*esigt3(ji+1,jj+1,jk) ) & 1405 & / ( hbatt(ji,jj)+hbatt(ji+1,jj)+hbatt(ji,jj+1)+hbatt(ji+1,jj+1) ) 1406 esigwu3(ji,jj,jk) = ( hbatt(ji,jj)*esigw3(ji,jj,jk)+hbatt(ji+1,jj)*esigw3(ji+1,jj,jk) ) & 1407 & / ( hbatt(ji,jj)+hbatt(ji+1,jj) ) 1408 esigwv3(ji,jj,jk) = ( hbatt(ji,jj)*esigw3(ji,jj,jk)+hbatt(ji,jj+1)*esigw3(ji,jj+1,jk) ) & 1409 & / ( hbatt(ji,jj)+hbatt(ji,jj+1) ) 1410 ! 1411 e3t(ji,jj,jk) = ( (hbatt(ji,jj)-rn_hc)*esigt3 (ji,jj,jk) + rn_hc/FLOAT(jpkm1) ) 1412 e3u(ji,jj,jk) = ( (hbatu(ji,jj)-rn_hc)*esigtu3(ji,jj,jk) + rn_hc/FLOAT(jpkm1) ) 1413 e3v(ji,jj,jk) = ( (hbatv(ji,jj)-rn_hc)*esigtv3(ji,jj,jk) + rn_hc/FLOAT(jpkm1) ) 1414 e3f(ji,jj,jk) = ( (hbatf(ji,jj)-rn_hc)*esigtf3(ji,jj,jk) + rn_hc/FLOAT(jpkm1) ) 1415 ! 1416 e3w (ji,jj,jk) = ( (hbatt(ji,jj)-rn_hc)*esigw3 (ji,jj,jk) + rn_hc/FLOAT(jpkm1) ) 1417 e3uw(ji,jj,jk) = ( (hbatu(ji,jj)-rn_hc)*esigwu3(ji,jj,jk) + rn_hc/FLOAT(jpkm1) ) 1418 e3vw(ji,jj,jk) = ( (hbatv(ji,jj)-rn_hc)*esigwv3(ji,jj,jk) + rn_hc/FLOAT(jpkm1) ) 1419 END DO 1420 END DO 1421 END DO 1422 1423 CALL lbc_lnk( e3t , 'T', 1._wp ) 1424 CALL lbc_lnk( e3u , 'U', 1._wp ) 1425 CALL lbc_lnk( e3v , 'V', 1._wp ) 1426 CALL lbc_lnk( e3f , 'F', 1._wp ) 1427 CALL lbc_lnk( e3w , 'W', 1._wp ) 1428 CALL lbc_lnk( e3uw, 'U', 1._wp ) 1429 CALL lbc_lnk( e3vw, 'V', 1._wp ) 1430 1431 ! 1432 ELSE ! not ln_s_sigma 1433 ! 1434 DO jk = 1, jpk 1435 gsigw(jk) = -fssig( REAL(jk,wp)-0.5_wp ) 1436 gsigt(jk) = -fssig( REAL(jk,wp) ) 1437 END DO 1438 IF( nprint == 1 .AND. lwp ) WRITE(numout,*) 'gsigw 1 jpk ', gsigw(1), gsigw(jpk) 1439 ! 1440 ! Coefficients for vertical scale factors at w-, t- levels 1441 !!gm bug : define it from analytical function, not like juste bellow.... 1442 !!gm or betteroffer the 2 possibilities.... 1443 DO jk = 1, jpkm1 1444 esigt(jk ) = gsigw(jk+1) - gsigw(jk) 1445 esigw(jk+1) = gsigt(jk+1) - gsigt(jk) 1446 END DO 1447 esigw( 1 ) = 2._wp * ( gsigt(1 ) - gsigw(1 ) ) 1448 esigt(jpk) = 2._wp * ( gsigt(jpk) - gsigw(jpk) ) 1449 1450 !!gm original form 1451 !!org DO jk = 1, jpk 1452 !!org esigt(jk)=fsdsig( FLOAT(jk) ) 1453 !!org esigw(jk)=fsdsig( FLOAT(jk)-0.5 ) 1454 !!org END DO 1455 !!gm 1456 ! 1457 ! Coefficients for vertical depth as the sum of e3w scale factors 1458 gsi3w(1) = 0.5_wp * esigw(1) 1459 DO jk = 2, jpk 1460 gsi3w(jk) = gsi3w(jk-1) + esigw(jk) 1461 END DO 1462 !!gm: depuw, depvw can be suppressed (modif in ldfslp) and depw=dep3w can be set (save 3 3D arrays) 1463 DO jk = 1, jpk 1464 zcoeft = ( REAL(jk,wp) - 0.5_wp ) / REAL(jpkm1,wp) 1465 zcoefw = ( REAL(jk,wp) - 1.0_wp ) / REAL(jpkm1,wp) 1466 gdept (:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*gsigt(jk) + hift(:,:)*zcoeft ) 1467 gdepw (:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*gsigw(jk) + hift(:,:)*zcoefw ) 1468 gdep3w(:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*gsi3w(jk) + hift(:,:)*zcoeft ) 1469 END DO 1470 !!gm: e3uw, e3vw can be suppressed (modif in dynzdf, dynzdf_iso, zdfbfr) (save 2 3D arrays) 1471 DO jj = 1, jpj 1472 DO ji = 1, jpi 1473 DO jk = 1, jpk 1474 e3t(ji,jj,jk) = ( (hbatt(ji,jj)-hift(ji,jj))*esigt(jk) + hift(ji,jj)/REAL(jpkm1,wp) ) 1475 e3u(ji,jj,jk) = ( (hbatu(ji,jj)-hifu(ji,jj))*esigt(jk) + hifu(ji,jj)/REAL(jpkm1,wp) ) 1476 e3v(ji,jj,jk) = ( (hbatv(ji,jj)-hifv(ji,jj))*esigt(jk) + hifv(ji,jj)/REAL(jpkm1,wp) ) 1477 e3f(ji,jj,jk) = ( (hbatf(ji,jj)-hiff(ji,jj))*esigt(jk) + hiff(ji,jj)/REAL(jpkm1,wp) ) 1478 ! 1479 e3w (ji,jj,jk) = ( (hbatt(ji,jj)-hift(ji,jj))*esigw(jk) + hift(ji,jj)/REAL(jpkm1,wp) ) 1480 e3uw(ji,jj,jk) = ( (hbatu(ji,jj)-hifu(ji,jj))*esigw(jk) + hifu(ji,jj)/REAL(jpkm1,wp) ) 1481 e3vw(ji,jj,jk) = ( (hbatv(ji,jj)-hifv(ji,jj))*esigw(jk) + hifv(ji,jj)/REAL(jpkm1,wp) ) 1482 END DO 1483 END DO 1484 END DO 1485 ! 1486 ENDIF ! ln_s_sigma 1487 1488 1329 1330 !======================================================================== 1331 ! Song and Haidvogel 1994 (ln_s_sh94=T) 1332 ! Siddorn and Furner 2012 (ln_sf12=T) 1333 ! or tanh function (both false) 1334 !======================================================================== 1335 IF ( ln_s_sh94 ) THEN 1336 CALL s_sh94() 1337 ELSE IF ( ln_s_sf12 ) THEN 1338 CALL s_sf12() 1339 ELSE 1340 CALL s_tanh() 1341 ENDIF 1342 1343 CALL lbc_lnk( e3t , 'T', 1._wp ) 1344 CALL lbc_lnk( e3u , 'U', 1._wp ) 1345 CALL lbc_lnk( e3v , 'V', 1._wp ) 1346 CALL lbc_lnk( e3f , 'F', 1._wp ) 1347 CALL lbc_lnk( e3w , 'W', 1._wp ) 1348 CALL lbc_lnk( e3uw, 'U', 1._wp ) 1349 CALL lbc_lnk( e3vw, 'V', 1._wp ) 1350 1351 fsdepw(:,:,:) = gdepw (:,:,:) 1352 fsde3w(:,:,:) = gdep3w(:,:,:) 1489 1353 ! 1490 1354 where (e3t (:,:,:).eq.0.0) e3t(:,:,:) = 1.0 … … 1520 1384 & ' MAX ', MAXVAL( mbathy(:,:) ) 1521 1385 1522 ! ! =============1523 IF(lwp) THEN ! Control print1524 ! ! =============1525 WRITE(numout,*)1526 WRITE(numout,*) ' domzgr: vertical coefficients for model level'1527 WRITE(numout, "(9x,' level gsigt gsigw esigt esigw gsi3w')" )1528 WRITE(numout, "(10x,i4,5f11.4)" ) ( jk, gsigt(jk), gsigw(jk), esigt(jk), esigw(jk), gsi3w(jk), jk=1,jpk )1529 ENDIF1530 1386 IF( nprint == 1 .AND. lwp ) THEN ! min max values over the local domain 1531 1387 WRITE(numout,*) ' MIN val mbathy ', MINVAL( mbathy(:,:) ), ' MAX ', MAXVAL( mbathy(:,:) ) … … 1544 1400 & ' w ', MAXVAL( fse3w (:,:,:) ) 1545 1401 ENDIF 1546 ! 1402 ! END DO 1547 1403 IF(lwp) THEN ! selected vertical profiles 1548 1404 WRITE(numout,*) … … 1574 1430 ENDIF 1575 1431 1576 !!gm bug? no more necessary? if ! defined key_helsinki 1432 !================================================================================ 1433 ! check the coordinate makes sense 1434 !================================================================================ 1435 DO ji = 1, jpi 1436 DO jj = 1, jpj 1437 1438 IF( hbatt(ji,jj) > 0._wp) THEN 1439 DO jk = 1, mbathy(ji,jj) 1440 ! check coordinate is monotonically increasing 1441 IF (fse3w(ji,jj,jk) <= 0._wp .OR. fse3t(ji,jj,jk) <= 0._wp ) THEN 1442 WRITE(ctmp1,*) 'ERROR zgr_sco : e3w or e3t =< 0 at point (i,j,k)= ', ji, jj, jk 1443 WRITE(numout,*) 'ERROR zgr_sco : e3w or e3t =< 0 at point (i,j,k)= ', ji, jj, jk 1444 WRITE(numout,*) 'e3w',fse3w(ji,jj,:) 1445 WRITE(numout,*) 'e3t',fse3t(ji,jj,:) 1446 CALL ctl_stop( ctmp1 ) 1447 ENDIF 1448 ! and check it has never gone negative 1449 IF( fsdepw(ji,jj,jk) < 0._wp .OR. fsdept(ji,jj,jk) < 0._wp ) THEN 1450 WRITE(ctmp1,*) 'ERROR zgr_sco : gdepw or gdept =< 0 at point (i,j,k)= ', ji, jj, jk 1451 WRITE(numout,*) 'ERROR zgr_sco : gdepw or gdept =< 0 at point (i,j,k)= ', ji, jj, jk 1452 WRITE(numout,*) 'gdepw',fsdepw(ji,jj,:) 1453 WRITE(numout,*) 'gdept',fsdept(ji,jj,:) 1454 CALL ctl_stop( ctmp1 ) 1455 ENDIF 1456 ! and check it never exceeds the total depth 1457 IF( fsdepw(ji,jj,jk) > hbatt(ji,jj) ) THEN 1458 WRITE(ctmp1,*) 'ERROR zgr_sco : gdepw > hbatt at point (i,j,k)= ', ji, jj, jk 1459 WRITE(numout,*) 'ERROR zgr_sco : gdepw > hbatt at point (i,j,k)= ', ji, jj, jk 1460 WRITE(numout,*) 'gdepw',fsdepw(ji,jj,:) 1461 CALL ctl_stop( ctmp1 ) 1462 ENDIF 1463 END DO 1464 1465 DO jk = 1, mbathy(ji,jj)-1 1466 ! and check it never exceeds the total depth 1467 IF( fsdept(ji,jj,jk) > hbatt(ji,jj) ) THEN 1468 WRITE(ctmp1,*) 'ERROR zgr_sco : gdept > hbatt at point (i,j,k)= ', ji, jj, jk 1469 WRITE(numout,*) 'ERROR zgr_sco : gdept > hbatt at point (i,j,k)= ', ji, jj, jk 1470 WRITE(numout,*) 'gdept',fsdept(ji,jj,:) 1471 CALL ctl_stop( ctmp1 ) 1472 ENDIF 1473 END DO 1474 1475 ENDIF 1476 1477 END DO 1478 END DO 1479 ! 1480 CALL wrk_dealloc( jpi, jpj, zenv, ztmp, zmsk, zri, zrj, zhbat ) 1481 ! 1482 IF( nn_timing == 1 ) CALL timing_stop('zgr_sco') 1483 ! 1484 END SUBROUTINE zgr_sco 1485 1486 !!====================================================================== 1487 SUBROUTINE s_sh94() 1488 1489 !!---------------------------------------------------------------------- 1490 !! *** ROUTINE s_sh94 *** 1491 !! 1492 !! ** Purpose : stretch the s-coordinate system 1493 !! 1494 !! ** Method : s-coordinate stretch using the Song and Haidvogel 1994 1495 !! mixed S/sigma coordinate 1496 !! 1497 !! Reference : Song and Haidvogel 1994. 1498 !!---------------------------------------------------------------------- 1499 ! 1500 INTEGER :: ji, jj, jk ! dummy loop argument 1501 REAL(wp) :: zcoeft, zcoefw ! temporary scalars 1502 ! 1503 REAL(wp), POINTER, DIMENSION(:,:,:) :: z_gsigw3, z_gsigt3, z_gsi3w3 1504 REAL(wp), POINTER, DIMENSION(:,:,:) :: z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 1505 1506 CALL wrk_alloc( jpi, jpj, jpk, z_gsigw3, z_gsigt3, z_gsi3w3 ) 1507 CALL wrk_alloc( jpi, jpj, jpk, z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 ) 1508 1509 z_gsigw3 = 0._wp ; z_gsigt3 = 0._wp ; z_gsi3w3 = 0._wp 1510 z_esigt3 = 0._wp ; z_esigw3 = 0._wp 1511 z_esigtu3 = 0._wp ; z_esigtv3 = 0._wp ; z_esigtf3 = 0._wp 1512 z_esigwu3 = 0._wp ; z_esigwv3 = 0._wp 1513 1514 DO ji = 1, jpi 1515 DO jj = 1, jpj 1516 1517 IF( hbatt(ji,jj) > rn_hc ) THEN !deep water, stretched sigma 1518 DO jk = 1, jpk 1519 z_gsigw3(ji,jj,jk) = -fssig1( REAL(jk,wp)-0.5_wp, rn_bb ) 1520 z_gsigt3(ji,jj,jk) = -fssig1( REAL(jk,wp) , rn_bb ) 1521 END DO 1522 ELSE ! shallow water, uniform sigma 1523 DO jk = 1, jpk 1524 z_gsigw3(ji,jj,jk) = REAL(jk-1,wp) / REAL(jpk-1,wp) 1525 z_gsigt3(ji,jj,jk) = ( REAL(jk-1,wp) + 0.5_wp ) / REAL(jpk-1,wp) 1526 END DO 1527 ENDIF 1528 ! 1529 DO jk = 1, jpkm1 1530 z_esigt3(ji,jj,jk ) = z_gsigw3(ji,jj,jk+1) - z_gsigw3(ji,jj,jk) 1531 z_esigw3(ji,jj,jk+1) = z_gsigt3(ji,jj,jk+1) - z_gsigt3(ji,jj,jk) 1532 END DO 1533 z_esigw3(ji,jj,1 ) = 2._wp * ( z_gsigt3(ji,jj,1 ) - z_gsigw3(ji,jj,1 ) ) 1534 z_esigt3(ji,jj,jpk) = 2._wp * ( z_gsigt3(ji,jj,jpk) - z_gsigw3(ji,jj,jpk) ) 1535 ! 1536 ! Coefficients for vertical depth as the sum of e3w scale factors 1537 z_gsi3w3(ji,jj,1) = 0.5_wp * z_esigw3(ji,jj,1) 1538 DO jk = 2, jpk 1539 z_gsi3w3(ji,jj,jk) = z_gsi3w3(ji,jj,jk-1) + z_esigw3(ji,jj,jk) 1540 END DO 1541 ! 1542 DO jk = 1, jpk 1543 zcoeft = ( REAL(jk,wp) - 0.5_wp ) / REAL(jpkm1,wp) 1544 zcoefw = ( REAL(jk,wp) - 1.0_wp ) / REAL(jpkm1,wp) 1545 gdept (ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*z_gsigt3(ji,jj,jk)+rn_hc*zcoeft ) 1546 gdepw (ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*z_gsigw3(ji,jj,jk)+rn_hc*zcoefw ) 1547 gdep3w(ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*z_gsi3w3(ji,jj,jk)+rn_hc*zcoeft ) 1548 END DO 1549 ! 1550 END DO ! for all jj's 1551 END DO ! for all ji's 1552 1553 DO ji = 1, jpim1 1554 DO jj = 1, jpjm1 1555 DO jk = 1, jpk 1556 z_esigtu3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigt3(ji+1,jj,jk) ) & 1557 & / ( hbatt(ji,jj)+hbatt(ji+1,jj) ) 1558 z_esigtv3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji,jj+1)*z_esigt3(ji,jj+1,jk) ) & 1559 & / ( hbatt(ji,jj)+hbatt(ji,jj+1) ) 1560 z_esigtf3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigt3(ji+1,jj,jk) & 1561 & + hbatt(ji,jj+1)*z_esigt3(ji,jj+1,jk)+hbatt(ji+1,jj+1)*z_esigt3(ji+1,jj+1,jk) ) & 1562 & / ( hbatt(ji,jj)+hbatt(ji+1,jj)+hbatt(ji,jj+1)+hbatt(ji+1,jj+1) ) 1563 z_esigwu3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigw3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigw3(ji+1,jj,jk) ) & 1564 & / ( hbatt(ji,jj)+hbatt(ji+1,jj) ) 1565 z_esigwv3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigw3(ji,jj,jk)+hbatt(ji,jj+1)*z_esigw3(ji,jj+1,jk) ) & 1566 & / ( hbatt(ji,jj)+hbatt(ji,jj+1) ) 1567 ! 1568 e3t(ji,jj,jk) = ( (hbatt(ji,jj)-rn_hc)*z_esigt3 (ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 1569 e3u(ji,jj,jk) = ( (hbatu(ji,jj)-rn_hc)*z_esigtu3(ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 1570 e3v(ji,jj,jk) = ( (hbatv(ji,jj)-rn_hc)*z_esigtv3(ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 1571 e3f(ji,jj,jk) = ( (hbatf(ji,jj)-rn_hc)*z_esigtf3(ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 1572 ! 1573 e3w (ji,jj,jk) = ( (hbatt(ji,jj)-rn_hc)*z_esigw3 (ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 1574 e3uw(ji,jj,jk) = ( (hbatu(ji,jj)-rn_hc)*z_esigwu3(ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 1575 e3vw(ji,jj,jk) = ( (hbatv(ji,jj)-rn_hc)*z_esigwv3(ji,jj,jk) + rn_hc/REAL(jpkm1,wp) ) 1576 END DO 1577 END DO 1578 END DO 1579 1580 CALL wrk_dealloc( jpi, jpj, jpk, z_gsigw3, z_gsigt3, z_gsi3w3 ) 1581 CALL wrk_dealloc( jpi, jpj, jpk, z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 ) 1582 1583 END SUBROUTINE s_sh94 1584 1585 SUBROUTINE s_sf12 1586 1587 !!---------------------------------------------------------------------- 1588 !! *** ROUTINE s_sf12 *** 1589 !! 1590 !! ** Purpose : stretch the s-coordinate system 1591 !! 1592 !! ** Method : s-coordinate stretch using the Siddorn and Furner 2012? 1593 !! mixed S/sigma/Z coordinate 1594 !! 1595 !! This method allows the maintenance of fixed surface and or 1596 !! bottom cell resolutions (cf. geopotential coordinates) 1597 !! within an analytically derived stretched S-coordinate framework. 1598 !! 1599 !! 1600 !! Reference : Siddorn and Furner 2012 (submitted Ocean modelling). 1601 !!---------------------------------------------------------------------- 1602 ! 1603 INTEGER :: ji, jj, jk ! dummy loop argument 1604 REAL(wp) :: zsmth ! smoothing around critical depth 1605 REAL(wp) :: zzs, zzb ! Surface and bottom cell thickness in sigma space 1606 ! 1607 REAL(wp), POINTER, DIMENSION(:,:,:) :: z_gsigw3, z_gsigt3, z_gsi3w3 1608 REAL(wp), POINTER, DIMENSION(:,:,:) :: z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 1609 1610 ! 1611 CALL wrk_alloc( jpi, jpj, jpk, z_gsigw3, z_gsigt3, z_gsi3w3 ) 1612 CALL wrk_alloc( jpi, jpj, jpk, z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 ) 1613 1614 z_gsigw3 = 0._wp ; z_gsigt3 = 0._wp ; z_gsi3w3 = 0._wp 1615 z_esigt3 = 0._wp ; z_esigw3 = 0._wp 1616 z_esigtu3 = 0._wp ; z_esigtv3 = 0._wp ; z_esigtf3 = 0._wp 1617 z_esigwu3 = 0._wp ; z_esigwv3 = 0._wp 1618 1619 DO ji = 1, jpi 1620 DO jj = 1, jpj 1621 1622 IF (hbatt(ji,jj)>rn_hc) THEN !deep water, stretched sigma 1623 1624 zzb = hbatt(ji,jj)*rn_zb_a + rn_zb_b ! this forces a linear bottom cell depth relationship with H,. 1625 ! could be changed by users but care must be taken to do so carefully 1626 zzb = 1.0_wp-(zzb/hbatt(ji,jj)) 1627 1628 zzs = rn_zs / hbatt(ji,jj) 1629 1630 IF (rn_efold /= 0.0_wp) THEN 1631 zsmth = tanh( (hbatt(ji,jj)- rn_hc ) / rn_efold ) 1632 ELSE 1633 zsmth = 1.0_wp 1634 ENDIF 1635 1636 DO jk = 1, jpk 1637 z_gsigw3(ji,jj,jk) = REAL(jk-1,wp) /REAL(jpk-1,wp) 1638 z_gsigt3(ji,jj,jk) = (REAL(jk-1,wp)+0.5_wp)/REAL(jpk-1,wp) 1639 ENDDO 1640 z_gsigw3(ji,jj,:) = fgamma( z_gsigw3(ji,jj,:), zzb, zzs, zsmth ) 1641 z_gsigt3(ji,jj,:) = fgamma( z_gsigt3(ji,jj,:), zzb, zzs, zsmth ) 1642 1643 ELSE IF (ln_sigcrit) THEN ! shallow water, uniform sigma 1644 1645 DO jk = 1, jpk 1646 z_gsigw3(ji,jj,jk) = REAL(jk-1,wp) /REAL(jpk-1,wp) 1647 z_gsigt3(ji,jj,jk) = (REAL(jk-1,wp)+0.5)/REAL(jpk-1,wp) 1648 END DO 1649 1650 ELSE ! shallow water, z coordinates 1651 1652 DO jk = 1, jpk 1653 z_gsigw3(ji,jj,jk) = REAL(jk-1,wp) /REAL(jpk-1,wp)*(rn_hc/hbatt(ji,jj)) 1654 z_gsigt3(ji,jj,jk) = (REAL(jk-1,wp)+0.5_wp)/REAL(jpk-1,wp)*(rn_hc/hbatt(ji,jj)) 1655 END DO 1656 1657 ENDIF 1658 1659 DO jk = 1, jpkm1 1660 z_esigt3(ji,jj,jk) = z_gsigw3(ji,jj,jk+1) - z_gsigw3(ji,jj,jk) 1661 z_esigw3(ji,jj,jk+1) = z_gsigt3(ji,jj,jk+1) - z_gsigt3(ji,jj,jk) 1662 END DO 1663 z_esigw3(ji,jj,1 ) = 2.0_wp * (z_gsigt3(ji,jj,1 ) - z_gsigw3(ji,jj,1 )) 1664 z_esigt3(ji,jj,jpk) = 2.0_wp * (z_gsigt3(ji,jj,jpk) - z_gsigw3(ji,jj,jpk)) 1665 1666 ! Coefficients for vertical depth as the sum of e3w scale factors 1667 z_gsi3w3(ji,jj,1) = 0.5 * z_esigw3(ji,jj,1) 1668 DO jk = 2, jpk 1669 z_gsi3w3(ji,jj,jk) = z_gsi3w3(ji,jj,jk-1) + z_esigw3(ji,jj,jk) 1670 END DO 1671 1672 DO jk = 1, jpk 1673 gdept (ji,jj,jk) = (scosrf(ji,jj)+hbatt(ji,jj))*z_gsigt3(ji,jj,jk) 1674 gdepw (ji,jj,jk) = (scosrf(ji,jj)+hbatt(ji,jj))*z_gsigw3(ji,jj,jk) 1675 gdep3w(ji,jj,jk) = (scosrf(ji,jj)+hbatt(ji,jj))*z_gsi3w3(ji,jj,jk) 1676 END DO 1677 1678 ENDDO ! for all jj's 1679 ENDDO ! for all ji's 1680 1681 DO ji=1,jpi 1682 DO jj=1,jpj 1683 1684 DO jk = 1, jpk 1685 z_esigtu3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigt3(ji+1,jj,jk) ) / & 1686 ( hbatt(ji,jj)+hbatt(ji+1,jj) ) 1687 z_esigtv3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji,jj+1)*z_esigt3(ji,jj+1,jk) ) / & 1688 ( hbatt(ji,jj)+hbatt(ji,jj+1) ) 1689 z_esigtf3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigt3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigt3(ji+1,jj,jk) + & 1690 hbatt(ji,jj+1)*z_esigt3(ji,jj+1,jk)+hbatt(ji+1,jj+1)*z_esigt3(ji+1,jj+1,jk) ) / & 1691 ( hbatt(ji,jj)+hbatt(ji+1,jj)+hbatt(ji,jj+1)+hbatt(ji+1,jj+1) ) 1692 z_esigwu3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigw3(ji,jj,jk)+hbatt(ji+1,jj)*z_esigw3(ji+1,jj,jk) ) / & 1693 ( hbatt(ji,jj)+hbatt(ji+1,jj) ) 1694 z_esigwv3(ji,jj,jk) = ( hbatt(ji,jj)*z_esigw3(ji,jj,jk)+hbatt(ji,jj+1)*z_esigw3(ji,jj+1,jk) ) / & 1695 ( hbatt(ji,jj)+hbatt(ji,jj+1) ) 1696 1697 e3t(ji,jj,jk)=(scosrf(ji,jj)+hbatt(ji,jj))*z_esigt3(ji,jj,jk) 1698 e3u(ji,jj,jk)=(scosrf(ji,jj)+hbatu(ji,jj))*z_esigtu3(ji,jj,jk) 1699 e3v(ji,jj,jk)=(scosrf(ji,jj)+hbatv(ji,jj))*z_esigtv3(ji,jj,jk) 1700 e3f(ji,jj,jk)=(scosrf(ji,jj)+hbatf(ji,jj))*z_esigtf3(ji,jj,jk) 1701 ! 1702 e3w(ji,jj,jk)=hbatt(ji,jj)*z_esigw3(ji,jj,jk) 1703 e3uw(ji,jj,jk)=hbatu(ji,jj)*z_esigwu3(ji,jj,jk) 1704 e3vw(ji,jj,jk)=hbatv(ji,jj)*z_esigwv3(ji,jj,jk) 1705 END DO 1706 1707 ENDDO 1708 ENDDO 1709 ! ! ============= 1710 1711 CALL wrk_dealloc( jpi, jpj, jpk, z_gsigw3, z_gsigt3, z_gsi3w3 ) 1712 CALL wrk_dealloc( jpi, jpj, jpk, z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 ) 1713 1714 END SUBROUTINE s_sf12 1715 1716 SUBROUTINE s_tanh() 1717 1718 !!---------------------------------------------------------------------- 1719 !! *** ROUTINE s_tanh*** 1720 !! 1721 !! ** Purpose : stretch the s-coordinate system 1722 !! 1723 !! ** Method : s-coordinate stretch 1724 !! 1725 !! Reference : Madec, Lott, Delecluse and Crepon, 1996. JPO, 26, 1393-1408. 1726 !!---------------------------------------------------------------------- 1727 1728 INTEGER :: ji, jj, jk ! dummy loop argument 1729 REAL(wp) :: zcoeft, zcoefw ! temporary scalars 1730 1731 REAL(wp), POINTER, DIMENSION(:) :: z_gsigw, z_gsigt, z_gsi3w 1732 REAL(wp), POINTER, DIMENSION(:) :: z_esigt, z_esigw 1733 1734 CALL wrk_alloc( jpk, z_gsigw, z_gsigt, z_gsi3w ) 1735 CALL wrk_alloc( jpk, z_esigt, z_esigw ) 1736 1737 z_gsigw = 0._wp ; z_gsigt = 0._wp ; z_gsi3w = 0._wp 1738 z_esigt = 0._wp ; z_esigw = 0._wp 1739 1577 1740 DO jk = 1, jpk 1578 DO jj = 1, jpj 1579 DO ji = 1, jpi 1580 IF( fse3w(ji,jj,jk) <= 0._wp .OR. fse3t(ji,jj,jk) <= 0._wp ) THEN 1581 WRITE(ctmp1,*) 'zgr_sco : e3w or e3t =< 0 at point (i,j,k)= ', ji, jj, jk 1582 CALL ctl_stop( ctmp1 ) 1583 ENDIF 1584 IF( fsdepw(ji,jj,jk) < 0._wp .OR. fsdept(ji,jj,jk) < 0._wp ) THEN 1585 WRITE(ctmp1,*) 'zgr_sco : gdepw or gdept =< 0 at point (i,j,k)= ', ji, jj, jk 1586 CALL ctl_stop( ctmp1 ) 1587 ENDIF 1588 END DO 1589 END DO 1590 END DO 1591 !!gm bug #endif 1592 ! 1593 CALL wrk_dealloc( jpi, jpj, zenv, ztmp, zmsk, zri, zrj, zhbat ) 1594 CALL wrk_dealloc( jpi, jpj, jpk, gsigw3, gsigt3, gsi3w3 ) 1595 CALL wrk_dealloc( jpi, jpj, jpk, esigt3, esigw3, esigtu3, esigtv3, esigtf3, esigwu3, esigwv3 ) 1596 ! 1597 IF( nn_timing == 1 ) CALL timing_stop('zgr_sco') 1598 ! 1599 END SUBROUTINE zgr_sco 1741 z_gsigw(jk) = -fssig( REAL(jk,wp)-0.5_wp ) 1742 z_gsigt(jk) = -fssig( REAL(jk,wp) ) 1743 END DO 1744 IF( nprint == 1 .AND. lwp ) WRITE(numout,*) 'z_gsigw 1 jpk ', z_gsigw(1), z_gsigw(jpk) 1745 ! 1746 ! Coefficients for vertical scale factors at w-, t- levels 1747 !!gm bug : define it from analytical function, not like juste bellow.... 1748 !!gm or betteroffer the 2 possibilities.... 1749 DO jk = 1, jpkm1 1750 z_esigt(jk ) = z_gsigw(jk+1) - z_gsigw(jk) 1751 z_esigw(jk+1) = z_gsigt(jk+1) - z_gsigt(jk) 1752 END DO 1753 z_esigw( 1 ) = 2._wp * ( z_gsigt(1 ) - z_gsigw(1 ) ) 1754 z_esigt(jpk) = 2._wp * ( z_gsigt(jpk) - z_gsigw(jpk) ) 1755 ! 1756 ! Coefficients for vertical depth as the sum of e3w scale factors 1757 z_gsi3w(1) = 0.5_wp * z_esigw(1) 1758 DO jk = 2, jpk 1759 z_gsi3w(jk) = z_gsi3w(jk-1) + z_esigw(jk) 1760 END DO 1761 !!gm: depuw, depvw can be suppressed (modif in ldfslp) and depw=dep3w can be set (save 3 3D arrays) 1762 DO jk = 1, jpk 1763 zcoeft = ( REAL(jk,wp) - 0.5_wp ) / REAL(jpkm1,wp) 1764 zcoefw = ( REAL(jk,wp) - 1.0_wp ) / REAL(jpkm1,wp) 1765 gdept (:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*z_gsigt(jk) + hift(:,:)*zcoeft ) 1766 gdepw (:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*z_gsigw(jk) + hift(:,:)*zcoefw ) 1767 gdep3w(:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*z_gsi3w(jk) + hift(:,:)*zcoeft ) 1768 END DO 1769 !!gm: e3uw, e3vw can be suppressed (modif in dynzdf, dynzdf_iso, zdfbfr) (save 2 3D arrays) 1770 DO jj = 1, jpj 1771 DO ji = 1, jpi 1772 DO jk = 1, jpk 1773 e3t(ji,jj,jk) = ( (hbatt(ji,jj)-hift(ji,jj))*z_esigt(jk) + hift(ji,jj)/REAL(jpkm1,wp) ) 1774 e3u(ji,jj,jk) = ( (hbatu(ji,jj)-hifu(ji,jj))*z_esigt(jk) + hifu(ji,jj)/REAL(jpkm1,wp) ) 1775 e3v(ji,jj,jk) = ( (hbatv(ji,jj)-hifv(ji,jj))*z_esigt(jk) + hifv(ji,jj)/REAL(jpkm1,wp) ) 1776 e3f(ji,jj,jk) = ( (hbatf(ji,jj)-hiff(ji,jj))*z_esigt(jk) + hiff(ji,jj)/REAL(jpkm1,wp) ) 1777 ! 1778 e3w (ji,jj,jk) = ( (hbatt(ji,jj)-hift(ji,jj))*z_esigw(jk) + hift(ji,jj)/REAL(jpkm1,wp) ) 1779 e3uw(ji,jj,jk) = ( (hbatu(ji,jj)-hifu(ji,jj))*z_esigw(jk) + hifu(ji,jj)/REAL(jpkm1,wp) ) 1780 e3vw(ji,jj,jk) = ( (hbatv(ji,jj)-hifv(ji,jj))*z_esigw(jk) + hifv(ji,jj)/REAL(jpkm1,wp) ) 1781 END DO 1782 END DO 1783 END DO 1784 1785 CALL wrk_dealloc( jpk, z_gsigw, z_gsigt, z_gsi3w ) 1786 CALL wrk_dealloc( jpk, z_esigt, z_esigw ) 1787 1788 END SUBROUTINE s_tanh 1789 1790 FUNCTION fssig( pk ) RESULT( pf ) 1791 !!---------------------------------------------------------------------- 1792 !! *** ROUTINE fssig *** 1793 !! 1794 !! ** Purpose : provide the analytical function in s-coordinate 1795 !! 1796 !! ** Method : the function provide the non-dimensional position of 1797 !! T and W (i.e. between 0 and 1) 1798 !! T-points at integer values (between 1 and jpk) 1799 !! W-points at integer values - 1/2 (between 0.5 and jpk-0.5) 1800 !!---------------------------------------------------------------------- 1801 REAL(wp), INTENT(in) :: pk ! continuous "k" coordinate 1802 REAL(wp) :: pf ! sigma value 1803 !!---------------------------------------------------------------------- 1804 ! 1805 pf = ( TANH( rn_theta * ( -(pk-0.5_wp) / REAL(jpkm1) + rn_thetb ) ) & 1806 & - TANH( rn_thetb * rn_theta ) ) & 1807 & * ( COSH( rn_theta ) & 1808 & + COSH( rn_theta * ( 2._wp * rn_thetb - 1._wp ) ) ) & 1809 & / ( 2._wp * SINH( rn_theta ) ) 1810 ! 1811 END FUNCTION fssig 1812 1813 1814 FUNCTION fssig1( pk1, pbb ) RESULT( pf1 ) 1815 !!---------------------------------------------------------------------- 1816 !! *** ROUTINE fssig1 *** 1817 !! 1818 !! ** Purpose : provide the Song and Haidvogel version of the analytical function in s-coordinate 1819 !! 1820 !! ** Method : the function provides the non-dimensional position of 1821 !! T and W (i.e. between 0 and 1) 1822 !! T-points at integer values (between 1 and jpk) 1823 !! W-points at integer values - 1/2 (between 0.5 and jpk-0.5) 1824 !!---------------------------------------------------------------------- 1825 REAL(wp), INTENT(in) :: pk1 ! continuous "k" coordinate 1826 REAL(wp), INTENT(in) :: pbb ! Stretching coefficient 1827 REAL(wp) :: pf1 ! sigma value 1828 !!---------------------------------------------------------------------- 1829 ! 1830 IF ( rn_theta == 0 ) then ! uniform sigma 1831 pf1 = - ( pk1 - 0.5_wp ) / REAL( jpkm1 ) 1832 ELSE ! stretched sigma 1833 pf1 = ( 1._wp - pbb ) * ( SINH( rn_theta*(-(pk1-0.5_wp)/REAL(jpkm1)) ) ) / SINH( rn_theta ) & 1834 & + pbb * ( (TANH( rn_theta*( (-(pk1-0.5_wp)/REAL(jpkm1)) + 0.5_wp) ) - TANH( 0.5_wp * rn_theta ) ) & 1835 & / ( 2._wp * TANH( 0.5_wp * rn_theta ) ) ) 1836 ENDIF 1837 ! 1838 END FUNCTION fssig1 1839 1840 1841 FUNCTION fgamma( pk1, pzb, pzs, psmth) RESULT( p_gamma ) 1842 !!---------------------------------------------------------------------- 1843 !! *** ROUTINE fgamma *** 1844 !! 1845 !! ** Purpose : provide analytical function for the s-coordinate 1846 !! 1847 !! ** Method : the function provides the non-dimensional position of 1848 !! T and W (i.e. between 0 and 1) 1849 !! T-points at integer values (between 1 and jpk) 1850 !! W-points at integer values - 1/2 (between 0.5 and jpk-0.5) 1851 !! 1852 !! This method allows the maintenance of fixed surface and or 1853 !! bottom cell resolutions (cf. geopotential coordinates) 1854 !! within an analytically derived stretched S-coordinate framework. 1855 !! 1856 !! Reference : Siddorn and Furner, in prep 1857 !!---------------------------------------------------------------------- 1858 REAL(wp), INTENT(in ) :: pk1(jpk) ! continuous "k" coordinate 1859 REAL(wp) :: p_gamma(jpk) ! stretched coordinate 1860 REAL(wp), INTENT(in ) :: pzb ! Bottom box depth 1861 REAL(wp), INTENT(in ) :: pzs ! surface box depth 1862 REAL(wp), INTENT(in ) :: psmth ! Smoothing parameter 1863 REAL(wp) :: za1,za2,za3 ! local variables 1864 REAL(wp) :: zn1,zn2 ! local variables 1865 REAL(wp) :: za,zb,zx ! local variables 1866 integer :: jk 1867 !!---------------------------------------------------------------------- 1868 ! 1869 1870 zn1 = 1./(jpk-1.) 1871 zn2 = 1. - zn1 1872 1873 za1 = (rn_alpha+2.0_wp)*zn1**(rn_alpha+1.0_wp)-(rn_alpha+1.0_wp)*zn1**(rn_alpha+2.0_wp) 1874 za2 = (rn_alpha+2.0_wp)*zn2**(rn_alpha+1.0_wp)-(rn_alpha+1.0_wp)*zn2**(rn_alpha+2.0_wp) 1875 za3 = (zn2**3.0_wp - za2)/( zn1**3.0_wp - za1) 1876 1877 za = pzb - za3*(pzs-za1)-za2 1878 za = za/( zn2-0.5_wp*(za2+zn2**2.0_wp) - za3*(zn1-0.5_wp*(za1+zn1**2.0_wp) ) ) 1879 zb = (pzs - za1 - za*( zn1-0.5_wp*(za1+zn1**2.0_wp ) ) ) / (zn1**3.0_wp - za1) 1880 zx = 1.0_wp-za/2.0_wp-zb 1881 1882 DO jk = 1, jpk 1883 p_gamma(jk) = za*(pk1(jk)*(1.0_wp-pk1(jk)/2.0_wp))+zb*pk1(jk)**3.0_wp + zx*( (rn_alpha+2.0_wp)*pk1(jk)**(rn_alpha+1.0_wp)-(rn_alpha+1.0_wp)*pk1(jk)**(rn_alpha+2.0_wp) ) 1884 p_gamma(jk) = p_gamma(jk)*psmth+pk1(jk)*(1.0_wp-psmth) 1885 ENDDO 1886 1887 ! 1888 END FUNCTION fgamma 1600 1889 1601 1890 !!====================================================================== -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90
r3294 r3680 32 32 USE phycst ! physical constants 33 33 USE dtatsd ! data temperature and salinity (dta_tsd routine) 34 USE restart ! ocean restart (rst_read routine)35 34 USE in_out_manager ! I/O manager 36 35 USE iom ! I/O library … … 43 42 USE dynspg_ts ! pressure gradient schemes 44 43 USE lib_mpp ! MPP library 44 USE restart ! restart 45 45 USE wrk_nemo ! Memory allocation 46 46 USE timing ! Timing -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90
r3294 r3680 27 27 USE prtctl ! Print control 28 28 USE iom ! I/O library 29 USE restart ! only for lrst_oce30 29 USE timing ! Timing 31 30 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90
r3609 r3680 45 45 USE prtctl ! Print control 46 46 USE iom 47 USE restart ! only for lrst_oce48 47 USE lib_fortran 49 48 #if defined key_agrif -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
r3651 r3680 41 41 USE in_out_manager ! I/O manager 42 42 USE iom ! IOM library 43 USE restart ! only for lrst_oce44 43 USE zdf_oce ! Vertical diffusion 45 44 USE wrk_nemo ! Memory Allocation -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90
r3294 r3680 20 20 USE divcur ! hor. divergence and curl (div & cur routines) 21 21 USE iom ! I/O library 22 USE restart ! only for lrst_oce23 22 USE in_out_manager ! I/O manager 24 23 USE prtctl ! Print control -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
r3294 r3680 80 80 !! was in restart but moved here because of the OFF line... better solution should be found... 81 81 !!---------------------------------------------------------------------- 82 INTEGER :: nitrst !: time step at which restart file should be written 82 INTEGER :: nitrst !: time step at which restart file should be written 83 LOGICAL :: lrst_oce !: logical to control the oce restart write 84 INTEGER :: numror, numrow !: logical unit for cean restart (read and write) 83 85 84 86 !!---------------------------------------------------------------------- -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/IOM/iom_def.F90
r2528 r3680 43 43 INTEGER, PARAMETER, PUBLIC :: jp_i1 = 204 !: write INTEGER(1) 44 44 45 INTEGER, PARAMETER, PUBLIC :: jpmax_files = 50 !: maximum number of simultaneously opened file45 INTEGER, PARAMETER, PUBLIC :: jpmax_files = 100 !: maximum number of simultaneously opened file 46 46 INTEGER, PARAMETER, PUBLIC :: jpmax_vars = 360 !: maximum number of variables in one file 47 47 INTEGER, PARAMETER, PUBLIC :: jpmax_dims = 4 !: maximum number of dimensions for one variable -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/IOM/prtctl.F90
r3625 r3680 33 33 PUBLIC prt_ctl_info ! called by all subroutines 34 34 PUBLIC prt_ctl_init ! called by opa.F90 35 PUBLIC sub_dom ! called by opa.F90 35 36 36 37 !!---------------------------------------------------------------------- … … 422 423 nrecil, nrecjl, nldil, nleil, nldjl, nlejl 423 424 424 INTEGER, DIMENSION(:,:), ALLOCATABLE:: iimpptl, ijmpptl, ilcitl, ilcjtl ! workspace425 INTEGER, POINTER, DIMENSION(:,:) :: iimpptl, ijmpptl, ilcitl, ilcjtl ! workspace 425 426 REAL(wp) :: zidom, zjdom ! temporary scalars 426 427 !!---------------------------------------------------------------------- 427 428 429 ! 430 CALL wrk_alloc( isplt, jsplt, ilcitl, ilcjtl, iimpptl, ijmpptl ) 431 ! 428 432 ! 1. Dimension arrays for subdomains 429 433 ! ----------------------------------- … … 442 446 #endif 443 447 444 ALLOCATE(ilcitl (isplt,jsplt))445 ALLOCATE(ilcjtl (isplt,jsplt))446 448 447 449 nrecil = 2 * jpreci … … 516 518 ! ------------------------------- 517 519 518 ALLOCATE(iimpptl(isplt,jsplt))519 ALLOCATE(ijmpptl(isplt,jsplt))520 521 520 iimpptl(:,:) = 1 522 521 ijmpptl(:,:) = 1 … … 576 575 END DO 577 576 ! 578 DEALLOCATE( iimpptl, ijmpptl, ilcitl, ilcjtl ) 577 ! 578 CALL wrk_dealloc( isplt, jsplt, ilcitl, ilcjtl, iimpptl, ijmpptl ) 579 ! 579 580 ! 580 581 END SUBROUTINE sub_dom -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
r3294 r3680 24 24 USE trdmld_oce ! ocean active mixed layer tracers trends variables 25 25 USE domvvl ! variable volume 26 USE divcur ! hor. divergence and curl (div & cur routines) 26 27 27 28 IMPLICIT NONE … … 31 32 PUBLIC rst_write ! routine called by step module 32 33 PUBLIC rst_read ! routine called by opa module 33 34 LOGICAL, PUBLIC :: lrst_oce = .FALSE. !: logical to control the oce restart write35 INTEGER, PUBLIC :: numror, numrow !: logical unit for cean restart (read and write)36 34 37 35 !! * Substitutions … … 183 181 ENDIF 184 182 ! 185 CALL iom_get( numror, jpdom_autoglo, 'ub' , ub ) ! before fields 186 CALL iom_get( numror, jpdom_autoglo, 'vb' , vb ) 187 CALL iom_get( numror, jpdom_autoglo, 'tb' , tsb(:,:,:,jp_tem) ) 188 CALL iom_get( numror, jpdom_autoglo, 'sb' , tsb(:,:,:,jp_sal) ) 189 CALL iom_get( numror, jpdom_autoglo, 'rotb' , rotb ) 190 CALL iom_get( numror, jpdom_autoglo, 'hdivb' , hdivb ) 191 CALL iom_get( numror, jpdom_autoglo, 'sshb' , sshb ) 192 IF( lk_vvl ) CALL iom_get( numror, jpdom_autoglo, 'fse3t_b', fse3t_b(:,:,:) ) 193 ! 194 CALL iom_get( numror, jpdom_autoglo, 'un' , un ) ! now fields 195 CALL iom_get( numror, jpdom_autoglo, 'vn' , vn ) 196 CALL iom_get( numror, jpdom_autoglo, 'tn' , tsn(:,:,:,jp_tem) ) 197 CALL iom_get( numror, jpdom_autoglo, 'sn' , tsn(:,:,:,jp_sal) ) 198 CALL iom_get( numror, jpdom_autoglo, 'rotn' , rotn ) 199 CALL iom_get( numror, jpdom_autoglo, 'hdivn' , hdivn ) 200 CALL iom_get( numror, jpdom_autoglo, 'sshn' , sshn ) 201 CALL iom_get( numror, jpdom_autoglo, 'rhop' , rhop ) ! now potential density 183 IF( iom_varid( numror, 'ub', ldstop = .FALSE. ) > 0 ) THEN 184 CALL iom_get( numror, jpdom_autoglo, 'ub' , ub ) ! before fields 185 CALL iom_get( numror, jpdom_autoglo, 'vb' , vb ) 186 CALL iom_get( numror, jpdom_autoglo, 'tb' , tsb(:,:,:,jp_tem) ) 187 CALL iom_get( numror, jpdom_autoglo, 'sb' , tsb(:,:,:,jp_sal) ) 188 CALL iom_get( numror, jpdom_autoglo, 'rotb' , rotb ) 189 CALL iom_get( numror, jpdom_autoglo, 'hdivb' , hdivb ) 190 CALL iom_get( numror, jpdom_autoglo, 'sshb' , sshb ) 191 IF( lk_vvl ) CALL iom_get( numror, jpdom_autoglo, 'fse3t_b', fse3t_b(:,:,:) ) 192 ELSE 193 neuler = 0 194 ENDIF 195 ! 196 CALL iom_get( numror, jpdom_autoglo, 'un' , un ) ! now fields 197 CALL iom_get( numror, jpdom_autoglo, 'vn' , vn ) 198 CALL iom_get( numror, jpdom_autoglo, 'tn' , tsn(:,:,:,jp_tem) ) 199 CALL iom_get( numror, jpdom_autoglo, 'sn' , tsn(:,:,:,jp_sal) ) 200 CALL iom_get( numror, jpdom_autoglo, 'sshn' , sshn ) 201 IF( iom_varid( numror, 'rotn', ldstop = .FALSE. ) > 0 ) THEN 202 CALL iom_get( numror, jpdom_autoglo, 'rotn' , rotn ) 203 CALL iom_get( numror, jpdom_autoglo, 'hdivn' , hdivn ) 204 ELSE 205 CALL div_cur( 0 ) ! Horizontal divergence & Relative vorticity 206 ENDIF 207 IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN 208 CALL iom_get( numror, jpdom_autoglo, 'rhop' , rhop ) ! now potential density 209 ELSE 210 CALL eos ( tsn, rhd, rhop ) 211 ENDIF 202 212 #if defined key_zdfkpp 203 213 IF( iom_varid( numror, 'rhd', ldstop = .FALSE. ) > 0 ) THEN 204 205 ELSE 206 214 CALL iom_get( numror, jpdom_autoglo, 'rhd' , rhd ) ! now in situ density anomaly 215 ELSE 216 CALL eos( tsn, rhd ) ! compute rhd 207 217 ENDIF 208 218 #endif -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90
r3609 r3680 7 7 !! NEMO 1.0 ! 2002-09 (G. Madec) F90: Free form and module 8 8 !! 3.2 ! 2009-03 (R. Benshila) External north fold treatment 9 !! 3.5 ! 2012 (S.Mocavero, I. Epicoco) Add 'lbc_bdy_lnk' 10 !! and lbc_obc_lnk' routine to optimize 11 !! the BDY/OBC communications 9 12 !!---------------------------------------------------------------------- 10 13 #if defined key_mpp_mpi … … 14 17 !! lbc_lnk : generic interface for mpp_lnk_3d and mpp_lnk_2d routines defined in lib_mpp 15 18 !! lbc_lnk_e : generic interface for mpp_lnk_2d_e routine defined in lib_mpp 19 !! lbc_bdy_lnk : generic interface for mpp_lnk_bdy_2d and mpp_lnk_bdy_3d routines defined in lib_mpp 20 !! lbc_obc_lnk : generic interface for mpp_lnk_obc_2d and mpp_lnk_obc_3d routines defined in lib_mpp 16 21 !!---------------------------------------------------------------------- 17 22 USE lib_mpp ! distributed memory computing library … … 21 26 END INTERFACE 22 27 28 INTERFACE lbc_bdy_lnk 29 MODULE PROCEDURE mpp_lnk_bdy_2d, mpp_lnk_bdy_3d 30 END INTERFACE 31 INTERFACE lbc_obc_lnk 32 MODULE PROCEDURE mpp_lnk_obc_2d, mpp_lnk_obc_3d 33 END INTERFACE 34 23 35 INTERFACE lbc_lnk_e 24 36 MODULE PROCEDURE mpp_lnk_2d_e … … 27 39 PUBLIC lbc_lnk ! ocean lateral boundary conditions 28 40 PUBLIC lbc_lnk_e 41 PUBLIC lbc_bdy_lnk ! ocean lateral BDY boundary conditions 42 PUBLIC lbc_obc_lnk ! ocean lateral BDY boundary conditions 29 43 30 44 !!---------------------------------------------------------------------- … … 41 55 !! lbc_lnk_3d : set the lateral boundary condition on a 3D variable on ocean mesh 42 56 !! lbc_lnk_2d : set the lateral boundary condition on a 2D variable on ocean mesh 57 !! lbc_bdy_lnk : set the lateral BDY boundary condition 58 !! lbc_obc_lnk : set the lateral OBC boundary condition 43 59 !!---------------------------------------------------------------------- 44 60 USE oce ! ocean dynamics and tracers … … 58 74 END INTERFACE 59 75 76 INTERFACE lbc_bdy_lnk 77 MODULE PROCEDURE lbc_bdy_lnk_2d, lbc_bdy_lnk_3d 78 END INTERFACE 79 INTERFACE lbc_obc_lnk 80 MODULE PROCEDURE lbc_lnk_2d, lbc_lnk_3d 81 END INTERFACE 82 60 83 PUBLIC lbc_lnk ! ocean/ice lateral boundary conditions 61 84 PUBLIC lbc_lnk_e 85 PUBLIC lbc_bdy_lnk ! ocean lateral BDY boundary conditions 86 PUBLIC lbc_obc_lnk ! ocean lateral OBC boundary conditions 62 87 63 88 !!---------------------------------------------------------------------- … … 180 205 END SUBROUTINE lbc_lnk_3d 181 206 207 SUBROUTINE lbc_bdy_lnk_3d( pt3d, cd_type, psgn, ib_bdy ) 208 !!--------------------------------------------------------------------- 209 !! *** ROUTINE lbc_bdy_lnk *** 210 !! 211 !! ** Purpose : wrapper rountine to 'lbc_lnk_3d'. This wrapper is used 212 !! to maintain the same interface with regards to the mpp case 213 !! 214 !!---------------------------------------------------------------------- 215 CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points 216 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt3d ! 3D array on which the lbc is applied 217 REAL(wp) , INTENT(in ) :: psgn ! control of the sign 218 INTEGER :: ib_bdy ! BDY boundary set 219 !! 220 CALL lbc_lnk_3d( pt3d, cd_type, psgn) 221 222 END SUBROUTINE lbc_bdy_lnk_3d 223 224 SUBROUTINE lbc_bdy_lnk_2d( pt2d, cd_type, psgn, ib_bdy ) 225 !!--------------------------------------------------------------------- 226 !! *** ROUTINE lbc_bdy_lnk *** 227 !! 228 !! ** Purpose : wrapper rountine to 'lbc_lnk_3d'. This wrapper is used 229 !! to maintain the same interface with regards to the mpp case 230 !! 231 !!---------------------------------------------------------------------- 232 CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points 233 REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pt2d ! 3D array on which the lbc is applied 234 REAL(wp) , INTENT(in ) :: psgn ! control of the sign 235 INTEGER :: ib_bdy ! BDY boundary set 236 !! 237 CALL lbc_lnk_2d( pt2d, cd_type, psgn) 238 239 END SUBROUTINE lbc_bdy_lnk_2d 182 240 183 241 SUBROUTINE lbc_lnk_2d( pt2d, cd_type, psgn, cd_mpp, pval ) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
r3632 r3680 19 19 !! 3.2 ! 2009 (O. Marti) add mpp_ini_znl 20 20 !! 4.0 ! 2011 (G. Madec) move ctl_ routines from in_out_manager 21 !! 3.5 ! 2012 (S.Mocavero, I. Epicoco) Add 'mpp_lnk_bdy_3d', 'mpp_lnk_obc_3d', 22 !! 'mpp_lnk_bdy_2d' and 'mpp_lnk_obc_2d' routines and update 23 !! the mppobc routine to optimize the BDY and OBC communications 21 24 !!---------------------------------------------------------------------- 22 25 … … 69 72 PUBLIC mppsend, mpprecv ! needed by ICB routines 70 73 PUBLIC lib_mpp_alloc ! Called in nemogcm.F90 74 PUBLIC mpp_lnk_bdy_2d, mpp_lnk_bdy_3d 75 PUBLIC mpp_lnk_obc_2d, mpp_lnk_obc_3d 71 76 72 77 !! * Interfaces … … 348 353 END FUNCTION mynode 349 354 350 351 SUBROUTINE mpp_lnk_3d( ptab, cd_type, psgn, cd_mpp, pval ) 352 !!---------------------------------------------------------------------- 353 !! *** routine mpp_lnk_3d *** 355 SUBROUTINE mpp_lnk_obc_3d( ptab, cd_type, psgn ) 356 !!---------------------------------------------------------------------- 357 !! *** routine mpp_lnk_obc_3d *** 354 358 !! 355 359 !! ** Purpose : Message passing manadgement 356 360 !! 357 !! ** Method : Use mppsend and mpprecv function for passing mask361 !! ** Method : Use mppsend and mpprecv function for passing OBC boundaries 358 362 !! between processors following neighboring subdomains. 359 363 !! domain parameters … … 375 379 REAL(wp) , INTENT(in ) :: psgn ! =-1 the sign change across the north fold boundary 376 380 ! ! = 1. , the sign is kept 377 CHARACTER(len=3), OPTIONAL , INTENT(in ) :: cd_mpp ! fill the overlap area only378 REAL(wp) , OPTIONAL , INTENT(in ) :: pval ! background value (used at closed boundaries)379 381 !! 380 382 INTEGER :: ji, jj, jk, jl ! dummy loop indices … … 385 387 !!---------------------------------------------------------------------- 386 388 387 IF( PRESENT( pval ) ) THEN ; zland = pval ! set land value 388 ELSE ; zland = 0.e0 ! zero by default 389 ENDIF 389 zland = 0.e0 ! zero by default 390 390 391 391 ! 1. standard boundary treatment 392 392 ! ------------------------------ 393 IF( PRESENT( cd_mpp ) ) THEN ! only fill added line/raw with existing values 394 ! 395 ! WARNING ptab is defined only between nld and nle 396 DO jk = 1, jpk 397 DO jj = nlcj+1, jpj ! added line(s) (inner only) 398 ptab(nldi :nlei , jj ,jk) = ptab(nldi:nlei, nlej,jk) 399 ptab(1 :nldi-1, jj ,jk) = ptab(nldi , nlej,jk) 400 ptab(nlei+1:nlci , jj ,jk) = ptab( nlei, nlej,jk) 401 END DO 402 DO ji = nlci+1, jpi ! added column(s) (full) 403 ptab(ji ,nldj :nlej ,jk) = ptab( nlei,nldj:nlej,jk) 404 ptab(ji ,1 :nldj-1,jk) = ptab( nlei,nldj ,jk) 405 ptab(ji ,nlej+1:jpj ,jk) = ptab( nlei, nlej,jk) 406 END DO 407 END DO 408 ! 409 ELSE ! standard close or cyclic treatment 410 ! 411 ! ! East-West boundaries 412 ! !* Cyclic east-west 413 IF( nbondi == 2 .AND. (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) ) THEN 414 ptab( 1 ,:,:) = ptab(jpim1,:,:) 415 ptab(jpi,:,:) = ptab( 2 ,:,:) 416 ELSE !* closed 417 IF( .NOT. cd_type == 'F' ) ptab( 1 :jpreci,:,:) = zland ! south except F-point 418 ptab(nlci-jpreci+1:jpi ,:,:) = zland ! north 419 ENDIF 420 ! ! North-South boundaries (always closed) 421 IF( .NOT. cd_type == 'F' ) ptab(:, 1 :jprecj,:) = zland ! south except F-point 422 ptab(:,nlcj-jprecj+1:jpj ,:) = zland ! north 423 ! 393 IF( nbondi == 2) THEN 394 IF (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) THEN 395 ptab( 1 ,:,:) = ptab(jpim1,:,:) 396 ptab(jpi,:,:) = ptab( 2 ,:,:) 397 ELSE 398 IF( .NOT. cd_type == 'F' ) ptab( 1 :jpreci,:,:) = zland ! south except F-point 399 ptab(nlci-jpreci+1:jpi ,:,:) = zland ! north 400 ENDIF 401 ELSEIF(nbondi == -1) THEN 402 IF( .NOT. cd_type == 'F' ) ptab( 1 :jpreci,:,:) = zland ! south except F-point 403 ELSEIF(nbondi == 1) THEN 404 ptab(nlci-jpreci+1:jpi ,:,:) = zland ! north 405 ENDIF !* closed 406 407 IF (nbondj == 2 .OR. nbondj == -1) THEN 408 IF( .NOT. cd_type == 'F' ) ptab(:, 1 :jprecj,:) = zland ! south except F-point 409 ELSEIF (nbondj == 2 .OR. nbondj == 1) THEN 410 ptab(:,nlcj-jprecj+1:jpj ,:) = zland ! north 424 411 ENDIF 425 412 … … 428 415 ! we play with the neigbours AND the row number because of the periodicity 429 416 ! 417 IF(nbondj .ne. 0) THEN 430 418 SELECT CASE ( nbondi ) ! Read Dirichlet lateral conditions 431 419 CASE ( -1, 0, 1 ) ! all exept 2 (i.e. close case) … … 466 454 ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 467 455 END DO 468 CASE ( 0 ) 456 CASE ( 0 ) 469 457 DO jl = 1, jpreci 470 458 ptab(jl ,:,:) = t3we(:,jl,:,2) … … 476 464 END DO 477 465 END SELECT 466 ENDIF 478 467 479 468 … … 482 471 ! always closed : we play only with the neigbours 483 472 ! 473 IF(nbondi .ne. 0) THEN 484 474 IF( nbondj /= 2 ) THEN ! Read Dirichlet lateral conditions 485 475 ijhom = nlcj-nrecj … … 519 509 ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 520 510 END DO 521 CASE ( 0 ) 511 CASE ( 0 ) 522 512 DO jl = 1, jprecj 523 513 ptab(:,jl ,:) = t3sn(:,jl,:,2) … … 529 519 END DO 530 520 END SELECT 521 ENDIF 531 522 532 523 … … 534 525 ! ----------------------- 535 526 ! 536 IF( npolj /= 0 .AND. .NOT. PRESENT(cd_mpp)) THEN527 IF( npolj /= 0 ) THEN 537 528 ! 538 529 SELECT CASE ( jpni ) … … 543 534 ENDIF 544 535 ! 545 END SUBROUTINE mpp_lnk_ 3d546 547 548 SUBROUTINE mpp_lnk_ 2d( pt2d, cd_type, psgn, cd_mpp, pval)549 !!---------------------------------------------------------------------- 550 !! *** routine mpp_lnk_ 2d ***536 END SUBROUTINE mpp_lnk_obc_3d 537 538 539 SUBROUTINE mpp_lnk_obc_2d( pt2d, cd_type, psgn ) 540 !!---------------------------------------------------------------------- 541 !! *** routine mpp_lnk_obc_2d *** 551 542 !! 552 543 !! ** Purpose : Message passing manadgement for 2d array 553 544 !! 554 !! ** Method : Use mppsend and mpprecv function for passing mask545 !! ** Method : Use mppsend and mpprecv function for passing OBC boundaries 555 546 !! between processors following neighboring subdomains. 556 547 !! domain parameters … … 570 561 REAL(wp) , INTENT(in ) :: psgn ! =-1 the sign change across the north fold boundary 571 562 ! ! = 1. , the sign is kept 572 CHARACTER(len=3), OPTIONAL , INTENT(in ) :: cd_mpp ! fill the overlap area only573 REAL(wp) , OPTIONAL , INTENT(in ) :: pval ! background value (used at closed boundaries)574 563 !! 575 564 INTEGER :: ji, jj, jl ! dummy loop indices … … 580 569 !!---------------------------------------------------------------------- 581 570 582 IF( PRESENT( pval ) ) THEN ; zland = pval ! set land value 583 ELSE ; zland = 0.e0 ! zero by default 584 ENDIF 571 zland = 0.e0 ! zero by default 585 572 586 573 ! 1. standard boundary treatment 587 574 ! ------------------------------ 588 575 ! 589 IF( PRESENT( cd_mpp ) ) THEN ! only fill added line/raw with existing values 590 ! 591 ! WARNING pt2d is defined only between nld and nle 592 DO jj = nlcj+1, jpj ! added line(s) (inner only) 593 pt2d(nldi :nlei , jj ) = pt2d(nldi:nlei, nlej) 594 pt2d(1 :nldi-1, jj ) = pt2d(nldi , nlej) 595 pt2d(nlei+1:nlci , jj ) = pt2d( nlei, nlej) 596 END DO 597 DO ji = nlci+1, jpi ! added column(s) (full) 598 pt2d(ji ,nldj :nlej ) = pt2d( nlei,nldj:nlej) 599 pt2d(ji ,1 :nldj-1) = pt2d( nlei,nldj ) 600 pt2d(ji ,nlej+1:jpj ) = pt2d( nlei, nlej) 601 END DO 602 ! 603 ELSE ! standard close or cyclic treatment 604 ! 605 ! ! East-West boundaries 606 IF( nbondi == 2 .AND. & ! Cyclic east-west 607 & (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) ) THEN 608 pt2d( 1 ,:) = pt2d(jpim1,:) ! west 609 pt2d(jpi,:) = pt2d( 2 ,:) ! east 610 ELSE ! closed 611 IF( .NOT. cd_type == 'F' ) pt2d( 1 :jpreci,:) = zland ! south except F-point 612 pt2d(nlci-jpreci+1:jpi ,:) = zland ! north 613 ENDIF 614 ! ! North-South boundaries (always closed) 615 IF( .NOT. cd_type == 'F' ) pt2d(:, 1 :jprecj) = zland !south except F-point 616 pt2d(:,nlcj-jprecj+1:jpj ) = zland ! north 617 ! 576 IF( nbondi == 2) THEN 577 IF (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) THEN 578 pt2d( 1 ,:) = pt2d(jpim1,:) 579 pt2d(jpi,:) = pt2d( 2 ,:) 580 ELSE 581 IF( .NOT. cd_type == 'F' ) pt2d( 1 :jpreci,:) = zland ! south except F-point 582 pt2d(nlci-jpreci+1:jpi ,:) = zland ! north 583 ENDIF 584 ELSEIF(nbondi == -1) THEN 585 IF( .NOT. cd_type == 'F' ) pt2d( 1 :jpreci,:) = zland ! south except F-point 586 ELSEIF(nbondi == 1) THEN 587 pt2d(nlci-jpreci+1:jpi ,:) = zland ! north 588 ENDIF !* closed 589 590 IF (nbondj == 2 .OR. nbondj == -1) THEN 591 IF( .NOT. cd_type == 'F' ) pt2d(:, 1 :jprecj) = zland ! south except F-point 592 ELSEIF (nbondj == 2 .OR. nbondj == 1) THEN 593 pt2d(:,nlcj-jprecj+1:jpj) = zland ! north 618 594 ENDIF 619 595 … … 728 704 ! ----------------------- 729 705 ! 706 IF( npolj /= 0 ) THEN 707 ! 708 SELECT CASE ( jpni ) 709 CASE ( 1 ) ; CALL lbc_nfd ( pt2d, cd_type, psgn ) ! only 1 northern proc, no mpp 710 CASE DEFAULT ; CALL mpp_lbc_north( pt2d, cd_type, psgn ) ! for all northern procs. 711 END SELECT 712 ! 713 ENDIF 714 ! 715 END SUBROUTINE mpp_lnk_obc_2d 716 717 SUBROUTINE mpp_lnk_3d( ptab, cd_type, psgn, cd_mpp, pval ) 718 !!---------------------------------------------------------------------- 719 !! *** routine mpp_lnk_3d *** 720 !! 721 !! ** Purpose : Message passing manadgement 722 !! 723 !! ** Method : Use mppsend and mpprecv function for passing mask 724 !! between processors following neighboring subdomains. 725 !! domain parameters 726 !! nlci : first dimension of the local subdomain 727 !! nlcj : second dimension of the local subdomain 728 !! nbondi : mark for "east-west local boundary" 729 !! nbondj : mark for "north-south local boundary" 730 !! noea : number for local neighboring processors 731 !! nowe : number for local neighboring processors 732 !! noso : number for local neighboring processors 733 !! nono : number for local neighboring processors 734 !! 735 !! ** Action : ptab with update value at its periphery 736 !! 737 !!---------------------------------------------------------------------- 738 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: ptab ! 3D array on which the boundary condition is applied 739 CHARACTER(len=1) , INTENT(in ) :: cd_type ! define the nature of ptab array grid-points 740 ! ! = T , U , V , F , W points 741 REAL(wp) , INTENT(in ) :: psgn ! =-1 the sign change across the north fold boundary 742 ! ! = 1. , the sign is kept 743 CHARACTER(len=3), OPTIONAL , INTENT(in ) :: cd_mpp ! fill the overlap area only 744 REAL(wp) , OPTIONAL , INTENT(in ) :: pval ! background value (used at closed boundaries) 745 !! 746 INTEGER :: ji, jj, jk, jl ! dummy loop indices 747 INTEGER :: imigr, iihom, ijhom ! temporary integers 748 INTEGER :: ml_req1, ml_req2, ml_err ! for key_mpi_isend 749 REAL(wp) :: zland 750 INTEGER, DIMENSION(MPI_STATUS_SIZE) :: ml_stat ! for key_mpi_isend 751 !!---------------------------------------------------------------------- 752 753 IF( PRESENT( pval ) ) THEN ; zland = pval ! set land value 754 ELSE ; zland = 0.e0 ! zero by default 755 ENDIF 756 757 ! 1. standard boundary treatment 758 ! ------------------------------ 759 IF( PRESENT( cd_mpp ) ) THEN ! only fill added line/raw with existing values 760 ! 761 ! WARNING ptab is defined only between nld and nle 762 DO jk = 1, jpk 763 DO jj = nlcj+1, jpj ! added line(s) (inner only) 764 ptab(nldi :nlei , jj ,jk) = ptab(nldi:nlei, nlej,jk) 765 ptab(1 :nldi-1, jj ,jk) = ptab(nldi , nlej,jk) 766 ptab(nlei+1:nlci , jj ,jk) = ptab( nlei, nlej,jk) 767 END DO 768 DO ji = nlci+1, jpi ! added column(s) (full) 769 ptab(ji ,nldj :nlej ,jk) = ptab( nlei,nldj:nlej,jk) 770 ptab(ji ,1 :nldj-1,jk) = ptab( nlei,nldj ,jk) 771 ptab(ji ,nlej+1:jpj ,jk) = ptab( nlei, nlej,jk) 772 END DO 773 END DO 774 ! 775 ELSE ! standard close or cyclic treatment 776 ! 777 ! ! East-West boundaries 778 ! !* Cyclic east-west 779 IF( nbondi == 2 .AND. (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) ) THEN 780 ptab( 1 ,:,:) = ptab(jpim1,:,:) 781 ptab(jpi,:,:) = ptab( 2 ,:,:) 782 ELSE !* closed 783 IF( .NOT. cd_type == 'F' ) ptab( 1 :jpreci,:,:) = zland ! south except F-point 784 ptab(nlci-jpreci+1:jpi ,:,:) = zland ! north 785 ENDIF 786 ! ! North-South boundaries (always closed) 787 IF( .NOT. cd_type == 'F' ) ptab(:, 1 :jprecj,:) = zland ! south except F-point 788 ptab(:,nlcj-jprecj+1:jpj ,:) = zland ! north 789 ! 790 ENDIF 791 792 ! 2. East and west directions exchange 793 ! ------------------------------------ 794 ! we play with the neigbours AND the row number because of the periodicity 795 ! 796 SELECT CASE ( nbondi ) ! Read Dirichlet lateral conditions 797 CASE ( -1, 0, 1 ) ! all exept 2 (i.e. close case) 798 iihom = nlci-nreci 799 DO jl = 1, jpreci 800 t3ew(:,jl,:,1) = ptab(jpreci+jl,:,:) 801 t3we(:,jl,:,1) = ptab(iihom +jl,:,:) 802 END DO 803 END SELECT 804 ! 805 ! ! Migrations 806 imigr = jpreci * jpj * jpk 807 ! 808 SELECT CASE ( nbondi ) 809 CASE ( -1 ) 810 CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req1 ) 811 CALL mpprecv( 1, t3ew(1,1,1,2), imigr, noea ) 812 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 813 CASE ( 0 ) 814 CALL mppsend( 1, t3ew(1,1,1,1), imigr, nowe, ml_req1 ) 815 CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req2 ) 816 CALL mpprecv( 1, t3ew(1,1,1,2), imigr, noea ) 817 CALL mpprecv( 2, t3we(1,1,1,2), imigr, nowe ) 818 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 819 IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 820 CASE ( 1 ) 821 CALL mppsend( 1, t3ew(1,1,1,1), imigr, nowe, ml_req1 ) 822 CALL mpprecv( 2, t3we(1,1,1,2), imigr, nowe ) 823 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 824 END SELECT 825 ! 826 ! ! Write Dirichlet lateral conditions 827 iihom = nlci-jpreci 828 ! 829 SELECT CASE ( nbondi ) 830 CASE ( -1 ) 831 DO jl = 1, jpreci 832 ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 833 END DO 834 CASE ( 0 ) 835 DO jl = 1, jpreci 836 ptab(jl ,:,:) = t3we(:,jl,:,2) 837 ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 838 END DO 839 CASE ( 1 ) 840 DO jl = 1, jpreci 841 ptab(jl ,:,:) = t3we(:,jl,:,2) 842 END DO 843 END SELECT 844 845 846 ! 3. North and south directions 847 ! ----------------------------- 848 ! always closed : we play only with the neigbours 849 ! 850 IF( nbondj /= 2 ) THEN ! Read Dirichlet lateral conditions 851 ijhom = nlcj-nrecj 852 DO jl = 1, jprecj 853 t3sn(:,jl,:,1) = ptab(:,ijhom +jl,:) 854 t3ns(:,jl,:,1) = ptab(:,jprecj+jl,:) 855 END DO 856 ENDIF 857 ! 858 ! ! Migrations 859 imigr = jprecj * jpi * jpk 860 ! 861 SELECT CASE ( nbondj ) 862 CASE ( -1 ) 863 CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req1 ) 864 CALL mpprecv( 3, t3ns(1,1,1,2), imigr, nono ) 865 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 866 CASE ( 0 ) 867 CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 868 CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req2 ) 869 CALL mpprecv( 3, t3ns(1,1,1,2), imigr, nono ) 870 CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) 871 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 872 IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 873 CASE ( 1 ) 874 CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 875 CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) 876 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 877 END SELECT 878 ! 879 ! ! Write Dirichlet lateral conditions 880 ijhom = nlcj-jprecj 881 ! 882 SELECT CASE ( nbondj ) 883 CASE ( -1 ) 884 DO jl = 1, jprecj 885 ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 886 END DO 887 CASE ( 0 ) 888 DO jl = 1, jprecj 889 ptab(:,jl ,:) = t3sn(:,jl,:,2) 890 ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 891 END DO 892 CASE ( 1 ) 893 DO jl = 1, jprecj 894 ptab(:,jl,:) = t3sn(:,jl,:,2) 895 END DO 896 END SELECT 897 898 899 ! 4. north fold treatment 900 ! ----------------------- 901 ! 902 IF( npolj /= 0 .AND. .NOT. PRESENT(cd_mpp) ) THEN 903 ! 904 SELECT CASE ( jpni ) 905 CASE ( 1 ) ; CALL lbc_nfd ( ptab, cd_type, psgn ) ! only 1 northern proc, no mpp 906 CASE DEFAULT ; CALL mpp_lbc_north( ptab, cd_type, psgn ) ! for all northern procs. 907 END SELECT 908 ! 909 ENDIF 910 ! 911 END SUBROUTINE mpp_lnk_3d 912 913 914 SUBROUTINE mpp_lnk_2d( pt2d, cd_type, psgn, cd_mpp, pval ) 915 !!---------------------------------------------------------------------- 916 !! *** routine mpp_lnk_2d *** 917 !! 918 !! ** Purpose : Message passing manadgement for 2d array 919 !! 920 !! ** Method : Use mppsend and mpprecv function for passing mask 921 !! between processors following neighboring subdomains. 922 !! domain parameters 923 !! nlci : first dimension of the local subdomain 924 !! nlcj : second dimension of the local subdomain 925 !! nbondi : mark for "east-west local boundary" 926 !! nbondj : mark for "north-south local boundary" 927 !! noea : number for local neighboring processors 928 !! nowe : number for local neighboring processors 929 !! noso : number for local neighboring processors 930 !! nono : number for local neighboring processors 931 !! 932 !!---------------------------------------------------------------------- 933 REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pt2d ! 2D array on which the boundary condition is applied 934 CHARACTER(len=1) , INTENT(in ) :: cd_type ! define the nature of ptab array grid-points 935 ! ! = T , U , V , F , W and I points 936 REAL(wp) , INTENT(in ) :: psgn ! =-1 the sign change across the north fold boundary 937 ! ! = 1. , the sign is kept 938 CHARACTER(len=3), OPTIONAL , INTENT(in ) :: cd_mpp ! fill the overlap area only 939 REAL(wp) , OPTIONAL , INTENT(in ) :: pval ! background value (used at closed boundaries) 940 !! 941 INTEGER :: ji, jj, jl ! dummy loop indices 942 INTEGER :: imigr, iihom, ijhom ! temporary integers 943 INTEGER :: ml_req1, ml_req2, ml_err ! for key_mpi_isend 944 REAL(wp) :: zland 945 INTEGER, DIMENSION(MPI_STATUS_SIZE) :: ml_stat ! for key_mpi_isend 946 !!---------------------------------------------------------------------- 947 948 IF( PRESENT( pval ) ) THEN ; zland = pval ! set land value 949 ELSE ; zland = 0.e0 ! zero by default 950 ENDIF 951 952 ! 1. standard boundary treatment 953 ! ------------------------------ 954 ! 955 IF( PRESENT( cd_mpp ) ) THEN ! only fill added line/raw with existing values 956 ! 957 ! WARNING pt2d is defined only between nld and nle 958 DO jj = nlcj+1, jpj ! added line(s) (inner only) 959 pt2d(nldi :nlei , jj ) = pt2d(nldi:nlei, nlej) 960 pt2d(1 :nldi-1, jj ) = pt2d(nldi , nlej) 961 pt2d(nlei+1:nlci , jj ) = pt2d( nlei, nlej) 962 END DO 963 DO ji = nlci+1, jpi ! added column(s) (full) 964 pt2d(ji ,nldj :nlej ) = pt2d( nlei,nldj:nlej) 965 pt2d(ji ,1 :nldj-1) = pt2d( nlei,nldj ) 966 pt2d(ji ,nlej+1:jpj ) = pt2d( nlei, nlej) 967 END DO 968 ! 969 ELSE ! standard close or cyclic treatment 970 ! 971 ! ! East-West boundaries 972 IF( nbondi == 2 .AND. & ! Cyclic east-west 973 & (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) ) THEN 974 pt2d( 1 ,:) = pt2d(jpim1,:) ! west 975 pt2d(jpi,:) = pt2d( 2 ,:) ! east 976 ELSE ! closed 977 IF( .NOT. cd_type == 'F' ) pt2d( 1 :jpreci,:) = zland ! south except F-point 978 pt2d(nlci-jpreci+1:jpi ,:) = zland ! north 979 ENDIF 980 ! ! North-South boundaries (always closed) 981 IF( .NOT. cd_type == 'F' ) pt2d(:, 1 :jprecj) = zland !south except F-point 982 pt2d(:,nlcj-jprecj+1:jpj ) = zland ! north 983 ! 984 ENDIF 985 986 ! 2. East and west directions exchange 987 ! ------------------------------------ 988 ! we play with the neigbours AND the row number because of the periodicity 989 ! 990 SELECT CASE ( nbondi ) ! Read Dirichlet lateral conditions 991 CASE ( -1, 0, 1 ) ! all exept 2 (i.e. close case) 992 iihom = nlci-nreci 993 DO jl = 1, jpreci 994 t2ew(:,jl,1) = pt2d(jpreci+jl,:) 995 t2we(:,jl,1) = pt2d(iihom +jl,:) 996 END DO 997 END SELECT 998 ! 999 ! ! Migrations 1000 imigr = jpreci * jpj 1001 ! 1002 SELECT CASE ( nbondi ) 1003 CASE ( -1 ) 1004 CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req1 ) 1005 CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 1006 IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 1007 CASE ( 0 ) 1008 CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 1009 CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req2 ) 1010 CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 1011 CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 1012 IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 1013 IF(l_isend) CALL mpi_wait(ml_req2,ml_stat,ml_err) 1014 CASE ( 1 ) 1015 CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 1016 CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 1017 IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 1018 END SELECT 1019 ! 1020 ! ! Write Dirichlet lateral conditions 1021 iihom = nlci - jpreci 1022 ! 1023 SELECT CASE ( nbondi ) 1024 CASE ( -1 ) 1025 DO jl = 1, jpreci 1026 pt2d(iihom+jl,:) = t2ew(:,jl,2) 1027 END DO 1028 CASE ( 0 ) 1029 DO jl = 1, jpreci 1030 pt2d(jl ,:) = t2we(:,jl,2) 1031 pt2d(iihom+jl,:) = t2ew(:,jl,2) 1032 END DO 1033 CASE ( 1 ) 1034 DO jl = 1, jpreci 1035 pt2d(jl ,:) = t2we(:,jl,2) 1036 END DO 1037 END SELECT 1038 1039 1040 ! 3. North and south directions 1041 ! ----------------------------- 1042 ! always closed : we play only with the neigbours 1043 ! 1044 IF( nbondj /= 2 ) THEN ! Read Dirichlet lateral conditions 1045 ijhom = nlcj-nrecj 1046 DO jl = 1, jprecj 1047 t2sn(:,jl,1) = pt2d(:,ijhom +jl) 1048 t2ns(:,jl,1) = pt2d(:,jprecj+jl) 1049 END DO 1050 ENDIF 1051 ! 1052 ! ! Migrations 1053 imigr = jprecj * jpi 1054 ! 1055 SELECT CASE ( nbondj ) 1056 CASE ( -1 ) 1057 CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req1 ) 1058 CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 1059 IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 1060 CASE ( 0 ) 1061 CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 1062 CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req2 ) 1063 CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 1064 CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 1065 IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 1066 IF(l_isend) CALL mpi_wait(ml_req2,ml_stat,ml_err) 1067 CASE ( 1 ) 1068 CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 1069 CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 1070 IF(l_isend) CALL mpi_wait(ml_req1,ml_stat,ml_err) 1071 END SELECT 1072 ! 1073 ! ! Write Dirichlet lateral conditions 1074 ijhom = nlcj - jprecj 1075 ! 1076 SELECT CASE ( nbondj ) 1077 CASE ( -1 ) 1078 DO jl = 1, jprecj 1079 pt2d(:,ijhom+jl) = t2ns(:,jl,2) 1080 END DO 1081 CASE ( 0 ) 1082 DO jl = 1, jprecj 1083 pt2d(:,jl ) = t2sn(:,jl,2) 1084 pt2d(:,ijhom+jl) = t2ns(:,jl,2) 1085 END DO 1086 CASE ( 1 ) 1087 DO jl = 1, jprecj 1088 pt2d(:,jl ) = t2sn(:,jl,2) 1089 END DO 1090 END SELECT 1091 1092 1093 ! 4. north fold treatment 1094 ! ----------------------- 1095 ! 730 1096 IF( npolj /= 0 .AND. .NOT. PRESENT(cd_mpp) ) THEN 731 1097 ! … … 1782 2148 INTEGER :: ml_stat(MPI_STATUS_SIZE) ! for key_mpi_isend 1783 2149 REAL(wp), POINTER, DIMENSION(:,:) :: ztab ! temporary workspace 2150 LOGICAL :: lmigr ! is true for those processors that have to migrate the OB 1784 2151 !!---------------------------------------------------------------------- 1785 2152 … … 1807 2174 CALL mppstop 1808 2175 ENDIF 1809 2176 1810 2177 ! Communication level by level 1811 2178 ! ---------------------------- 1812 2179 !!gm Remark : this is very time consumming!!! 1813 2180 ! ! ------------------------ ! 2181 IF( ijpt0 > ijpt1 .OR. iipt0 > iipt1 ) THEN 2182 ! there is nothing to be migrated 2183 lmigr = .FALSE. 2184 ELSE 2185 lmigr = .TRUE. 2186 ENDIF 2187 2188 IF( lmigr ) THEN 2189 1814 2190 DO jk = 1, kk ! Loop over the levels ! 1815 2191 ! ! ------------------------ ! … … 1833 2209 ! --------------------------- 1834 2210 ! 2211 IF( ktype == 1 ) THEN 2212 1835 2213 IF( nbondi /= 2 ) THEN ! Read Dirichlet lateral conditions 1836 2214 iihom = nlci-nreci 1837 DO jl = 1, jpreci 1838 t2ew(:,jl,1) = ztab(jpreci+jl,:) 1839 t2we(:,jl,1) = ztab(iihom +jl,:) 1840 END DO 2215 t2ew(1:jpreci,1,1) = ztab(jpreci+1:nreci, ijpt0) 2216 t2we(1:jpreci,1,1) = ztab(iihom+1:iihom+jpreci, ijpt0) 1841 2217 ENDIF 1842 2218 ! 1843 2219 ! ! Migrations 1844 imigr =jpreci*jpj2220 imigr = jpreci 1845 2221 ! 1846 2222 IF( nbondi == -1 ) THEN … … 1865 2241 ! 1866 2242 IF( nbondi == 0 .OR. nbondi == 1 ) THEN 1867 DO jl = 1, jpreci 1868 ztab(jl,:) = t2we(:,jl,2) 1869 END DO 2243 ztab(1:jpreci, ijpt0) = t2we(1:jpreci,1,2) 1870 2244 ENDIF 1871 2245 IF( nbondi == -1 .OR. nbondi == 0 ) THEN 1872 DO jl = 1, jpreci 1873 ztab(iihom+jl,:) = t2ew(:,jl,2) 1874 END DO 2246 ztab(iihom+1:iihom+jpreci, ijpt0) = t2ew(1:jpreci,1,2) 1875 2247 ENDIF 1876 2248 ENDIF ! (ktype == 1) 1877 2249 1878 2250 ! 2. North and south directions 1879 2251 ! ----------------------------- 1880 2252 ! 2253 IF(ktype == 2 ) THEN 1881 2254 IF( nbondj /= 2 ) THEN ! Read Dirichlet lateral conditions 1882 2255 ijhom = nlcj-nrecj 1883 DO jl = 1, jprecj 1884 t2sn(:,jl,1) = ztab(:,ijhom +jl) 1885 t2ns(:,jl,1) = ztab(:,jprecj+jl) 1886 END DO 2256 t2sn(1:jprecj,1,1) = ztab(iipt0, ijhom+1:ijhom+jprecj) 2257 t2ns(1:jprecj,1,1) = ztab(iipt0, jprecj+1:nrecj) 1887 2258 ENDIF 1888 2259 ! 1889 2260 ! ! Migrations 1890 imigr = jprecj * jpi2261 imigr = jprecj 1891 2262 ! 1892 2263 IF( nbondj == -1 ) THEN … … 1910 2281 ijhom = nlcj - jprecj 1911 2282 IF( nbondj == 0 .OR. nbondj == 1 ) THEN 1912 DO jl = 1, jprecj 1913 ztab(:,jl) = t2sn(:,jl,2) 1914 END DO 2283 ztab(iipt0,1:jprecj) = t2sn(1:jprecj,1,2) 1915 2284 ENDIF 1916 2285 IF( nbondj == 0 .OR. nbondj == -1 ) THEN 1917 DO jl = 1, jprecj 1918 ztab(:,ijhom+jl) = t2ns(:,jl,2) 1919 END DO 2286 ztab(iipt0, ijhom+1:ijhom+jprecj) = t2ns(1:jprecj,1,2) 1920 2287 ENDIF 2288 ENDIF ! (ktype == 2) 1921 2289 IF( ktype==1 .AND. kd1 <= jpi+nimpp-1 .AND. nimpp <= kd2 ) THEN 1922 2290 DO jj = ijpt0, ijpt1 ! north/south boundaries 1923 2291 DO ji = iipt0,ilpt1 1924 ptab(ji,jk) = ztab(ji,jj) 2292 ptab(ji,jk) = ztab(ji,jj) 1925 2293 END DO 1926 2294 END DO … … 1928 2296 DO jj = ijpt0, ilpt1 ! east/west boundaries 1929 2297 DO ji = iipt0,iipt1 1930 ptab(jj,jk) = ztab(ji,jj) 2298 ptab(jj,jk) = ztab(ji,jj) 1931 2299 END DO 1932 2300 END DO … … 1935 2303 END DO 1936 2304 ! 2305 ENDIF ! ( lmigr ) 1937 2306 CALL wrk_dealloc( jpi,jpj, ztab ) 1938 2307 ! … … 2534 2903 END SUBROUTINE mpp_lbc_north_e 2535 2904 2905 SUBROUTINE mpp_lnk_bdy_3d( ptab, cd_type, psgn, ib_bdy ) 2906 !!---------------------------------------------------------------------- 2907 !! *** routine mpp_lnk_bdy_3d *** 2908 !! 2909 !! ** Purpose : Message passing management 2910 !! 2911 !! ** Method : Use mppsend and mpprecv function for passing BDY boundaries 2912 !! between processors following neighboring subdomains. 2913 !! domain parameters 2914 !! nlci : first dimension of the local subdomain 2915 !! nlcj : second dimension of the local subdomain 2916 !! nbondi_bdy : mark for "east-west local boundary" 2917 !! nbondj_bdy : mark for "north-south local boundary" 2918 !! noea : number for local neighboring processors 2919 !! nowe : number for local neighboring processors 2920 !! noso : number for local neighboring processors 2921 !! nono : number for local neighboring processors 2922 !! 2923 !! ** Action : ptab with update value at its periphery 2924 !! 2925 !!---------------------------------------------------------------------- 2926 2927 USE lbcnfd ! north fold 2928 2929 INCLUDE 'mpif.h' 2930 2931 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: ptab ! 3D array on which the boundary condition is applied 2932 CHARACTER(len=1) , INTENT(in ) :: cd_type ! define the nature of ptab array grid-points 2933 ! ! = T , U , V , F , W points 2934 REAL(wp) , INTENT(in ) :: psgn ! =-1 the sign change across the north fold boundary 2935 ! ! = 1. , the sign is kept 2936 INTEGER , INTENT(in ) :: ib_bdy ! BDY boundary set 2937 INTEGER :: ji, jj, jk, jl ! dummy loop indices 2938 INTEGER :: imigr, iihom, ijhom ! temporary integers 2939 INTEGER :: ml_req1, ml_req2, ml_err ! for key_mpi_isend 2940 REAL(wp) :: zland 2941 INTEGER, DIMENSION(MPI_STATUS_SIZE) :: ml_stat ! for key_mpi_isend 2942 !!---------------------------------------------------------------------- 2943 2944 zland = 0.e0 2945 2946 ! 1. standard boundary treatment 2947 ! ------------------------------ 2948 2949 ! ! East-West boundaries 2950 ! !* Cyclic east-west 2951 2952 IF( nbondi == 2) THEN 2953 IF (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) THEN 2954 ptab( 1 ,:,:) = ptab(jpim1,:,:) 2955 ptab(jpi,:,:) = ptab( 2 ,:,:) 2956 ELSE 2957 IF( .NOT. cd_type == 'F' ) ptab( 1 :jpreci,:,:) = zland ! south except F-point 2958 ptab(nlci-jpreci+1:jpi ,:,:) = zland ! north 2959 ENDIF 2960 ELSEIF(nbondi == -1) THEN 2961 IF( .NOT. cd_type == 'F' ) ptab( 1 :jpreci,:,:) = zland ! south except F-point 2962 ELSEIF(nbondi == 1) THEN 2963 ptab(nlci-jpreci+1:jpi ,:,:) = zland ! north 2964 ENDIF !* closed 2965 2966 IF (nbondj == 2 .OR. nbondj == -1) THEN 2967 IF( .NOT. cd_type == 'F' ) ptab(:, 1 :jprecj,:) = zland ! south except F-point 2968 ELSEIF (nbondj == 2 .OR. nbondj == 1) THEN 2969 ptab(:,nlcj-jprecj+1:jpj ,:) = zland ! north 2970 ENDIF 2971 2972 ! 2973 2974 ! 2. East and west directions exchange 2975 ! ------------------------------------ 2976 ! we play with the neigbours AND the row number because of the periodicity 2977 ! 2978 SELECT CASE ( nbondi_bdy(ib_bdy) ) ! Read Dirichlet lateral conditions 2979 CASE ( -1, 0, 1 ) ! all exept 2 (i.e. close case) 2980 iihom = nlci-nreci 2981 DO jl = 1, jpreci 2982 t3ew(:,jl,:,1) = ptab(jpreci+jl,:,:) 2983 t3we(:,jl,:,1) = ptab(iihom +jl,:,:) 2984 END DO 2985 END SELECT 2986 ! 2987 ! ! Migrations 2988 imigr = jpreci * jpj * jpk 2989 ! 2990 SELECT CASE ( nbondi_bdy(ib_bdy) ) 2991 CASE ( -1 ) 2992 CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req1 ) 2993 CASE ( 0 ) 2994 CALL mppsend( 1, t3ew(1,1,1,1), imigr, nowe, ml_req1 ) 2995 CALL mppsend( 2, t3we(1,1,1,1), imigr, noea, ml_req2 ) 2996 CASE ( 1 ) 2997 CALL mppsend( 1, t3ew(1,1,1,1), imigr, nowe, ml_req1 ) 2998 END SELECT 2999 ! 3000 SELECT CASE ( nbondi_bdy_b(ib_bdy) ) 3001 CASE ( -1 ) 3002 CALL mpprecv( 1, t3ew(1,1,1,2), imigr, noea ) 3003 CASE ( 0 ) 3004 CALL mpprecv( 1, t3ew(1,1,1,2), imigr, noea ) 3005 CALL mpprecv( 2, t3we(1,1,1,2), imigr, nowe ) 3006 CASE ( 1 ) 3007 CALL mpprecv( 2, t3we(1,1,1,2), imigr, nowe ) 3008 END SELECT 3009 ! 3010 SELECT CASE ( nbondi_bdy(ib_bdy) ) 3011 CASE ( -1 ) 3012 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3013 CASE ( 0 ) 3014 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3015 IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 3016 CASE ( 1 ) 3017 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3018 END SELECT 3019 ! 3020 ! ! Write Dirichlet lateral conditions 3021 iihom = nlci-jpreci 3022 ! 3023 SELECT CASE ( nbondi_bdy_b(ib_bdy) ) 3024 CASE ( -1 ) 3025 DO jl = 1, jpreci 3026 ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 3027 END DO 3028 CASE ( 0 ) 3029 DO jl = 1, jpreci 3030 ptab(jl ,:,:) = t3we(:,jl,:,2) 3031 ptab(iihom+jl,:,:) = t3ew(:,jl,:,2) 3032 END DO 3033 CASE ( 1 ) 3034 DO jl = 1, jpreci 3035 ptab(jl ,:,:) = t3we(:,jl,:,2) 3036 END DO 3037 END SELECT 3038 3039 3040 ! 3. North and south directions 3041 ! ----------------------------- 3042 ! always closed : we play only with the neigbours 3043 ! 3044 IF( nbondj_bdy(ib_bdy) /= 2 ) THEN ! Read Dirichlet lateral conditions 3045 ijhom = nlcj-nrecj 3046 DO jl = 1, jprecj 3047 t3sn(:,jl,:,1) = ptab(:,ijhom +jl,:) 3048 t3ns(:,jl,:,1) = ptab(:,jprecj+jl,:) 3049 END DO 3050 ENDIF 3051 ! 3052 ! ! Migrations 3053 imigr = jprecj * jpi * jpk 3054 ! 3055 SELECT CASE ( nbondj_bdy(ib_bdy) ) 3056 CASE ( -1 ) 3057 CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req1 ) 3058 CASE ( 0 ) 3059 CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 3060 CALL mppsend( 4, t3sn(1,1,1,1), imigr, nono, ml_req2 ) 3061 CASE ( 1 ) 3062 CALL mppsend( 3, t3ns(1,1,1,1), imigr, noso, ml_req1 ) 3063 END SELECT 3064 ! 3065 SELECT CASE ( nbondj_bdy_b(ib_bdy) ) 3066 CASE ( -1 ) 3067 CALL mpprecv( 3, t3ns(1,1,1,2), imigr, nono ) 3068 CASE ( 0 ) 3069 CALL mpprecv( 3, t3ns(1,1,1,2), imigr, nono ) 3070 CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) 3071 CASE ( 1 ) 3072 CALL mpprecv( 4, t3sn(1,1,1,2), imigr, noso ) 3073 END SELECT 3074 ! 3075 SELECT CASE ( nbondj_bdy(ib_bdy) ) 3076 CASE ( -1 ) 3077 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3078 CASE ( 0 ) 3079 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3080 IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 3081 CASE ( 1 ) 3082 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3083 END SELECT 3084 ! 3085 ! ! Write Dirichlet lateral conditions 3086 ijhom = nlcj-jprecj 3087 ! 3088 SELECT CASE ( nbondj_bdy_b(ib_bdy) ) 3089 CASE ( -1 ) 3090 DO jl = 1, jprecj 3091 ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 3092 END DO 3093 CASE ( 0 ) 3094 DO jl = 1, jprecj 3095 ptab(:,jl ,:) = t3sn(:,jl,:,2) 3096 ptab(:,ijhom+jl,:) = t3ns(:,jl,:,2) 3097 END DO 3098 CASE ( 1 ) 3099 DO jl = 1, jprecj 3100 ptab(:,jl,:) = t3sn(:,jl,:,2) 3101 END DO 3102 END SELECT 3103 3104 3105 ! 4. north fold treatment 3106 ! ----------------------- 3107 ! 3108 IF( npolj /= 0) THEN 3109 ! 3110 SELECT CASE ( jpni ) 3111 CASE ( 1 ) ; CALL lbc_nfd ( ptab, cd_type, psgn ) ! only 1 northern proc, no mpp 3112 CASE DEFAULT ; CALL mpp_lbc_north( ptab, cd_type, psgn ) ! for all northern procs. 3113 END SELECT 3114 ! 3115 ENDIF 3116 ! 3117 END SUBROUTINE mpp_lnk_bdy_3d 3118 3119 SUBROUTINE mpp_lnk_bdy_2d( ptab, cd_type, psgn, ib_bdy ) 3120 !!---------------------------------------------------------------------- 3121 !! *** routine mpp_lnk_bdy_2d *** 3122 !! 3123 !! ** Purpose : Message passing management 3124 !! 3125 !! ** Method : Use mppsend and mpprecv function for passing BDY boundaries 3126 !! between processors following neighboring subdomains. 3127 !! domain parameters 3128 !! nlci : first dimension of the local subdomain 3129 !! nlcj : second dimension of the local subdomain 3130 !! nbondi_bdy : mark for "east-west local boundary" 3131 !! nbondj_bdy : mark for "north-south local boundary" 3132 !! noea : number for local neighboring processors 3133 !! nowe : number for local neighboring processors 3134 !! noso : number for local neighboring processors 3135 !! nono : number for local neighboring processors 3136 !! 3137 !! ** Action : ptab with update value at its periphery 3138 !! 3139 !!---------------------------------------------------------------------- 3140 3141 USE lbcnfd ! north fold 3142 3143 INCLUDE 'mpif.h' 3144 3145 REAL(wp), DIMENSION(jpi,jpj) , INTENT(inout) :: ptab ! 3D array on which the boundary condition is applied 3146 CHARACTER(len=1) , INTENT(in ) :: cd_type ! define the nature of ptab array grid-points 3147 ! ! = T , U , V , F , W points 3148 REAL(wp) , INTENT(in ) :: psgn ! =-1 the sign change across the north fold boundary 3149 ! ! = 1. , the sign is kept 3150 INTEGER , INTENT(in ) :: ib_bdy ! BDY boundary set 3151 INTEGER :: ji, jj, jl ! dummy loop indices 3152 INTEGER :: imigr, iihom, ijhom ! temporary integers 3153 INTEGER :: ml_req1, ml_req2, ml_err ! for key_mpi_isend 3154 REAL(wp) :: zland 3155 INTEGER, DIMENSION(MPI_STATUS_SIZE) :: ml_stat ! for key_mpi_isend 3156 !!---------------------------------------------------------------------- 3157 3158 zland = 0.e0 3159 3160 ! 1. standard boundary treatment 3161 ! ------------------------------ 3162 3163 ! ! East-West boundaries 3164 ! !* Cyclic east-west 3165 3166 IF( nbondi == 2) THEN 3167 IF (nperio == 1 .OR. nperio == 4 .OR. nperio == 6) THEN 3168 ptab( 1 ,:) = ptab(jpim1,:) 3169 ptab(jpi,:) = ptab( 2 ,:) 3170 ELSE 3171 IF( .NOT. cd_type == 'F' ) ptab( 1 :jpreci,:) = zland ! south except F-point 3172 ptab(nlci-jpreci+1:jpi ,:) = zland ! north 3173 ENDIF 3174 ELSEIF(nbondi == -1) THEN 3175 IF( .NOT. cd_type == 'F' ) ptab( 1 :jpreci,:) = zland ! south except F-point 3176 ELSEIF(nbondi == 1) THEN 3177 ptab(nlci-jpreci+1:jpi ,:) = zland ! north 3178 ENDIF !* closed 3179 3180 IF (nbondj == 2 .OR. nbondj == -1) THEN 3181 IF( .NOT. cd_type == 'F' ) ptab(:, 1 :jprecj) = zland ! south except F-point 3182 ELSEIF (nbondj == 2 .OR. nbondj == 1) THEN 3183 ptab(:,nlcj-jprecj+1:jpj) = zland ! north 3184 ENDIF 3185 3186 ! 3187 3188 ! 2. East and west directions exchange 3189 ! ------------------------------------ 3190 ! we play with the neigbours AND the row number because of the periodicity 3191 ! 3192 SELECT CASE ( nbondi_bdy(ib_bdy) ) ! Read Dirichlet lateral conditions 3193 CASE ( -1, 0, 1 ) ! all exept 2 (i.e. close case) 3194 iihom = nlci-nreci 3195 DO jl = 1, jpreci 3196 t2ew(:,jl,1) = ptab(jpreci+jl,:) 3197 t2we(:,jl,1) = ptab(iihom +jl,:) 3198 END DO 3199 END SELECT 3200 ! 3201 ! ! Migrations 3202 imigr = jpreci * jpj 3203 ! 3204 SELECT CASE ( nbondi_bdy(ib_bdy) ) 3205 CASE ( -1 ) 3206 CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req1 ) 3207 CASE ( 0 ) 3208 CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 3209 CALL mppsend( 2, t2we(1,1,1), imigr, noea, ml_req2 ) 3210 CASE ( 1 ) 3211 CALL mppsend( 1, t2ew(1,1,1), imigr, nowe, ml_req1 ) 3212 END SELECT 3213 ! 3214 SELECT CASE ( nbondi_bdy_b(ib_bdy) ) 3215 CASE ( -1 ) 3216 CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 3217 CASE ( 0 ) 3218 CALL mpprecv( 1, t2ew(1,1,2), imigr, noea ) 3219 CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 3220 CASE ( 1 ) 3221 CALL mpprecv( 2, t2we(1,1,2), imigr, nowe ) 3222 END SELECT 3223 ! 3224 SELECT CASE ( nbondi_bdy(ib_bdy) ) 3225 CASE ( -1 ) 3226 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3227 CASE ( 0 ) 3228 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3229 IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 3230 CASE ( 1 ) 3231 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3232 END SELECT 3233 ! 3234 ! ! Write Dirichlet lateral conditions 3235 iihom = nlci-jpreci 3236 ! 3237 SELECT CASE ( nbondi_bdy_b(ib_bdy) ) 3238 CASE ( -1 ) 3239 DO jl = 1, jpreci 3240 ptab(iihom+jl,:) = t2ew(:,jl,2) 3241 END DO 3242 CASE ( 0 ) 3243 DO jl = 1, jpreci 3244 ptab(jl ,:) = t2we(:,jl,2) 3245 ptab(iihom+jl,:) = t2ew(:,jl,2) 3246 END DO 3247 CASE ( 1 ) 3248 DO jl = 1, jpreci 3249 ptab(jl ,:) = t2we(:,jl,2) 3250 END DO 3251 END SELECT 3252 3253 3254 ! 3. North and south directions 3255 ! ----------------------------- 3256 ! always closed : we play only with the neigbours 3257 ! 3258 IF( nbondj_bdy(ib_bdy) /= 2 ) THEN ! Read Dirichlet lateral conditions 3259 ijhom = nlcj-nrecj 3260 DO jl = 1, jprecj 3261 t2sn(:,jl,1) = ptab(:,ijhom +jl) 3262 t2ns(:,jl,1) = ptab(:,jprecj+jl) 3263 END DO 3264 ENDIF 3265 ! 3266 ! ! Migrations 3267 imigr = jprecj * jpi 3268 ! 3269 SELECT CASE ( nbondj_bdy(ib_bdy) ) 3270 CASE ( -1 ) 3271 CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req1 ) 3272 CASE ( 0 ) 3273 CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 3274 CALL mppsend( 4, t2sn(1,1,1), imigr, nono, ml_req2 ) 3275 CASE ( 1 ) 3276 CALL mppsend( 3, t2ns(1,1,1), imigr, noso, ml_req1 ) 3277 END SELECT 3278 ! 3279 SELECT CASE ( nbondj_bdy_b(ib_bdy) ) 3280 CASE ( -1 ) 3281 CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 3282 CASE ( 0 ) 3283 CALL mpprecv( 3, t2ns(1,1,2), imigr, nono ) 3284 CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 3285 CASE ( 1 ) 3286 CALL mpprecv( 4, t2sn(1,1,2), imigr, noso ) 3287 END SELECT 3288 ! 3289 SELECT CASE ( nbondj_bdy(ib_bdy) ) 3290 CASE ( -1 ) 3291 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3292 CASE ( 0 ) 3293 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3294 IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err) 3295 CASE ( 1 ) 3296 IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err) 3297 END SELECT 3298 ! 3299 ! ! Write Dirichlet lateral conditions 3300 ijhom = nlcj-jprecj 3301 ! 3302 SELECT CASE ( nbondj_bdy_b(ib_bdy) ) 3303 CASE ( -1 ) 3304 DO jl = 1, jprecj 3305 ptab(:,ijhom+jl) = t2ns(:,jl,2) 3306 END DO 3307 CASE ( 0 ) 3308 DO jl = 1, jprecj 3309 ptab(:,jl ) = t2sn(:,jl,2) 3310 ptab(:,ijhom+jl) = t2ns(:,jl,2) 3311 END DO 3312 CASE ( 1 ) 3313 DO jl = 1, jprecj 3314 ptab(:,jl) = t2sn(:,jl,2) 3315 END DO 3316 END SELECT 3317 3318 3319 ! 4. north fold treatment 3320 ! ----------------------- 3321 ! 3322 IF( npolj /= 0) THEN 3323 ! 3324 SELECT CASE ( jpni ) 3325 CASE ( 1 ) ; CALL lbc_nfd ( ptab, cd_type, psgn ) ! only 1 northern proc, no mpp 3326 CASE DEFAULT ; CALL mpp_lbc_north( ptab, cd_type, psgn ) ! for all northern procs. 3327 END SELECT 3328 ! 3329 ENDIF 3330 ! 3331 END SUBROUTINE mpp_lnk_bdy_2d 2536 3332 2537 3333 SUBROUTINE mpi_init_opa( ldtxt, ksft, code ) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/OBC/obcdyn.F90
r3294 r3680 5 5 !! Ocean dynamics: Radiation of velocities on each open boundary 6 6 !!================================================================================= 7 7 !! History : 3.5 ! 2012 (S. Mocavero, I. Epicoco) Updates for the 8 !! optimization of OBC communications 8 9 !!--------------------------------------------------------------------------------- 9 10 !! obc_dyn : call the subroutine for each open boundary … … 105 106 IF( lk_mpp ) THEN 106 107 IF( kt >= nit000+3 .AND. ln_rstart ) THEN 107 CALL lbc_ lnk( ub, 'U', -1. )108 CALL lbc_ lnk( vb, 'V', -1. )108 CALL lbc_obc_lnk( ub, 'U', -1. ) 109 CALL lbc_obc_lnk( vb, 'V', -1. ) 109 110 END IF 110 CALL lbc_ lnk( ua, 'U', -1. )111 CALL lbc_ lnk( va, 'V', -1. )111 CALL lbc_obc_lnk( ua, 'U', -1. ) 112 CALL lbc_obc_lnk( va, 'V', -1. ) 112 113 ENDIF 113 114 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/OBC/obcdyn_bt.F90
r3294 r3680 5 5 !!====================================================================== 6 6 !! History : 1.0 ! 2005-12 (V. Garnier) original code 7 !! 3.5 ! 2012 (S. Mocavero, I. Epicoco) Updates for the 8 !! optimization of OBC communications 7 9 !!---------------------------------------------------------------------- 8 10 #if ( defined key_dynspg_ts || defined key_dynspg_exp ) && defined key_obc … … 65 67 IF( lk_mpp ) THEN 66 68 IF( kt >= nit000+3 .AND. ln_rstart ) THEN 67 CALL lbc_ lnk( sshb, 'T', 1. )68 CALL lbc_ lnk( ub , 'U', -1. )69 CALL lbc_ lnk( vb , 'V', -1. )69 CALL lbc_obc_lnk( sshb, 'T', 1. ) 70 CALL lbc_obc_lnk( ub , 'U', -1. ) 71 CALL lbc_obc_lnk( vb , 'V', -1. ) 70 72 END IF 71 CALL lbc_ lnk( sshn, 'T', 1. )72 CALL lbc_ lnk( ua , 'U', -1. )73 CALL lbc_ lnk( va , 'V', -1. )73 CALL lbc_obc_lnk( sshn, 'T', 1. ) 74 CALL lbc_obc_lnk( ua , 'U', -1. ) 75 CALL lbc_obc_lnk( va , 'V', -1. ) 74 76 ENDIF 75 77 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/OBC/obctra.F90
r3294 r3680 4 4 !! Ocean tracers: Radiation of tracers on each open boundary 5 5 !!================================================================================= 6 !! History : 3.5 ! 2012 (S. Mocavero, I. Epicoco) Updates for the 7 !! optimization of OBC communications 6 8 #if defined key_obc 7 9 !!--------------------------------------------------------------------------------- … … 101 103 IF( lk_mpp ) THEN !!bug ??? 102 104 IF( kt >= nit000+3 .AND. ln_rstart ) THEN 103 CALL lbc_ lnk( tsb(:,:,:,jp_tem), 'T', 1. )104 CALL lbc_ lnk( tsb(:,:,:,jp_sal), 'T', 1. )105 CALL lbc_obc_lnk( tsb(:,:,:,jp_tem), 'T', 1. ) 106 CALL lbc_obc_lnk( tsb(:,:,:,jp_sal), 'T', 1. ) 105 107 END IF 106 CALL lbc_ lnk( tsa(:,:,:,jp_tem), 'T', 1. )107 CALL lbc_ lnk( tsa(:,:,:,jp_sal), 'T', 1. )108 CALL lbc_obc_lnk( tsa(:,:,:,jp_tem), 'T', 1. ) 109 CALL lbc_obc_lnk( tsa(:,:,:,jp_sal), 'T', 1. ) 108 110 ENDIF 109 111 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90
r3651 r3680 629 629 INTEGER :: ipk ! number of vertical levels of sdjf%fdta ( 2D: ipk=1 ; 3D: ipk=jpk ) 630 630 INTEGER :: iw ! index into wgts array 631 !!--------------------------------------------------------------------- 632 631 INTEGER :: ipdom ! index of the domain 632 !!--------------------------------------------------------------------- 633 ! 633 634 ipk = SIZE( sdjf%fnow, 3 ) 634 635 ! 635 636 IF( PRESENT(map) ) THEN 636 637 IF( sdjf%ln_tint ) THEN ; CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fdta(:,:,:,2), sdjf%nrec_a(1), map ) … … 643 644 ENDIF 644 645 ELSE 646 IF( SIZE(sdjf%fnow, 1) == jpi ) THEN ; ipdom = jpdom_data 647 ELSE ; ipdom = jpdom_unknown 648 ENDIF 645 649 SELECT CASE( ipk ) 646 CASE(1) 647 IF( sdjf%ln_tint ) THEN ; CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fdta(:,:,1,2), sdjf%nrec_a(1) )648 ELSE ; CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fnow(:,:,1 ), sdjf%nrec_a(1) )650 CASE(1) 651 IF( sdjf%ln_tint ) THEN ; CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fdta(:,:,1,2), sdjf%nrec_a(1) ) 652 ELSE ; CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fnow(:,:,1 ), sdjf%nrec_a(1) ) 649 653 ENDIF 650 654 CASE DEFAULT 651 IF( sdjf%ln_tint ) THEN ; CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fdta(:,:,:,2), sdjf%nrec_a(1) )652 ELSE ; CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fnow(:,:,: ), sdjf%nrec_a(1) )655 IF( sdjf%ln_tint ) THEN ; CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fdta(:,:,:,2), sdjf%nrec_a(1) ) 656 ELSE ; CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fnow(:,:,: ), sdjf%nrec_a(1) ) 653 657 ENDIF 654 658 END SELECT … … 850 854 IF( LEN( TRIM(sdf_n(jf)%wname) ) > 0 ) sdf(jf)%wgtname = TRIM( cdir )//TRIM( sdf_n(jf)%wname ) 851 855 sdf(jf)%vcomp = sdf_n(jf)%vcomp 856 sdf(jf)%rotn = .FALSE. 852 857 END DO 853 858 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
r3625 r3680 49 49 ! !: = 1 global mean of e-p-r set to zero at each nn_fsbc time step 50 50 ! !: = 2 annual global mean of e-p-r set to zero 51 LOGICAL , PUBLIC :: ln_cdgw = .FALSE. !: true if neutral drag coefficient read from wave model 51 LOGICAL , PUBLIC :: ln_wave = .FALSE. !: true if some coupling with wave model 52 LOGICAL , PUBLIC :: ln_cdgw = .FALSE. !: true if neutral drag coefficient from wave model 53 LOGICAL , PUBLIC :: ln_sdw = .FALSE. !: true if 3d stokes drift from wave model 52 54 53 55 !!---------------------------------------------------------------------- -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90
r3651 r3680 20 20 USE iom ! IOM library 21 21 USE lib_mpp ! MPP library 22 USE restart ! ocean restart23 22 24 23 IMPLICIT NONE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
r3625 r3680 29 29 USE fldread ! read input fields 30 30 USE sbc_oce ! Surface boundary condition: ocean fields 31 USE cyclone ! Cyclone 10m wind form trac of cyclone centres 31 32 USE sbcdcy ! surface boundary condition: diurnal cycle 32 33 USE iom ! I/O manager library … … 186 187 187 188 ! ! compute the surface ocean fluxes using CORE bulk formulea 188 IF( MOD( kt - 1, nn_fsbc ) == 0 ) CALL blk_oce_core( sf, sst_m, ssu_m, ssv_m )189 IF( MOD( kt - 1, nn_fsbc ) == 0 ) CALL blk_oce_core( kt, sf, sst_m, ssu_m, ssv_m ) 189 190 190 191 #if defined key_cice … … 204 205 205 206 206 SUBROUTINE blk_oce_core( sf, pst, pu, pv )207 SUBROUTINE blk_oce_core( kt, sf, pst, pu, pv ) 207 208 !!--------------------------------------------------------------------- 208 209 !! *** ROUTINE blk_core *** … … 225 226 !! ** Nota : sf has to be a dummy argument for AGRIF on NEC 226 227 !!--------------------------------------------------------------------- 227 TYPE(fld), INTENT(in), DIMENSION(:) :: sf ! input data 228 REAL(wp) , INTENT(in), DIMENSION(:,:) :: pst ! surface temperature [Celcius] 229 REAL(wp) , INTENT(in), DIMENSION(:,:) :: pu ! surface current at U-point (i-component) [m/s] 230 REAL(wp) , INTENT(in), DIMENSION(:,:) :: pv ! surface current at V-point (j-component) [m/s] 228 INTEGER , INTENT(in ) :: kt ! time step index 229 TYPE(fld), INTENT(inout), DIMENSION(:) :: sf ! input data 230 REAL(wp) , INTENT(in) , DIMENSION(:,:) :: pst ! surface temperature [Celcius] 231 REAL(wp) , INTENT(in) , DIMENSION(:,:) :: pu ! surface current at U-point (i-component) [m/s] 232 REAL(wp) , INTENT(in) , DIMENSION(:,:) :: pv ! surface current at V-point (j-component) [m/s] 231 233 ! 232 234 INTEGER :: ji, jj ! dummy loop indices … … 261 263 zwnd_i(:,:) = 0.e0 262 264 zwnd_j(:,:) = 0.e0 265 #if defined key_cyclone 266 # if defined key_vectopt_loop 267 !CDIR COLLAPSE 268 # endif 269 CALL wnd_cyc( kt, zwnd_i, zwnd_j ) ! add Manu ! 270 DO jj = 2, jpjm1 271 DO ji = fs_2, fs_jpim1 ! vect. opt. 272 sf(jp_wndi)%fnow(ji,jj,1) = sf(jp_wndi)%fnow(ji,jj,1) + zwnd_i(ji,jj) 273 sf(jp_wndj)%fnow(ji,jj,1) = sf(jp_wndj)%fnow(ji,jj,1) + zwnd_j(ji,jj) 274 END DO 275 END DO 276 #endif 263 277 #if defined key_vectopt_loop 264 278 !CDIR COLLAPSE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
r3632 r3680 41 41 #endif 42 42 USE geo2ocean ! 43 USE restart !44 43 USE oce , ONLY : tsn, un, vn 45 44 USE albedo ! … … 381 380 & srcv( (/jpr_otz1, jpr_otz2, jpr_itz1, jpr_itz2/) )%laction = .FALSE. 382 381 ! 382 IF( TRIM( sn_rcv_tau%clvor ) == 'local grid' ) THEN ! already on local grid -> no need of the second grid 383 srcv(jpr_otx2:jpr_otz2)%laction = .FALSE. 384 srcv(jpr_itx2:jpr_itz2)%laction = .FALSE. 385 srcv(jpr_oty1)%clgrid = srcv(jpr_oty2)%clgrid ! not needed but cleaner... 386 srcv(jpr_ity1)%clgrid = srcv(jpr_ity2)%clgrid ! not needed but cleaner... 387 ENDIF 388 ! 383 389 IF( TRIM( sn_rcv_tau%cldes ) /= 'oce and ice' ) THEN ! 'oce and ice' case ocean stress on ocean mesh used 384 390 srcv(jpr_itx1:jpr_itz2)%laction = .FALSE. ! ice components not received … … 520 526 ssnd(jps_tmix)%clname = 'O_TepMix' 521 527 SELECT CASE( TRIM( sn_snd_temp%cldes ) ) 528 CASE( 'none' ) ! nothing to do 522 529 CASE( 'oce only' ) ; ssnd( jps_toce )%laction = .TRUE. 523 530 CASE( 'weighted oce and ice' ) … … 562 569 563 570 SELECT CASE ( TRIM( sn_snd_thick%cldes ) ) 564 CASE ( 'ice and snow' ) 571 CASE( 'none' ) ! nothing to do 572 CASE( 'ice and snow' ) 565 573 ssnd(jps_hice:jps_hsnw)%laction = .TRUE. 566 574 IF ( TRIM( sn_snd_thick%clcat ) == 'yes' ) THEN … … 568 576 ELSE 569 577 IF ( jpl > 1 ) THEN 570 578 CALL ctl_stop( 'sbc_cpl_init: use weighted ice and snow option for sn_snd_thick%cldes if not exchanging category fields' ) 571 579 ENDIF 572 580 ENDIF … … 1357 1365 ! ! Surface temperature ! in Kelvin 1358 1366 ! ! ------------------------- ! 1359 SELECT CASE( sn_snd_temp%cldes) 1360 CASE( 'oce only' ) ; ztmp1(:,:) = tsn(:,:,1,jp_tem) + rt0 1361 CASE( 'weighted oce and ice' ) ; ztmp1(:,:) = ( tsn(:,:,1,jp_tem) + rt0 ) * zfr_l(:,:) 1362 SELECT CASE( sn_snd_temp%clcat ) 1363 CASE( 'yes' ) 1364 ztmp3(:,:,1:jpl) = tn_ice(:,:,1:jpl) * a_i(:,:,1:jpl) 1365 CASE( 'no' ) 1366 ztmp3(:,:,:) = 0._wp 1367 IF( ssnd(jps_toce)%laction .OR. ssnd(jps_tice)%laction .OR. ssnd(jps_tmix)%laction ) THEN 1368 SELECT CASE( sn_snd_temp%cldes) 1369 CASE( 'oce only' ) ; ztmp1(:,:) = tsn(:,:,1,jp_tem) + rt0 1370 CASE( 'weighted oce and ice' ) ; ztmp1(:,:) = ( tsn(:,:,1,jp_tem) + rt0 ) * zfr_l(:,:) 1371 SELECT CASE( sn_snd_temp%clcat ) 1372 CASE( 'yes' ) 1373 ztmp3(:,:,1:jpl) = tn_ice(:,:,1:jpl) * a_i(:,:,1:jpl) 1374 CASE( 'no' ) 1375 ztmp3(:,:,:) = 0.0 1376 DO jl=1,jpl 1377 ztmp3(:,:,1) = ztmp3(:,:,1) + tn_ice(:,:,jl) * a_i(:,:,jl) 1378 ENDDO 1379 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%clcat' ) 1380 END SELECT 1381 CASE( 'mixed oce-ice' ) 1382 ztmp1(:,:) = ( tsn(:,:,1,1) + rt0 ) * zfr_l(:,:) 1367 1383 DO jl=1,jpl 1368 ztmp 3(:,:,1) = ztmp3(:,:,1) + tn_ice(:,:,jl) * a_i(:,:,jl)1384 ztmp1(:,:) = ztmp1(:,:) + tn_ice(:,:,jl) * a_i(:,:,jl) 1369 1385 ENDDO 1370 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%clcat' )1386 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%cldes' ) 1371 1387 END SELECT 1372 CASE( 'mixed oce-ice' ) 1373 ztmp1(:,:) = ( tsn(:,:,1,1) + rt0 ) * zfr_l(:,:) 1374 DO jl=1,jpl 1375 ztmp1(:,:) = ztmp1(:,:) + tn_ice(:,:,jl) * a_i(:,:,jl) 1376 ENDDO 1377 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%cldes' ) 1378 END SELECT 1379 IF( ssnd(jps_toce)%laction ) CALL cpl_prism_snd( jps_toce, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 1380 IF( ssnd(jps_tice)%laction ) CALL cpl_prism_snd( jps_tice, isec, ztmp3, info ) 1381 IF( ssnd(jps_tmix)%laction ) CALL cpl_prism_snd( jps_tmix, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 1388 IF( ssnd(jps_toce)%laction ) CALL cpl_prism_snd( jps_toce, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 1389 IF( ssnd(jps_tice)%laction ) CALL cpl_prism_snd( jps_tice, isec, ztmp3, info ) 1390 IF( ssnd(jps_tmix)%laction ) CALL cpl_prism_snd( jps_tmix, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 1391 ENDIF 1382 1392 ! 1383 1393 ! ! ------------------------- ! … … 1399 1409 ! ! ------------------------- ! 1400 1410 ! Send ice fraction field 1401 SELECT CASE( sn_snd_thick%clcat )1402 CASE( 'yes' )1403 ztmp3(:,:,1:jpl) = a_i(:,:,1:jpl)1404 CASE( 'no' )1405 ztmp3(:,:,1) = fr_i(:,:)1406 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' )1407 END SELECT1408 IF( ssnd(jps_fice)%laction ) CALL cpl_prism_snd( jps_fice, isec, ztmp3, info )1411 IF( ssnd(jps_fice)%laction ) THEN 1412 SELECT CASE( sn_snd_thick%clcat ) 1413 CASE( 'yes' ) ; ztmp3(:,:,1:jpl) = a_i(:,:,1:jpl) 1414 CASE( 'no' ) ; ztmp3(:,:,1 ) = fr_i(:,: ) 1415 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 1416 END SELECT 1417 CALL cpl_prism_snd( jps_fice, isec, ztmp3, info ) 1418 ENDIF 1409 1419 1410 1420 ! Send ice and snow thickness field 1411 SELECT CASE( sn_snd_thick%cldes) 1412 CASE( 'weighted ice and snow' ) 1413 SELECT CASE( sn_snd_thick%clcat ) 1414 CASE( 'yes' ) 1415 ztmp3(:,:,1:jpl) = ht_i(:,:,1:jpl) * a_i(:,:,1:jpl) 1416 ztmp4(:,:,1:jpl) = ht_s(:,:,1:jpl) * a_i(:,:,1:jpl) 1417 CASE( 'no' ) 1418 ztmp3(:,:,:) = 0._wp ; ztmp4(:,:,:) = 0._wp 1419 DO jl=1,jpl 1420 ztmp3(:,:,1) = ztmp3(:,:,1) + ht_i(:,:,jl) * a_i(:,:,jl) 1421 ztmp4(:,:,1) = ztmp4(:,:,1) + ht_s(:,:,jl) * a_i(:,:,jl) 1422 ENDDO 1423 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 1421 IF( ssnd(jps_hice)%laction .OR. ssnd(jps_hsnw)%laction ) THEN 1422 SELECT CASE( sn_snd_thick%cldes) 1423 CASE( 'none' ) ! nothing to do 1424 CASE( 'weighted ice and snow' ) 1425 SELECT CASE( sn_snd_thick%clcat ) 1426 CASE( 'yes' ) 1427 ztmp3(:,:,1:jpl) = ht_i(:,:,1:jpl) * a_i(:,:,1:jpl) 1428 ztmp4(:,:,1:jpl) = ht_s(:,:,1:jpl) * a_i(:,:,1:jpl) 1429 CASE( 'no' ) 1430 ztmp3(:,:,:) = 0.0 ; ztmp4(:,:,:) = 0.0 1431 DO jl=1,jpl 1432 ztmp3(:,:,1) = ztmp3(:,:,1) + ht_i(:,:,jl) * a_i(:,:,jl) 1433 ztmp4(:,:,1) = ztmp4(:,:,1) + ht_s(:,:,jl) * a_i(:,:,jl) 1434 ENDDO 1435 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 1436 END SELECT 1437 CASE( 'ice and snow' ) 1438 ztmp3(:,:,1:jpl) = ht_i(:,:,1:jpl) 1439 ztmp4(:,:,1:jpl) = ht_s(:,:,1:jpl) 1440 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%cldes' ) 1424 1441 END SELECT 1425 CASE( 'ice and snow' ) 1426 ztmp3(:,:,1:jpl) = ht_i(:,:,1:jpl) 1427 ztmp4(:,:,1:jpl) = ht_s(:,:,1:jpl) 1428 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%cldes' ) 1429 END SELECT 1430 IF( ssnd(jps_hice)%laction ) CALL cpl_prism_snd( jps_hice, isec, ztmp3, info ) 1431 IF( ssnd(jps_hsnw)%laction ) CALL cpl_prism_snd( jps_hsnw, isec, ztmp4, info ) 1442 IF( ssnd(jps_hice)%laction ) CALL cpl_prism_snd( jps_hice, isec, ztmp3, info ) 1443 IF( ssnd(jps_hsnw)%laction ) CALL cpl_prism_snd( jps_hsnw, isec, ztmp4, info ) 1444 ENDIF 1432 1445 ! 1433 1446 #if defined key_cpl_carbon_cycle -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90
r3625 r3680 48 48 USE in_out_manager ! I/O manager 49 49 USE prtctl ! Print control 50 51 # if defined key_agrif 52 USE agrif_ice 53 USE agrif_lim2_update 54 # endif 50 55 51 56 IMPLICIT NONE … … 101 106 ! 102 107 CALL ice_init_2 108 ! 109 # if defined key_agrif 110 IF( .NOT. Agrif_Root() ) CALL Agrif_InitValues_cont_lim2 ! AGRIF: set the meshes 111 # endif 103 112 ENDIF 104 113 … … 106 115 IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN ! Ice time-step only ! 107 116 ! !----------------------! 117 # if defined key_agrif 118 IF( .NOT. Agrif_Root() ) lim_nbstep = MOD(lim_nbstep,Agrif_rhot()& 119 &*Agrif_PArent(nn_fsbc)/REAL(nn_fsbc)) + 1 120 # endif 108 121 ! Bulk Formulea ! 109 122 !----------------! … … 211 224 IF( lrst_ice ) CALL lim_rst_write_2( kt ) ! Ice restart file 212 225 ! 226 # if defined key_agrif && defined key_lim2 227 IF( .NOT. Agrif_Root() ) CALL agrif_update_lim2( kt ) 228 # endif 229 ! 213 230 ENDIF ! End sea-ice time step only 214 231 ! -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
r3632 r3680 47 47 48 48 USE prtctl ! Print control (prt_ctl routine) 49 USE restart ! ocean restart50 49 USE iom ! IOM library 51 50 USE in_out_manager ! I/O manager … … 87 86 NAMELIST/namsbc/ nn_fsbc , ln_ana , ln_flx, ln_blk_clio, ln_blk_core, ln_cpl, & 88 87 & ln_blk_mfs, ln_apr_dyn, nn_ice, nn_ice_embd, ln_dm2dc , ln_rnf, & 89 & ln_ssr , nn_fwb , ln_cdgw 88 & ln_ssr , nn_fwb , ln_cdgw , ln_wave , ln_sdw 90 89 !!---------------------------------------------------------------------- 91 90 … … 96 95 ENDIF 97 96 97 call flush(numout) 98 98 REWIND( numnam ) ! Read Namelist namsbc 99 99 READ ( numnam, namsbc ) 100 call flush(numout) 100 101 101 102 ! ! overwrite namelist parameter using CPP key information … … 176 177 & CALL ctl_warn( 'diurnal cycle for qsr: the sampling of the diurnal cycle is too small...' ) 177 178 178 !drag coefficient read from wave model definable only with mfs bulk formulae and core 179 IF(ln_cdgw .AND. .NOT.(ln_blk_mfs .OR. ln_blk_core) ) & 180 & CALL ctl_stop( 'drag coefficient read from wave model definable only with mfs bulk formulae and core') 179 IF ( ln_wave ) THEN 180 !Activated wave module but neither drag nor stokes drift activated 181 IF ( .NOT.(ln_cdgw .OR. ln_sdw) ) THEN 182 CALL ctl_warn( 'Ask for wave coupling but nor drag coefficient (ln_cdgw=F) neither stokes drift activated (ln_sdw=F)' ) 183 !drag coefficient read from wave model definable only with mfs bulk formulae and core 184 ELSEIF (ln_cdgw .AND. .NOT.(ln_blk_mfs .OR. ln_blk_core) ) THEN 185 CALL ctl_stop( 'drag coefficient read from wave model definable only with mfs bulk formulae and core') 186 ENDIF 187 ELSE 188 IF ( ln_cdgw .OR. ln_sdw ) & 189 & CALL ctl_stop('Not Activated Wave Module (ln_wave=F) but & 190 & asked coupling with drag coefficient (ln_cdgw =T) or Stokes drift (ln_sdw=T) ') 191 ENDIF 181 192 182 193 ! ! Choice of the Surface Boudary Condition (set nsbc) … … 266 277 ! ! averaged over nf_sbc time-step 267 278 268 IF (ln_ cdgw) CALL sbc_wave( kt )279 IF (ln_wave) CALL sbc_wave( kt ) 269 280 !== sbc formulation ==! 270 281 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
r3632 r3680 21 21 USE closea ! closed seas 22 22 USE fldread ! read input field at current time step 23 USE restart ! restart24 23 USE in_out_manager ! I/O manager 25 24 USE iom ! I/O module … … 57 56 58 57 59 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_rnf ! structure: river runoff (file information, fields read)60 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_s_rnf ! structure: river runoff salinity (file information, fields read)61 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_t_rnf ! structure: river runoff temperature (file information, fields read)58 TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf_rnf ! structure: river runoff (file information, fields read) 59 TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf_s_rnf ! structure: river runoff salinity (file information, fields read) 60 TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf_t_rnf ! structure: river runoff temperature (file information, fields read) 62 61 63 62 !! * Substitutions -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90
r3614 r3680 18 18 USE sbcapr ! surface boundary condition: atmospheric pressure 19 19 USE prtctl ! Print control (prt_ctl routine) 20 USE restart ! ocean restart21 20 USE iom 22 21 USE in_out_manager ! I/O manager -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90
r3294 r3680 4 4 !! Wave module 5 5 !!====================================================================== 6 !! History : 3.3.1 ! 2011-09 (Adani M) Original code 6 !! History : 3.3.1 ! 2011-09 (Adani M) Original code: Drag Coefficient 7 !! : 3.4 ! 2012-10 (Adani M) Stokes Drift 7 8 !!---------------------------------------------------------------------- 8 9 USE iom ! I/O manager library … … 10 11 USE lib_mpp ! distribued memory computing library 11 12 USE fldread ! read input fields 13 USE oce 12 14 USE sbc_oce ! Surface boundary condition: ocean fields 15 USE domvvl 13 16 14 17 … … 22 25 PUBLIC sbc_wave ! routine called in sbc_blk_core or sbc_blk_mfs 23 26 24 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_wave ! structure of input fields (file informations, fields read) 27 INTEGER , PARAMETER :: jpfld = 3 ! maximum number of files to read for srokes drift 28 INTEGER , PARAMETER :: jp_usd = 1 ! index of stokes drift (i-component) (m/s) at T-point 29 INTEGER , PARAMETER :: jp_vsd = 2 ! index of stokes drift (j-component) (m/s) at T-point 30 INTEGER , PARAMETER :: jp_wn = 3 ! index of wave number (1/m) at T-point 31 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_cd ! structure of input fields (file informations, fields read) Drag Coefficient 32 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_sd ! structure of input fields (file informations, fields read) Stokes Drift 25 33 REAL(wp),PUBLIC,ALLOCATABLE,DIMENSION (:,:) :: cdn_wave 34 REAL(wp),ALLOCATABLE,DIMENSION (:,:) :: usd2d,vsd2d,uwavenum,vwavenum 35 REAL(wp),PUBLIC,ALLOCATABLE,DIMENSION (:,:,:) :: usd3d,vsd3d,wsd3d 26 36 37 !! * Substitutions 38 # include "domzgr_substitute.h90" 27 39 !!---------------------------------------------------------------------- 28 40 !! NEMO/OPA 4.0 , NEMO Consortium (2011) … … 40 52 !! ** Method : - Read namelist namsbc_wave 41 53 !! - Read Cd_n10 fields in netcdf files 54 !! - Read stokes drift 2d in netcdf files 55 !! - Read wave number in netcdf files 56 !! - Compute 3d stokes drift using monochromatic 42 57 !! ** action : 43 58 !! 44 59 !!--------------------------------------------------------------------- 45 INTEGER, INTENT( in ) :: kt ! ocean time step 60 USE oce, ONLY : un,vn,hdivn,rotn 61 USE divcur 62 USE wrk_nemo 63 #if defined key_bdy 64 USE bdy_oce, ONLY : bdytmask 65 #endif 66 INTEGER, INTENT( in ) :: kt ! ocean time step 46 67 INTEGER :: ierror ! return error code 47 CHARACTER(len=100) :: cn_dir_cdg ! Root directory for location of drag coefficient files 48 TYPE(FLD_N) :: sn_cdg ! informations about the fields to be read 68 INTEGER :: ifpr, jj,ji,jk 69 REAL(wp),DIMENSION(:,:,:),POINTER :: udummy,vdummy,hdivdummy,rotdummy 70 REAL :: z2dt,z1_2dt 71 TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist informations on the fields to read 72 CHARACTER(len=100) :: cn_dir ! Root directory for location of drag coefficient files 73 TYPE(FLD_N) :: sn_cdg, sn_usd, sn_vsd, sn_wn ! informations about the fields to be read 49 74 !!--------------------------------------------------------------------- 50 NAMELIST/namsbc_wave/ sn_cdg, cn_dir _cdg75 NAMELIST/namsbc_wave/ sn_cdg, cn_dir, sn_usd, sn_vsd, sn_wn 51 76 !!--------------------------------------------------------------------- 52 77 … … 62 87 ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs ! 63 88 sn_cdg = FLD_N('cdg_wave' , 1 ,'drag_coeff', .true. , .false. , 'daily' , '' , '' ) 64 cn_dir_cdg = './' ! directory in which the Patm data are 89 sn_usd = FLD_N('sdw_wave' , 1 ,'u_sd2d', .true. , .false. , 'daily' , '' , '' ) 90 sn_vsd = FLD_N('sdw_wave' , 1 ,'v_sd2d', .true. , .false. , 'daily' , '' , '' ) 91 sn_wn = FLD_N( 'sdw_wave' , 1 ,'wave_num', .true. , .false. , 'daily' , '' , '' ) 92 cn_dir = './' ! directory in which the wave data are 65 93 66 94 … … 69 97 ! 70 98 71 ALLOCATE( sf_wave(1), STAT=ierror ) !* allocate and fill sf_wave with sn_cdg 72 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' ) 73 ! 74 CALL fld_fill( sf_wave, (/ sn_cdg /), cn_dir_cdg, 'sbc_wave', 'Wave module ', 'namsbc_wave' ) 75 ALLOCATE( sf_wave(1)%fnow(jpi,jpj,1) ) 76 IF( sn_cdg%ln_tint ) ALLOCATE( sf_wave(1)%fdta(jpi,jpj,1,2) ) 77 ALLOCATE( cdn_wave(jpi,jpj) ) 78 cdn_wave(:,:) = 0.0 99 IF ( ln_cdgw ) THEN 100 ALLOCATE( sf_cd(1), STAT=ierror ) !* allocate and fill sf_wave with sn_cdg 101 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' ) 102 ! 103 ALLOCATE( sf_cd(1)%fnow(jpi,jpj,1) ) 104 IF( sn_cdg%ln_tint ) ALLOCATE( sf_cd(1)%fdta(jpi,jpj,1,2) ) 105 CALL fld_fill( sf_cd, (/ sn_cdg /), cn_dir, 'sbc_wave', 'Wave module ', 'namsbc_wave' ) 106 ALLOCATE( cdn_wave(jpi,jpj) ) 107 cdn_wave(:,:) = 0.0 108 ENDIF 109 IF ( ln_sdw ) THEN 110 slf_i(jp_usd) = sn_usd ; slf_i(jp_vsd) = sn_vsd; slf_i(jp_wn) = sn_wn 111 ALLOCATE( sf_sd(3), STAT=ierror ) !* allocate and fill sf_wave with sn_cdg 112 IF( ierror > 0 ) CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' ) 113 ! 114 DO ifpr= 1, jpfld 115 ALLOCATE( sf_sd(ifpr)%fnow(jpi,jpj,1) ) 116 IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf_sd(ifpr)%fdta(jpi,jpj,1,2) ) 117 END DO 118 CALL fld_fill( sf_sd, slf_i, cn_dir, 'sbc_wave', 'Wave module ', 'namsbc_wave' ) 119 ALLOCATE( usd2d(jpi,jpj),vsd2d(jpi,jpj),uwavenum(jpi,jpj),vwavenum(jpi,jpj) ) 120 ALLOCATE( usd3d(jpi,jpj,jpk),vsd3d(jpi,jpj,jpk),wsd3d(jpi,jpj,jpk) ) 121 usd2d(:,:) = 0.0 ; vsd2d(:,:) = 0.0 ; uwavenum(:,:) = 0.0 ; vwavenum(:,:) = 0.0 122 usd3d(:,:,:) = 0.0 ;vsd3d(:,:,:) = 0.0 ; wsd3d(:,:,:) = 0.0 123 ENDIF 79 124 ENDIF 80 125 ! 81 126 ! 82 CALL fld_read( kt, nn_fsbc, sf_wave ) !* read drag coefficient from external forcing 83 cdn_wave(:,:) = sf_wave(1)%fnow(:,:,1) 127 IF ( ln_cdgw ) THEN 128 CALL fld_read( kt, nn_fsbc, sf_cd ) !* read drag coefficient from external forcing 129 cdn_wave(:,:) = sf_cd(1)%fnow(:,:,1) 130 ENDIF 131 IF ( ln_sdw ) THEN 132 CALL fld_read( kt, nn_fsbc, sf_sd ) !* read drag coefficient from external forcing 84 133 134 ! Interpolate wavenumber, stokes drift into the grid_V and grid_V 135 !------------------------------------------------- 136 137 DO jj = 1, jpjm1 138 DO ji = 1, jpim1 139 uwavenum(ji,jj)=0.5 * ( 2. - umask(ji,jj,1) ) * ( sf_sd(3)%fnow(ji,jj,1) * tmask(ji,jj,1) & 140 & + sf_sd(3)%fnow(ji+1,jj,1) * tmask(ji+1,jj,1) ) 141 142 vwavenum(ji,jj)=0.5 * ( 2. - vmask(ji,jj,1) ) * ( sf_sd(3)%fnow(ji,jj,1) * tmask(ji,jj,1) & 143 & + sf_sd(3)%fnow(ji,jj+1,1) * tmask(ji,jj+1,1) ) 144 145 usd2d(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( sf_sd(1)%fnow(ji,jj,1) * tmask(ji,jj,1) & 146 & + sf_sd(1)%fnow(ji+1,jj,1) * tmask(ji+1,jj,1) ) 147 148 vsd2d(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( sf_sd(2)%fnow(ji,jj,1) * tmask(ji,jj,1) & 149 & + sf_sd(2)%fnow(ji,jj+1,1) * tmask(ji,jj+1,1) ) 150 END DO 151 END DO 152 153 !Computation of the 3d Stokes Drift 154 DO jk = 1, jpk 155 DO jj = 1, jpj-1 156 DO ji = 1, jpi-1 157 usd3d(ji,jj,jk) = usd2d(ji,jj)*exp(2.0*uwavenum(ji,jj)*(-MIN( gdept(ji,jj,jk) , gdept(ji+1,jj ,jk)))) 158 vsd3d(ji,jj,jk) = vsd2d(ji,jj)*exp(2.0*vwavenum(ji,jj)*(-MIN( gdept(ji,jj,jk) , gdept(ji ,jj+1,jk)))) 159 END DO 160 END DO 161 usd3d(jpi,:,jk) = usd2d(jpi,:)*exp( 2.0*uwavenum(jpi,:)*(-gdept(jpi,:,jk)) ) 162 vsd3d(:,jpj,jk) = vsd2d(:,jpj)*exp( 2.0*vwavenum(:,jpj)*(-gdept(:,jpj,jk)) ) 163 END DO 164 165 CALL wrk_alloc( jpi,jpj,jpk,udummy,vdummy,hdivdummy,rotdummy) 166 167 udummy(:,:,:)=un(:,:,:) 168 vdummy(:,:,:)=vn(:,:,:) 169 hdivdummy(:,:,:)=hdivn(:,:,:) 170 rotdummy(:,:,:)=rotn(:,:,:) 171 un(:,:,:)=usd3d(:,:,:) 172 vn(:,:,:)=vsd3d(:,:,:) 173 CALL div_cur(kt) 174 ! !------------------------------! 175 ! ! Now Vertical Velocity ! 176 ! !------------------------------! 177 z2dt = 2._wp * rdt ! set time step size (Euler/Leapfrog) 178 179 z1_2dt = 1.e0 / z2dt 180 DO jk = jpkm1, 1, -1 ! integrate from the bottom the hor. divergence 181 ! - ML - need 3 lines here because replacement of fse3t by its expression yields too long lines otherwise 182 wsd3d(:,:,jk) = wsd3d(:,:,jk+1) - fse3t_n(:,:,jk) * hdivn(:,:,jk) & 183 & - ( fse3t_a(:,:,jk) - fse3t_b(:,:,jk) ) & 184 & * tmask(:,:,jk) * z1_2dt 185 #if defined key_bdy 186 wsd3d(:,:,jk) = wsd3d(:,:,jk) * bdytmask(:,:) 187 #endif 188 END DO 189 hdivn(:,:,:)=hdivdummy(:,:,:) 190 rotn(:,:,:)=rotdummy(:,:,:) 191 vn(:,:,:)=vdummy(:,:,:) 192 un(:,:,:)=udummy(:,:,:) 193 CALL wrk_dealloc( jpi,jpj,jpk,udummy,vdummy,hdivdummy,rotdummy) 194 ENDIF 85 195 END SUBROUTINE sbc_wave 86 196 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90
r3294 r3680 45 45 LOGICAL :: ln_traadv_qck = .FALSE. ! QUICKEST scheme flag 46 46 47 47 48 INTEGER :: nadv ! choice of the type of advection scheme 48 49 … … 152 153 NAMELIST/namtra_adv/ ln_traadv_cen2 , ln_traadv_tvd, & 153 154 & ln_traadv_muscl, ln_traadv_muscl2, & 154 & ln_traadv_ubs , ln_traadv_qck 155 & ln_traadv_ubs , ln_traadv_qck, & 156 & ln_traadv_msc_ups 155 157 !!---------------------------------------------------------------------- 156 158 … … 169 171 WRITE(numout,*) ' UBS advection scheme ln_traadv_ubs = ', ln_traadv_ubs 170 172 WRITE(numout,*) ' QUICKEST advection scheme ln_traadv_qck = ', ln_traadv_qck 173 WRITE(numout,*) ' upstream scheme within muscl ln_traadv_msc_ups= ', ln_traadv_msc_ups 171 174 ENDIF 172 175 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90
r3294 r3680 29 29 USE diaptr ! poleward transport diagnostics 30 30 USE zdf_oce ! ocean vertical physics 31 USE restart ! ocean restart32 31 USE trc_oce ! share passive tracers/Ocean variables 33 32 USE lib_mpp ! MPP library -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90
r3625 r3680 8 8 !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module 9 9 !! 3.2 ! 2010-05 (C. Ethe, G. Madec) merge TRC-TRA + switch from velocity to transport 10 !! 3.4 ! 2012-06 (P. Oddo, M. Vichi) include the upstream where needed 10 11 !!---------------------------------------------------------------------- 11 12 … … 28 29 USE timing ! Timing 29 30 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 31 USE eosbn2 ! equation of state 32 USE sbcrnf ! river runoffs 30 33 31 34 IMPLICIT NONE … … 34 37 PUBLIC tra_adv_muscl ! routine called by step.F90 35 38 36 LOGICAL :: l_trd ! flag to compute trends 37 39 LOGICAL :: l_trd ! flag to compute trends 40 LOGICAL, PUBLIC :: ln_traadv_msc_ups= .FALSE. ! use upstream scheme within muscl 41 42 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: upsmsk !: mixed upstream/centered scheme near some straits 43 ! ! and in closed seas (orca 2 and 4 configurations) 44 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: zind !: mixed upstream/centered index 38 45 !! * Substitutions 39 46 # include "domzgr_substitute.h90" … … 79 86 REAL(wp) :: ztra, zbtr, zdt, zalpha ! - - 80 87 REAL(wp), POINTER, DIMENSION(:,:,:) :: zslpx, zslpy 88 INTEGER :: ierr 81 89 !!---------------------------------------------------------------------- 82 90 ! … … 89 97 IF(lwp) WRITE(numout,*) 90 98 IF(lwp) WRITE(numout,*) 'tra_adv : MUSCL advection scheme on ', cdtype 99 IF(lwp) WRITE(numout,*) ' : xed up-stream ' , ln_traadv_msc_ups 91 100 IF(lwp) WRITE(numout,*) '~~~~~~~' 101 IF(lwp) WRITE(numout,*) 102 ! 103 ! 104 IF(ln_traadv_msc_ups) THEN 105 IF (.not. ALLOCATED(upsmsk))THEN 106 ALLOCATE( upsmsk(jpi,jpj), STAT=ierr ) 107 IF( ierr /= 0 ) CALL ctl_stop('STOP', 'tra_adv_muscl: unable to allocate upsmsk array') 108 ENDIF 109 upsmsk(:,:) = 0._wp ! not upstream by default 110 ENDIF 111 112 IF (.not. ALLOCATED(zind))THEN 113 ALLOCATE( zind(jpi,jpj,jpk), STAT=ierr ) 114 IF( ierr /= 0 ) CALL ctl_stop('STOP', 'tra_adv_muscl: unable to allocate zind array') 115 ENDIF 116 ! 92 117 ! 93 118 l_trd = .FALSE. 94 119 IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) ) l_trd = .TRUE. 95 ENDIF 96 120 121 ! 122 ! Upstream / centered scheme indicator 123 ! ------------------------------------ 124 zind(:,:,:) = 1._wp ! set equal to 0 where up-stream is needed 125 126 IF(ln_traadv_msc_ups) THEN 127 DO jk = 1, jpk 128 DO jj = 1, jpj 129 DO ji = 1, jpi 130 zind(ji,jj,jk) = 1 - MAX ( & 131 rnfmsk(ji,jj) * rnfmsk_z(jk), & ! near runoff mouths (& closed sea outflows) 132 upsmsk(ji,jj) ) * tmask(ji,jj,jk) ! some of some straits 133 END DO 134 END DO 135 END DO 136 ENDIF 137 ! 138 ENDIF ! end kit000 97 139 ! ! =========== 98 140 DO jn = 1, kjpt ! tracer loop … … 149 191 zalpha = 0.5 - z0u 150 192 zu = z0u - 0.5 * pun(ji,jj,jk) * zdt / ( e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk) ) 151 zzwx = ptb(ji+1,jj,jk,jn) + z u * zslpx(ji+1,jj,jk)152 zzwy = ptb(ji ,jj,jk,jn) + z u * zslpx(ji ,jj,jk)193 zzwx = ptb(ji+1,jj,jk,jn) + zind(ji,jj,jk) * (zu * zslpx(ji+1,jj,jk)) 194 zzwy = ptb(ji ,jj,jk,jn) + zind(ji,jj,jk) * (zu * zslpx(ji ,jj,jk)) 153 195 zwx(ji,jj,jk) = pun(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy ) 154 196 ! … … 156 198 zalpha = 0.5 - z0v 157 199 zv = z0v - 0.5 * pvn(ji,jj,jk) * zdt / ( e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk) ) 158 zzwx = ptb(ji,jj+1,jk,jn) + z v * zslpy(ji,jj+1,jk)159 zzwy = ptb(ji,jj ,jk,jn) + z v * zslpy(ji,jj ,jk)200 zzwx = ptb(ji,jj+1,jk,jn) + zind(ji,jj,jk) * (zv * zslpy(ji,jj+1,jk)) 201 zzwy = ptb(ji,jj ,jk,jn) + zind(ji,jj,jk) * (zv * zslpy(ji,jj ,jk)) 160 202 zwy(ji,jj,jk) = pvn(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy ) 161 203 END DO … … 231 273 zalpha = 0.5 + z0w 232 274 zw = z0w - 0.5 * pwn(ji,jj,jk+1) * zdt * zbtr 233 zzwx = ptb(ji,jj,jk+1,jn) + z w * zslpx(ji,jj,jk+1)234 zzwy = ptb(ji,jj,jk ,jn) + z w * zslpx(ji,jj,jk)275 zzwx = ptb(ji,jj,jk+1,jn) + zind(ji,jj,jk) * (zw * zslpx(ji,jj,jk+1)) 276 zzwy = ptb(ji,jj,jk ,jn) + zind(ji,jj,jk) * (zw * zslpx(ji,jj,jk )) 235 277 zwx(ji,jj,jk+1) = pwn(ji,jj,jk+1) * ( zalpha * zzwx + (1.-zalpha) * zzwy ) 236 278 END DO -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
r3625 r3680 27 27 USE iom ! I/O manager 28 28 USE fldread ! read input fields 29 USE restart ! ocean restart30 29 USE lib_mpp ! MPP library 31 30 USE wrk_nemo ! Memory Allocation -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90
r3625 r3680 23 23 USE in_out_manager ! I/O manager 24 24 USE prtctl ! Print control 25 USE restart ! ocean restart26 25 USE sbcrnf ! River runoff 27 26 USE sbcmod ! ln_rnf -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld.F90
r3294 r3680 36 36 USE trdmld_rst ! restart for diagnosing the ML trends 37 37 USE prtctl ! Print control 38 USE restart ! for lrst_oce39 38 USE lib_mpp ! MPP library 40 39 USE wrk_nemo ! Memory allocation -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld_rst.F90
r2528 r3680 12 12 USE in_out_manager ! I/O manager 13 13 USE iom ! I/O module 14 USE restart ! only for lrst_oce15 14 16 15 IMPLICIT NONE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
r3625 r3680 23 23 USE phycst ! physical constants 24 24 USE zdfmxl ! mixed layer 25 USE restart ! only for lrst_oce26 25 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 27 26 USE lib_mpp ! MPP manager -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90
r2715 r3680 26 26 USE tranpc ! convection: non penetrative adjustment 27 27 USE ldfslp ! iso-neutral slopes 28 USE restart ! ocean restart29 28 30 29 USE in_out_manager ! I/O manager -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
r3632 r3680 44 44 USE zdf_oce ! vertical physics: ocean variables 45 45 USE zdfmxl ! vertical physics: mixed layer 46 USE restart ! ocean restart47 46 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 48 47 USE prtctl ! Print control -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/lib_cray.f90
r2528 r3680 10 10 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 11 11 !!---------------------------------------------------------------------- 12 SUBROUTINE lib_cray 13 WRITE(*,*) 'lib_cray: You should not have seen this print! error?' 14 END SUBROUTINE lib_cray 15 12 16 SUBROUTINE wheneq ( i, x, j, t, ind, nn ) 13 17 IMPLICIT NONE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r3651 r3680 124 124 ! !-----------------------! 125 125 #if defined key_agrif 126 CALL Agrif_Declare_Var ! AGRIF: set the meshes 126 CALL Agrif_Declare_Var_dom ! AGRIF: set the meshes for DOM 127 CALL Agrif_Declare_Var ! " " " " " DYN/TRA 127 128 # if defined key_top 128 CALL Agrif_Declare_Var_Top ! AGRIF: set the meshes 129 CALL Agrif_Declare_Var_top ! " " " " " TOP 130 # endif 131 # if defined key_lim2 132 CALL Agrif_Declare_Var_lim2 ! " " " " " LIM 129 133 # endif 130 134 #endif … … 525 529 USE ldftra_oce, ONLY: ldftra_oce_alloc 526 530 USE trc_oce , ONLY: trc_oce_alloc 531 #if defined key_diadct 532 USE diadct , ONLY: diadct_alloc 533 #endif 527 534 ! 528 535 INTEGER :: ierr … … 538 545 ierr = ierr + lib_mpp_alloc (numout) ! mpp exchanges 539 546 ierr = ierr + trc_oce_alloc () ! shared TRC / TRA arrays 547 ! 548 #if defined key_diadct 549 ierr = ierr + diadct_alloc () ! 550 #endif 540 551 ! 541 552 IF( lk_mpp ) CALL mpp_sum( ierr ) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/par_AMM_12km.h90
r3294 r3680 19 19 jpidta = 198, & !: first horizontal dimension > or = to jpi 20 20 jpjdta = 224, & !: second > or = to jpj 21 jpkdta = 33, & !: number of levels > or = to jpk21 jpkdta = 51, & !: number of levels > or = to jpk 22 22 ! total domain matrix size 23 23 jpiglo = jpidta, & !: first dimension of global domain --> i -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/step.F90
r3651 r3680 36 36 USE agrif_opa_sponge ! Momemtum and tracers sponges 37 37 #endif 38 USE restart ! restart 38 39 39 40 IMPLICIT NONE -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/step_oce.F90
r3651 r3680 100 100 101 101 USE stpctl ! time stepping control (stp_ctl routine) 102 USE restart ! ocean restart (rst_wri routine)103 102 USE prtctl ! Print control (prt_ctl routine) 104 103 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/C14b/par_c14b.F90
r2715 r3680 6 6 !! History : 2.0 ! 2008-12 (C. Ethe, G. Madec) revised architecture 7 7 !!---------------------------------------------------------------------- 8 USE par_lobster, ONLY : jp_lobster !: number of tracers in LOBSTER9 USE par_lobster, ONLY : jp_lobster_2d !: number of 2D diag in LOBSTER10 USE par_lobster, ONLY : jp_lobster_3d !: number of 3D diag in LOBSTER11 USE par_lobster, ONLY : jp_lobster_trd !: number of biological diag in LOBSTER12 13 8 USE par_pisces , ONLY : jp_pisces !: number of tracers in PISCES 14 9 USE par_pisces , ONLY : jp_pisces_2d !: number of 2D diag in PISCES … … 24 19 IMPLICIT NONE 25 20 26 INTEGER, PARAMETER :: jp_lb = jp_lobster +jp_pisces + jp_cfc !: cum. number of pass. tracers27 INTEGER, PARAMETER :: jp_lb_2d = jp_lobster_2d +jp_pisces_2d + jp_cfc_2d !:28 INTEGER, PARAMETER :: jp_lb_3d = jp_lobster_3d +jp_pisces_3d + jp_cfc_3d !:29 INTEGER, PARAMETER :: jp_lb_trd = jp_lobster_trd +jp_pisces_trd + jp_cfc_trd !:21 INTEGER, PARAMETER :: jp_lb = jp_pisces + jp_cfc !: cum. number of pass. tracers 22 INTEGER, PARAMETER :: jp_lb_2d = jp_pisces_2d + jp_cfc_2d !: 23 INTEGER, PARAMETER :: jp_lb_3d = jp_pisces_3d + jp_cfc_3d !: 24 INTEGER, PARAMETER :: jp_lb_trd = jp_pisces_trd + jp_cfc_trd !: 30 25 31 26 #if defined key_c14b -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90
r3294 r3680 125 125 xdecay = EXP( - xlambda * rdt ) 126 126 xaccum = 1._wp - xdecay 127 ! 128 IF( ln_rsttr ) THEN 129 IF(lwp) WRITE(numout,*) 130 IF(lwp) WRITE(numout,*) ' Read specific variables from C14b model ' 131 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 132 CALL iom_get( numrtr, jpdom_autoglo, 'qint_c14', qint_c14 ) 133 ENDIF 134 ! 135 IF(lwp) WRITE(numout,*) 136 ! 127 137 ENDIF 128 138 … … 271 281 END DO 272 282 283 ! 284 IF( lrst_trc ) THEN 285 IF(lwp) WRITE(numout,*) 286 IF(lwp) WRITE(numout,*) 'trc_sms_c14b : cumulated input function fields written in ocean restart file ', & 287 & 'at it= ', kt,' date= ', ndastp 288 IF(lwp) WRITE(numout,*) '~~~~' 289 CALL iom_rstput( kt, nitrst, numrtw, 'qint_c14', qint_c14 ) 290 ENDIF 291 ! 273 292 IF( ln_diatrc ) THEN 274 293 IF( lk_iomput ) THEN -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/CFC/par_cfc.F90
r3294 r3680 10 10 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 11 11 !!---------------------------------------------------------------------- 12 USE par_lobster, ONLY : jp_lobster !: number of tracers in LOBSTER13 USE par_lobster, ONLY : jp_lobster_2d !: number of 2D diag in LOBSTER14 USE par_lobster, ONLY : jp_lobster_3d !: number of 3D diag in LOBSTER15 USE par_lobster, ONLY : jp_lobster_trd !: number of biological diag in LOBSTER16 17 12 USE par_pisces , ONLY : jp_pisces !: number of tracers in PISCES 18 13 USE par_pisces , ONLY : jp_pisces_2d !: number of 2D diag in PISCES … … 22 17 IMPLICIT NONE 23 18 24 INTEGER, PARAMETER :: jp_lc = jp_lobster +jp_pisces !: cumulative number of passive tracers25 INTEGER, PARAMETER :: jp_lc_2d = jp_lobster_2d +jp_pisces_2d !:26 INTEGER, PARAMETER :: jp_lc_3d = jp_lobster_3d +jp_pisces_3d !:27 INTEGER, PARAMETER :: jp_lc_trd = jp_lobster_trd +jp_pisces_trd !:19 INTEGER, PARAMETER :: jp_lc = jp_pisces !: cumulative number of passive tracers 20 INTEGER, PARAMETER :: jp_lc_2d = jp_pisces_2d !: 21 INTEGER, PARAMETER :: jp_lc_3d = jp_pisces_3d !: 22 INTEGER, PARAMETER :: jp_lc_trd = jp_pisces_trd !: 28 23 29 24 #if defined key_cfc -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
r3294 r3680 13 13 !!---------------------------------------------------------------------- 14 14 !! trc_sms_cfc : compute and add CFC suface forcing to CFC trends 15 !! trc_cfc_cst: sets constants for CFC surface forcing computation15 !! cfc_init : sets constants for CFC surface forcing computation 16 16 !!---------------------------------------------------------------------- 17 17 USE oce_trc ! Ocean variables … … 99 99 ENDIF 100 100 101 IF( kt == nittrc000 ) CALL trc_cfc_cst101 IF( kt == nittrc000 ) CALL cfc_init 102 102 103 103 ! Temporal interpolation … … 176 176 ! !----------------! 177 177 END DO ! end CFC loop ! 178 ! !----------------! 178 ! 179 IF( lrst_trc ) THEN 180 IF(lwp) WRITE(numout,*) 181 IF(lwp) WRITE(numout,*) 'trc_sms_cfc : cumulated input function fields written in ocean restart file ', & 182 & 'at it= ', kt,' date= ', ndastp 183 IF(lwp) WRITE(numout,*) '~~~~' 184 DO jn = jp_cfc0, jp_cfc1 185 CALL iom_rstput( kt, nitrst, numrtw, 'qint_'//ctrcnm(jn), qint_cfc(:,:,jn) ) 186 END DO 187 ENDIF 188 ! 179 189 IF( ln_diatrc ) THEN 180 190 ! … … 200 210 201 211 202 SUBROUTINE trc_cfc_cst212 SUBROUTINE cfc_init 203 213 !!--------------------------------------------------------------------- 204 !! *** trc_cfc_cst ***214 !! *** cfc_init *** 205 215 !! 206 216 !! ** Purpose : sets constants for CFC model 207 217 !!--------------------------------------------------------------------- 218 INTEGER :: jn 208 219 209 220 ! coefficient for CFC11 … … 245 256 sca(4,2) = -0.067430 246 257 247 END SUBROUTINE trc_cfc_cst 258 IF( ln_rsttr ) THEN 259 IF(lwp) WRITE(numout,*) 260 IF(lwp) WRITE(numout,*) ' Read specific variables from CFC model ' 261 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 262 ! 263 DO jn = jp_cfc0, jp_cfc1 264 CALL iom_get( numrtr, jpdom_autoglo, 'qint_'//ctrcnm(jn), qint_cfc(:,:,jn) ) 265 END DO 266 ENDIF 267 IF(lwp) WRITE(numout,*) 268 ! 269 END SUBROUTINE cfc_init 248 270 249 271 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/MY_TRC/par_my_trc.F90
r2528 r3680 10 10 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 11 11 !!---------------------------------------------------------------------- 12 USE par_lobster, ONLY : jp_lobster !: number of tracers in LOBSTER13 USE par_lobster, ONLY : jp_lobster_2d !: number of 2D diag in LOBSTER14 USE par_lobster, ONLY : jp_lobster_3d !: number of 3D diag in LOBSTER15 USE par_lobster, ONLY : jp_lobster_trd !: number of biological diag in LOBSTER16 17 12 USE par_pisces , ONLY : jp_pisces !: number of tracers in PISCES 18 13 USE par_pisces , ONLY : jp_pisces_2d !: number of 2D diag in PISCES … … 32 27 IMPLICIT NONE 33 28 34 INTEGER, PARAMETER :: jp_lm = jp_lobster +jp_pisces + jp_cfc + jp_c14b !:35 INTEGER, PARAMETER :: jp_lm_2d = jp_lobster_2d +jp_pisces_2d + jp_cfc_2d + jp_c14b_2d !:36 INTEGER, PARAMETER :: jp_lm_3d = jp_lobster_3d +jp_pisces_3d + jp_cfc_3d + jp_c14b_3d !:37 INTEGER, PARAMETER :: jp_lm_trd = jp_lobster_trd +jp_pisces_trd + jp_cfc_trd + jp_c14b_trd !:29 INTEGER, PARAMETER :: jp_lm = jp_pisces + jp_cfc + jp_c14b !: 30 INTEGER, PARAMETER :: jp_lm_2d = jp_pisces_2d + jp_cfc_2d + jp_c14b_2d !: 31 INTEGER, PARAMETER :: jp_lm_3d = jp_pisces_3d + jp_cfc_3d + jp_c14b_3d !: 32 INTEGER, PARAMETER :: jp_lm_trd = jp_pisces_trd + jp_cfc_trd + jp_c14b_trd !: 38 33 39 34 #if defined key_my_trc … … 42 37 !!--------------------------------------------------------------------- 43 38 LOGICAL, PUBLIC, PARAMETER :: lk_my_trc = .TRUE. !: PTS flag 44 INTEGER, PUBLIC, PARAMETER :: jp_my_trc = 2!: number of PTS tracers39 INTEGER, PUBLIC, PARAMETER :: jp_my_trc = 1 !: number of PTS tracers 45 40 INTEGER, PUBLIC, PARAMETER :: jp_my_trc_2d = 0 !: additional 2d output arrays ('key_trc_diaadd') 46 41 INTEGER, PUBLIC, PARAMETER :: jp_my_trc_3d = 0 !: additional 3d output arrays ('key_trc_diaadd') … … 49 44 ! assign an index in trc arrays for each PTS prognostic variables 50 45 INTEGER, PUBLIC, PARAMETER :: jpmyt1 = jp_lm + 1 !: 1st MY_TRC tracer 51 INTEGER, PUBLIC, PARAMETER :: jpmyt2 = jp_lm + 2 !: 2nd MY_TRC tracer52 46 53 47 #else -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcnam_my_trc.F90
r2528 r3680 2 2 !!====================================================================== 3 3 !! *** MODULE trcnam_my_trc *** 4 !! TOP : initialisation of some run parameters for LOBSTERbio-model4 !! TOP : initialisation of some run parameters for MY_TRC bio-model 5 5 !!====================================================================== 6 6 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) Original code -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90
r3294 r3680 62 62 END WHERE 63 63 64 WHERE( ((glamt <= -165) .OR. (glamt >= 160)) .AND. (gphit <= -76) .AND. (gphit >=-80))65 trn(:,:,1,jpmyt2) = 1._wp66 trb(:,:,1,jpmyt2) = 1._wp67 tra(:,:,1,jpmyt2) = 0._wp68 END WHERE69 70 64 IF( l_trdtrc ) THEN ! Save the trends in the ixed layer 71 65 DO jn = jp_myt0, jp_myt1 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90
r3531 r3680 105 105 DO ji = 1, jpi 106 106 zdep = rfact2 / fse3t(ji,jj,1) 107 zwflux = ( emps(ji,jj) - emp(ji,jj) ) & 108 & * tsn(ji,jj,1,jp_sal) / ( tsn(ji,jj,1,jp_sal) - 6.0 ) / 1000. 107 ! zwflux = ( emps(ji,jj) - emp(ji,jj) ) & 108 ! & * tsn(ji,jj,1,jp_sal) / ( tsn(ji,jj,1,jp_sal) - 6.0 ) / 1000. 109 zwflux = 0. 109 110 zfminus = MIN( 0., -zwflux ) * trn(ji,jj,1,jpfer) * zdep 110 111 zfplus = MAX( 0., -zwflux ) * 10E-9 * zdep -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/PISCES/par_pisces.F90
r3295 r3680 10 10 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 11 11 !!---------------------------------------------------------------------- 12 USE par_lobster, ONLY : jp_lobster !: number of tracers in LOBSTER13 USE par_lobster, ONLY : jp_lobster_2d !: number of 2D diag in LOBSTER14 USE par_lobster, ONLY : jp_lobster_3d !: number of 3D diag in LOBSTER15 USE par_lobster, ONLY : jp_lobster_trd !: number of biological diag in LOBSTER16 12 17 13 IMPLICIT NONE 18 14 19 INTEGER, PUBLIC, PARAMETER :: jp_lp = jp_lobster !: cumulative number of already defined TRC 20 INTEGER, PUBLIC, PARAMETER :: jp_lp_2d = jp_lobster_2d !: 21 INTEGER, PUBLIC, PARAMETER :: jp_lp_3d = jp_lobster_3d !: 22 INTEGER, PUBLIC, PARAMETER :: jp_lp_trd = jp_lobster_trd !: 15 #if defined key_pisces_reduced 16 !!--------------------------------------------------------------------- 17 !! 'key_pisces_reduced' : LOBSTER bio-model 18 !!--------------------------------------------------------------------- 19 LOGICAL, PUBLIC, PARAMETER :: lk_pisces = .TRUE. !: PISCES flag 20 LOGICAL, PUBLIC, PARAMETER :: lk_p4z = .FALSE. !: p4z flag 21 INTEGER, PUBLIC, PARAMETER :: jp_pisces = 6 !: number of passive tracers 22 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 19 !: additional 2d output 23 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 3 !: additional 3d output 24 INTEGER, PUBLIC, PARAMETER :: jp_pisces_trd = 17 !: number of sms trends for PISCES 23 25 24 #if defined key_pisces && defined key_kriest 26 ! assign an index in trc arrays for each LOBSTER prognostic variables 27 INTEGER, PUBLIC, PARAMETER :: jpdet = 1 !: detritus [mmoleN/m3] 28 INTEGER, PUBLIC, PARAMETER :: jpzoo = 2 !: zooplancton concentration [mmoleN/m3] 29 INTEGER, PUBLIC, PARAMETER :: jpphy = 3 !: phytoplancton concentration [mmoleN/m3] 30 INTEGER, PUBLIC, PARAMETER :: jpno3 = 4 !: nitrate concentration [mmoleN/m3] 31 INTEGER, PUBLIC, PARAMETER :: jpnh4 = 5 !: ammonium concentration [mmoleN/m3] 32 INTEGER, PUBLIC, PARAMETER :: jpdom = 6 !: dissolved organic matter [mmoleN/m3] 33 34 ! productive layer depth 35 INTEGER, PUBLIC, PARAMETER :: jpkb = 12 !: first vertical layers where biology is active 36 INTEGER, PUBLIC, PARAMETER :: jpkbm1 = jpkb - 1 !: first vertical layers where biology is active 37 38 #elif defined key_pisces && defined key_kriest 25 39 !!--------------------------------------------------------------------- 26 40 !! 'key_pisces' & 'key_kriest' PISCES bio-model + ??? 27 41 !!--------------------------------------------------------------------- 28 42 LOGICAL, PUBLIC, PARAMETER :: lk_pisces = .TRUE. !: PISCES flag 43 LOGICAL, PUBLIC, PARAMETER :: lk_p4z = .TRUE. !: p4z flag 29 44 LOGICAL, PUBLIC, PARAMETER :: lk_kriest = .TRUE. !: Kriest flag 30 45 INTEGER, PUBLIC, PARAMETER :: jp_pisces = 23 !: number of passive tracers … … 36 51 ! WARNING: be carefull about the order when reading the restart 37 52 ! !!gm this warning should be obsolet with IOM 38 INTEGER, PUBLIC, PARAMETER :: jpdic = jp_lp +1 !: dissolved inoganic carbon concentration39 INTEGER, PUBLIC, PARAMETER :: jptal = jp_lp +2 !: total alkalinity40 INTEGER, PUBLIC, PARAMETER :: jpoxy = jp_lp +3 !: oxygen carbon concentration41 INTEGER, PUBLIC, PARAMETER :: jpcal = jp_lp +4 !: calcite concentration42 INTEGER, PUBLIC, PARAMETER :: jppo4 = jp_lp +5 !: phosphate concentration43 INTEGER, PUBLIC, PARAMETER :: jppoc = jp_lp +6 !: small particulate organic phosphate concentration44 INTEGER, PUBLIC, PARAMETER :: jpsil = jp_lp +7 !: silicate concentration45 INTEGER, PUBLIC, PARAMETER :: jpphy = jp_lp +8 !: phytoplancton concentration46 INTEGER, PUBLIC, PARAMETER :: jpzoo = jp_lp +9 !: zooplancton concentration47 INTEGER, PUBLIC, PARAMETER :: jpdoc = jp_lp +10 !: dissolved organic carbon concentration48 INTEGER, PUBLIC, PARAMETER :: jpdia = jp_lp +11 !: Diatoms Concentration49 INTEGER, PUBLIC, PARAMETER :: jpmes = jp_lp +12 !: Mesozooplankton Concentration50 INTEGER, PUBLIC, PARAMETER :: jpdsi = jp_lp +13 !: (big) Silicate Concentration51 INTEGER, PUBLIC, PARAMETER :: jpfer = jp_lp +14 !: Iron Concentration52 INTEGER, PUBLIC, PARAMETER :: jpnum = jp_lp +15 !: Big iron particles Concentration53 INTEGER, PUBLIC, PARAMETER :: jpsfe = jp_lp +16 !: number of particulate organic phosphate concentration54 INTEGER, PUBLIC, PARAMETER :: jpdfe = jp_lp +17 !: Diatoms iron Concentration55 INTEGER, PUBLIC, PARAMETER :: jpgsi = jp_lp +18 !: Diatoms Silicate Concentration56 INTEGER, PUBLIC, PARAMETER :: jpnfe = jp_lp +19 !: Nano iron Concentration57 INTEGER, PUBLIC, PARAMETER :: jpnch = jp_lp +20 !: Nano Chlorophyll Concentration58 INTEGER, PUBLIC, PARAMETER :: jpdch = jp_lp +21 !: Diatoms Chlorophyll Concentration59 INTEGER, PUBLIC, PARAMETER :: jpno3 = jp_lp +22 !: Nitrates Concentration60 INTEGER, PUBLIC, PARAMETER :: jpnh4 = jp_lp +23 !: Ammonium Concentration53 INTEGER, PUBLIC, PARAMETER :: jpdic = 1 !: dissolved inoganic carbon concentration 54 INTEGER, PUBLIC, PARAMETER :: jptal = 2 !: total alkalinity 55 INTEGER, PUBLIC, PARAMETER :: jpoxy = 3 !: oxygen carbon concentration 56 INTEGER, PUBLIC, PARAMETER :: jpcal = 4 !: calcite concentration 57 INTEGER, PUBLIC, PARAMETER :: jppo4 = 5 !: phosphate concentration 58 INTEGER, PUBLIC, PARAMETER :: jppoc = 6 !: small particulate organic phosphate concentration 59 INTEGER, PUBLIC, PARAMETER :: jpsil = 7 !: silicate concentration 60 INTEGER, PUBLIC, PARAMETER :: jpphy = 8 !: phytoplancton concentration 61 INTEGER, PUBLIC, PARAMETER :: jpzoo = 9 !: zooplancton concentration 62 INTEGER, PUBLIC, PARAMETER :: jpdoc = 10 !: dissolved organic carbon concentration 63 INTEGER, PUBLIC, PARAMETER :: jpdia = 11 !: Diatoms Concentration 64 INTEGER, PUBLIC, PARAMETER :: jpmes = 12 !: Mesozooplankton Concentration 65 INTEGER, PUBLIC, PARAMETER :: jpdsi = 13 !: (big) Silicate Concentration 66 INTEGER, PUBLIC, PARAMETER :: jpfer = 14 !: Iron Concentration 67 INTEGER, PUBLIC, PARAMETER :: jpnum = 15 !: Big iron particles Concentration 68 INTEGER, PUBLIC, PARAMETER :: jpsfe = 16 !: number of particulate organic phosphate concentration 69 INTEGER, PUBLIC, PARAMETER :: jpdfe = 17 !: Diatoms iron Concentration 70 INTEGER, PUBLIC, PARAMETER :: jpgsi = 18 !: Diatoms Silicate Concentration 71 INTEGER, PUBLIC, PARAMETER :: jpnfe = 19 !: Nano iron Concentration 72 INTEGER, PUBLIC, PARAMETER :: jpnch = 20 !: Nano Chlorophyll Concentration 73 INTEGER, PUBLIC, PARAMETER :: jpdch = 21 !: Diatoms Chlorophyll Concentration 74 INTEGER, PUBLIC, PARAMETER :: jpno3 = 22 !: Nitrates Concentration 75 INTEGER, PUBLIC, PARAMETER :: jpnh4 = 23 !: Ammonium Concentration 61 76 62 77 #elif defined key_pisces … … 65 80 !!--------------------------------------------------------------------- 66 81 LOGICAL, PUBLIC, PARAMETER :: lk_pisces = .TRUE. !: PISCES flag 82 LOGICAL, PUBLIC, PARAMETER :: lk_p4z = .TRUE. !: p4z flag 67 83 LOGICAL, PUBLIC, PARAMETER :: lk_kriest = .FALSE. !: Kriest flag 68 84 INTEGER, PUBLIC, PARAMETER :: jp_pisces = 24 !: number of PISCES passive tracers … … 74 90 ! WARNING: be carefull about the order when reading the restart 75 91 ! !!gm this warning should be obsolet with IOM 76 INTEGER, PUBLIC, PARAMETER :: jpdic = jp_lp +1 !: dissolved inoganic carbon concentration77 INTEGER, PUBLIC, PARAMETER :: jptal = jp_lp +2 !: total alkalinity78 INTEGER, PUBLIC, PARAMETER :: jpoxy = jp_lp +3 !: oxygen carbon concentration79 INTEGER, PUBLIC, PARAMETER :: jpcal = jp_lp +4 !: calcite concentration80 INTEGER, PUBLIC, PARAMETER :: jppo4 = jp_lp +5 !: phosphate concentration81 INTEGER, PUBLIC, PARAMETER :: jppoc = jp_lp +6 !: small particulate organic phosphate concentration82 INTEGER, PUBLIC, PARAMETER :: jpsil = jp_lp +7 !: silicate concentration83 INTEGER, PUBLIC, PARAMETER :: jpphy = jp_lp +8 !: phytoplancton concentration84 INTEGER, PUBLIC, PARAMETER :: jpzoo = jp_lp +9 !: zooplancton concentration85 INTEGER, PUBLIC, PARAMETER :: jpdoc = jp_lp +10 !: dissolved organic carbon concentration86 INTEGER, PUBLIC, PARAMETER :: jpdia = jp_lp +11 !: Diatoms Concentration87 INTEGER, PUBLIC, PARAMETER :: jpmes = jp_lp +12 !: Mesozooplankton Concentration88 INTEGER, PUBLIC, PARAMETER :: jpdsi = jp_lp +13 !: (big) Silicate Concentration89 INTEGER, PUBLIC, PARAMETER :: jpfer = jp_lp +14 !: Iron Concentration90 INTEGER, PUBLIC, PARAMETER :: jpbfe = jp_lp +15 !: Big iron particles Concentration91 INTEGER, PUBLIC, PARAMETER :: jpgoc = jp_lp +16 !: big particulate organic phosphate concentration92 INTEGER, PUBLIC, PARAMETER :: jpsfe = jp_lp +17 !: Small iron particles Concentration93 INTEGER, PUBLIC, PARAMETER :: jpdfe = jp_lp +18 !: Diatoms iron Concentration94 INTEGER, PUBLIC, PARAMETER :: jpgsi = jp_lp +19 !: Diatoms Silicate Concentration95 INTEGER, PUBLIC, PARAMETER :: jpnfe = jp_lp +20 !: Nano iron Concentration96 INTEGER, PUBLIC, PARAMETER :: jpnch = jp_lp +21 !: Nano Chlorophyll Concentration97 INTEGER, PUBLIC, PARAMETER :: jpdch = jp_lp +22 !: Diatoms Chlorophyll Concentration98 INTEGER, PUBLIC, PARAMETER :: jpno3 = jp_lp +23 !: Nitrates Concentration99 INTEGER, PUBLIC, PARAMETER :: jpnh4 = jp_lp +24 !: Ammonium Concentration92 INTEGER, PUBLIC, PARAMETER :: jpdic = 1 !: dissolved inoganic carbon concentration 93 INTEGER, PUBLIC, PARAMETER :: jptal = 2 !: total alkalinity 94 INTEGER, PUBLIC, PARAMETER :: jpoxy = 3 !: oxygen carbon concentration 95 INTEGER, PUBLIC, PARAMETER :: jpcal = 4 !: calcite concentration 96 INTEGER, PUBLIC, PARAMETER :: jppo4 = 5 !: phosphate concentration 97 INTEGER, PUBLIC, PARAMETER :: jppoc = 6 !: small particulate organic phosphate concentration 98 INTEGER, PUBLIC, PARAMETER :: jpsil = 7 !: silicate concentration 99 INTEGER, PUBLIC, PARAMETER :: jpphy = 8 !: phytoplancton concentration 100 INTEGER, PUBLIC, PARAMETER :: jpzoo = 9 !: zooplancton concentration 101 INTEGER, PUBLIC, PARAMETER :: jpdoc = 10 !: dissolved organic carbon concentration 102 INTEGER, PUBLIC, PARAMETER :: jpdia = 11 !: Diatoms Concentration 103 INTEGER, PUBLIC, PARAMETER :: jpmes = 12 !: Mesozooplankton Concentration 104 INTEGER, PUBLIC, PARAMETER :: jpdsi = 13 !: (big) Silicate Concentration 105 INTEGER, PUBLIC, PARAMETER :: jpfer = 14 !: Iron Concentration 106 INTEGER, PUBLIC, PARAMETER :: jpbfe = 15 !: Big iron particles Concentration 107 INTEGER, PUBLIC, PARAMETER :: jpgoc = 16 !: big particulate organic phosphate concentration 108 INTEGER, PUBLIC, PARAMETER :: jpsfe = 17 !: Small iron particles Concentration 109 INTEGER, PUBLIC, PARAMETER :: jpdfe = 18 !: Diatoms iron Concentration 110 INTEGER, PUBLIC, PARAMETER :: jpgsi = 19 !: Diatoms Silicate Concentration 111 INTEGER, PUBLIC, PARAMETER :: jpnfe = 20 !: Nano iron Concentration 112 INTEGER, PUBLIC, PARAMETER :: jpnch = 21 !: Nano Chlorophyll Concentration 113 INTEGER, PUBLIC, PARAMETER :: jpdch = 22 !: Diatoms Chlorophyll Concentration 114 INTEGER, PUBLIC, PARAMETER :: jpno3 = 23 !: Nitrates Concentration 115 INTEGER, PUBLIC, PARAMETER :: jpnh4 = 24 !: Ammonium Concentration 100 116 101 117 #else … … 103 119 !! Default No CFC geochemical model 104 120 !!--------------------------------------------------------------------- 105 LOGICAL, PUBLIC, PARAMETER :: lk_pisces = .FALSE. !: CFCflag106 LOGICAL, PUBLIC, PARAMETER :: lk_ kriest = .FALSE. !: Kriestflag121 LOGICAL, PUBLIC, PARAMETER :: lk_pisces = .FALSE. !: PISCES flag 122 LOGICAL, PUBLIC, PARAMETER :: lk_p4z = .FALSE. !: p4z flag 107 123 INTEGER, PUBLIC, PARAMETER :: jp_pisces = 0 !: No CFC tracers 108 124 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 0 !: No CFC additional 2d output arrays … … 112 128 113 129 ! Starting/ending PISCES do-loop indices (N.B. no PISCES : jpl_pcs < jpf_pcs the do-loop are never done) 114 INTEGER, PUBLIC, PARAMETER :: jp_pcs0 = jp_lp +1 !: First index of PISCES tracers115 INTEGER, PUBLIC, PARAMETER :: jp_pcs1 = jp_ lp + jp_pisces !: Last index of PISCES tracers116 INTEGER, PUBLIC, PARAMETER :: jp_pcs0_2d = jp_lp_2d +1 !: First index of 2D diag117 INTEGER, PUBLIC, PARAMETER :: jp_pcs1_2d = jp_ lp_2d + jp_pisces_2d !: Last index of 2D diag118 INTEGER, PUBLIC, PARAMETER :: jp_pcs0_3d = jp_lp_3d +1 !: First index of 3D diag119 INTEGER, PUBLIC, PARAMETER :: jp_pcs1_3d = jp_ lp_3d + jp_pisces_3d !: Last index of 3d diag120 INTEGER, PUBLIC, PARAMETER :: jp_pcs0_trd = jp_lp_trd +1 !: First index of bio diag121 INTEGER, PUBLIC, PARAMETER :: jp_pcs1_trd = jp_ lp_trd + jp_pisces_trd !: Last index of bio diag130 INTEGER, PUBLIC, PARAMETER :: jp_pcs0 = 1 !: First index of PISCES tracers 131 INTEGER, PUBLIC, PARAMETER :: jp_pcs1 = jp_pisces !: Last index of PISCES tracers 132 INTEGER, PUBLIC, PARAMETER :: jp_pcs0_2d = 1 !: First index of 2D diag 133 INTEGER, PUBLIC, PARAMETER :: jp_pcs1_2d = jp_pisces_2d !: Last index of 2D diag 134 INTEGER, PUBLIC, PARAMETER :: jp_pcs0_3d = 1 !: First index of 3D diag 135 INTEGER, PUBLIC, PARAMETER :: jp_pcs1_3d = jp_pisces_3d !: Last index of 3d diag 136 INTEGER, PUBLIC, PARAMETER :: jp_pcs0_trd = 1 !: First index of bio diag 137 INTEGER, PUBLIC, PARAMETER :: jp_pcs1_trd = jp_pisces_trd !: Last index of bio diag 122 138 123 139 -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90
r3294 r3680 7 7 !! 3.2 ! 2009-04 (C. Ethe & NEMO team) style 8 8 !!---------------------------------------------------------------------- 9 #if defined key_pisces 9 #if defined key_pisces || defined key_pisces_reduced 10 10 !!---------------------------------------------------------------------- 11 11 !! 'key_pisces' PISCES model … … 19 19 INTEGER :: numnatp 20 20 21 !!* Biological fluxes for light : variables shared by pisces & lobster 22 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:) :: neln !: number of T-levels + 1 in the euphotic layer 23 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: heup !: euphotic layer depth 24 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: etot !: par (photosynthetic available radiation) 25 ! 26 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: xksi !: LOBSTER : zooplakton closure 27 ! !: PISCES : silicon dependant half saturation 28 29 #if defined key_pisces 21 30 !!* Time variables 22 31 INTEGER :: nrdttrc !: ??? … … 27 36 28 37 !!* Biological parameters 38 INTEGER :: niter1max, niter2max !: Maximum number of iterations for sinking 29 39 REAL(wp) :: rno3 !: ??? 30 40 REAL(wp) :: o2ut !: ??? … … 37 47 REAL(wp) :: ferat3 !: ??? 38 48 39 !!* Damping40 LOGICAL :: ln_pisdmp !: relaxation or not of nutrients to a mean value41 INTEGER :: nn_pisdmp !: frequency of relaxation or not of nutrients to a mean value42 LOGICAL :: ln_pisclo !: Restoring or not of nutrients to initial value43 !: on close seas49 !!* diagnostic parameters 50 REAL(wp) :: tpp !: total primary production 51 REAL(wp) :: t_oce_co2_exp !: total carbon export 52 REAL(wp) :: t_oce_co2_flx !: Total ocean carbon flux 53 REAL(wp) :: t_atm_co2_flx !: global mean of atmospheric pco2 44 54 45 !!* Biological fluxes for light 46 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:) :: neln !: number of T-levels + 1 in the euphotic layer 47 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: heup !: euphotic layer depth 55 !!* restoring 56 LOGICAL :: ln_pisdmp !: restoring or not of nutrients to a mean value 57 INTEGER :: nn_pisdmp !: frequency of relaxation or not of nutrients to a mean value 58 LOGICAL :: ln_pisclo !: Restoring or not of nutrients to initial value on closed seas 59 60 !!* Mass conservation 61 LOGICAL :: ln_check_mass !: Flag to check mass conservation 48 62 49 63 !!* Biological fluxes for primary production 50 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: xksi !: ???51 64 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: xksimax !: ??? 52 65 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xnanono3 !: ??? … … 61 74 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimdfe !: ??? 62 75 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimsi !: ??? 76 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: biron !: bioavailable fraction of iron 63 77 64 78 … … 67 81 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: nitrfac !: ?? 68 82 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimbac !: ?? 83 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimbacl !: ?? 69 84 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xdiss !: ?? 70 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: prodcal !: Calcite production 71 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: grazing !: Total zooplankton grazing 85 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: prodcal !: Calcite production 72 86 73 87 !!* Variable for chemistry of the CO2 cycle … … 96 110 #endif 97 111 112 #endif 98 113 !!---------------------------------------------------------------------- 99 114 !! NEMO/TOP 3.3 , NEMO Consortium (2010) … … 111 126 !!---------------------------------------------------------------------- 112 127 ierr(:) = 0 113 !* Biological fluxes for light 114 ALLOCATE( neln(jpi,jpj), heup(jpi,jpj),STAT=ierr(1) )128 !* Biological fluxes for light : shared variables for pisces & lobster 129 ALLOCATE( etot(jpi,jpj,jpk), neln(jpi,jpj), heup(jpi,jpj), xksi(jpi,jpj), STAT=ierr(1) ) 115 130 ! 131 #if defined key_pisces 116 132 !* Biological fluxes for primary production 117 ALLOCATE( xksimax(jpi,jpj) , xksi(jpi,jpj), &133 ALLOCATE( xksimax(jpi,jpj) , biron (jpi,jpj,jpk), & 118 134 & xnanono3(jpi,jpj,jpk), xdiatno3(jpi,jpj,jpk), & 119 135 & xnanonh4(jpi,jpj,jpk), xdiatnh4(jpi,jpj,jpk), & … … 121 137 & xlimnfe (jpi,jpj,jpk), xlimdfe (jpi,jpj,jpk), & 122 138 & xlimsi (jpi,jpj,jpk), concdfe (jpi,jpj,jpk), & 123 & concnfe (jpi,jpj,jpk), STAT=ierr(2) )139 & concnfe (jpi,jpj,jpk), STAT=ierr(2) ) 124 140 ! 125 141 !* SMS for the organic matter 126 142 ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac(jpi,jpj,jpk), & 127 & prodcal(jpi,jpj,jpk) , grazing(jpi,jpj,jpk), &128 & xlimbac (jpi,jpj,jpk), xdiss (jpi,jpj,jpk), STAT=ierr(3) )129 ! 143 & xlimbac (jpi,jpj,jpk), xdiss (jpi,jpj,jpk), & 144 & xlimbacl(jpi,jpj,jpk), prodcal(jpi,jpj,jpk), STAT=ierr(3) ) 145 130 146 !* Variable for chemistry of the CO2 cycle 131 147 ALLOCATE( akb3(jpi,jpj,jpk) , ak13 (jpi,jpj,jpk) , & 132 148 & ak23(jpi,jpj,jpk) , aksp (jpi,jpj,jpk) , & 133 149 & akw3(jpi,jpj,jpk) , borat (jpi,jpj,jpk) , & 134 & hi (jpi,jpj,jpk) , excess(jpi,jpj,jpk) , STAT=ierr(4) )150 & hi (jpi,jpj,jpk) , excess(jpi,jpj,jpk) , STAT=ierr(4) ) 135 151 ! 136 152 !* Temperature dependancy of SMS terms 137 ALLOCATE( tgfunc(jpi,jpj,jpk) , tgfunc2(jpi,jpj,jpk) , STAT=ierr(5) )153 ALLOCATE( tgfunc(jpi,jpj,jpk) , tgfunc2(jpi,jpj,jpk) , STAT=ierr(5) ) 138 154 ! 139 155 !* Array used to indicate negative tracer values 140 ALLOCATE( xnegtr(jpi,jpj,jpk) , STAT=ierr(6) ) 156 ALLOCATE( xnegtr(jpi,jpj,jpk) , STAT=ierr(6) ) 157 #endif 141 158 ! 142 159 sms_pisces_alloc = MAXVAL( ierr ) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90
r3295 r3680 9 9 !! 1.0 ! 2005-03 (O. Aumont, A. El Moussaoui) F90 10 10 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) from trcini.pisces.h90 11 !!---------------------------------------------------------------------- 12 #if defined key_pisces 11 !! 3.5 ! 2012-05 (C. Ethe) Merge PISCES-LOBSTER 12 !!---------------------------------------------------------------------- 13 #if defined key_pisces || defined key_pisces_reduced 13 14 !!---------------------------------------------------------------------- 14 15 !! 'key_pisces' PISCES bio-model … … 20 21 USE trc ! passive tracers common variables 21 22 USE sms_pisces ! PISCES Source Minus Sink variables 22 USE p4zche ! Chemical model23 USE p4zsink ! vertical flux of particulate matter due to sinking24 USE p4zopt ! optical model25 USE p4zrem ! Remineralisation of organic matter26 USE p4zflx ! Gas exchange27 USE p4zsed ! Sedimentation28 USE p4zlim ! Co-limitations of differents nutrients29 USE p4zprod ! Growth rate of the 2 phyto groups30 USE p4zmicro ! Sources and sinks of microzooplankton31 USE p4zmeso ! Sources and sinks of mesozooplankton32 USE p4zmort ! Mortality terms for phytoplankton33 USE p4zlys ! Calcite saturation34 USE p4zsed ! Sedimentation35 23 36 24 IMPLICIT NONE … … 39 27 PUBLIC trc_ini_pisces ! called by trcini.F90 module 40 28 41 REAL(wp) :: sco2 = 2.312e-3_wp42 REAL(wp) :: alka0 = 2.423e-3_wp43 REAL(wp) :: oxyg0 = 177.6e-6_wp44 REAL(wp) :: po4 = 2.174e-6_wp45 REAL(wp) :: bioma0 = 1.000e-8_wp46 REAL(wp) :: silic1 = 91.65e-6_wp47 REAL(wp) :: no3 = 31.04e-6_wp * 7.625_wp48 29 49 30 # include "top_substitute.h90" … … 61 42 !! ** Purpose : Initialisation of the PISCES biochemical model 62 43 !!---------------------------------------------------------------------- 63 ! 64 INTEGER :: ji, jj, jk 44 45 IF( lk_pisces ) THEN ; CALL p4z_ini ! PISCES 46 ELSE ; CALL p2z_ini ! LOBSTER 47 ENDIF 48 49 END SUBROUTINE trc_ini_pisces 50 51 SUBROUTINE p4z_ini 52 !!---------------------------------------------------------------------- 53 !! *** ROUTINE p4z_ini *** 54 !! 55 !! ** Purpose : Initialisation of the PISCES biochemical model 56 !!---------------------------------------------------------------------- 57 #if defined key_pisces 58 ! 59 USE p4zsms ! Main P4Z routine 60 USE p4zche ! Chemical model 61 USE p4zsink ! vertical flux of particulate matter due to sinking 62 USE p4zopt ! optical model 63 USE p4zsbc ! Boundary conditions 64 USE p4zfechem ! Iron chemistry 65 USE p4zrem ! Remineralisation of organic matter 66 USE p4zflx ! Gas exchange 67 USE p4zlim ! Co-limitations of differents nutrients 68 USE p4zprod ! Growth rate of the 2 phyto groups 69 USE p4zmicro ! Sources and sinks of microzooplankton 70 USE p4zmeso ! Sources and sinks of mesozooplankton 71 USE p4zmort ! Mortality terms for phytoplankton 72 USE p4zlys ! Calcite saturation 73 ! 74 REAL(wp), SAVE :: sco2 = 2.312e-3_wp 75 REAL(wp), SAVE :: alka0 = 2.423e-3_wp 76 REAL(wp), SAVE :: oxyg0 = 177.6e-6_wp 77 REAL(wp), SAVE :: po4 = 2.174e-6_wp 78 REAL(wp), SAVE :: bioma0 = 1.000e-8_wp 79 REAL(wp), SAVE :: silic1 = 91.65e-6_wp 80 REAL(wp), SAVE :: no3 = 31.04e-6_wp * 7.625_wp 81 ! 82 INTEGER :: ji, jj, jk, ierr 65 83 REAL(wp) :: zcaralk, zbicarb, zco3 66 84 REAL(wp) :: ztmas, ztmas1 67 85 !!---------------------------------------------------------------------- 86 68 87 IF(lwp) WRITE(numout,*) 69 IF(lwp) WRITE(numout,*) ' trc_ini_pisces: PISCES biochemical model initialisation'88 IF(lwp) WRITE(numout,*) ' p4z_ini : PISCES biochemical model initialisation' 70 89 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 71 90 72 CALL pisces_alloc() ! Allocate PISCES arrays 73 91 ! Allocate PISCES arrays 92 ierr = sms_pisces_alloc() 93 ierr = ierr + p4z_che_alloc() 94 ierr = ierr + p4z_sink_alloc() 95 ierr = ierr + p4z_opt_alloc() 96 ierr = ierr + p4z_prod_alloc() 97 ierr = ierr + p4z_rem_alloc() 98 ierr = ierr + p4z_flx_alloc() 99 ! 100 IF( lk_mpp ) CALL mpp_sum( ierr ) 101 IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'pisces_alloc: unable to allocate PISCES arrays' ) 102 ! 103 104 CALL p4z_sms_init ! Maint routine 74 105 ! ! Time-step 75 106 rfact = rdttrc(1) ! --------- … … 132 163 xksimax(:,:) = xksi(:,:) 133 164 134 ENDIF135 136 IF( .NOT. ln_rsttr ) THEN137 165 ! Initialization of chemical variables of the carbon cycle 138 166 ! -------------------------------------------------------- … … 159 187 CALL p4z_lim_init ! co-limitations by the various nutrients 160 188 CALL p4z_prod_init ! phytoplankton growth rate over the global ocean. 189 CALL p4z_sbc_init ! boundary conditions 190 CALL p4z_fechem_init ! Iron chemistry 161 191 CALL p4z_rem_init ! remineralisation 162 192 CALL p4z_mort_init ! phytoplankton mortality 163 193 CALL p4z_micro_init ! microzooplankton 164 194 CALL p4z_meso_init ! mesozooplankton 165 CALL p4z_sed_init ! sedimentation166 195 CALL p4z_lys_init ! calcite saturation 167 196 CALL p4z_flx_init ! gas exchange … … 172 201 IF(lwp) WRITE(numout,*) 'Initialization of PISCES tracers done' 173 202 IF(lwp) WRITE(numout,*) 174 ! 175 END SUBROUTINE trc_ini_pisces176 177 178 SUBROUTINE p isces_alloc179 !!---------------------------------------------------------------------- 180 !! *** ROUTINE pisces_alloc***203 #endif 204 ! 205 END SUBROUTINE p4z_ini 206 207 SUBROUTINE p2z_ini 208 !!---------------------------------------------------------------------- 209 !! *** ROUTINE p2z_ini *** 181 210 !! 182 !! ** Purpose : Allocate all the dynamic arrays of PISCES 183 !!---------------------------------------------------------------------- 184 ! 185 INTEGER :: ierr 186 !!---------------------------------------------------------------------- 187 ! 188 ierr = sms_pisces_alloc() ! Start of PISCES-related alloc routines... 189 ierr = ierr + p4z_che_alloc() 190 ierr = ierr + p4z_sink_alloc() 191 ierr = ierr + p4z_opt_alloc() 192 ierr = ierr + p4z_prod_alloc() 193 ierr = ierr + p4z_rem_alloc() 194 ierr = ierr + p4z_sed_alloc() 195 ierr = ierr + p4z_flx_alloc() 211 !! ** Purpose : Initialisation of the LOBSTER biochemical model 212 !!---------------------------------------------------------------------- 213 #if defined key_pisces_reduced 214 ! 215 USE p2zopt 216 USE p2zexp 217 USE p2zbio 218 USE p2zsed 219 ! 220 INTEGER :: ji, jj, jk, ierr 221 !!---------------------------------------------------------------------- 222 223 IF(lwp) WRITE(numout,*) 224 IF(lwp) WRITE(numout,*) ' p2z_ini : LOBSTER biochemical model initialisation' 225 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 226 227 ierr = sms_pisces_alloc() 228 ierr = ierr + p2z_exp_alloc() 196 229 ! 197 230 IF( lk_mpp ) CALL mpp_sum( ierr ) 198 IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'pisces_alloc: unable to allocate PISCES arrays' ) 199 ! 200 END SUBROUTINE pisces_alloc 201 231 IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'p2z_ini: unable to allocate LOBSTER arrays' ) 232 233 ! LOBSTER initialisation for GYRE : init NO3=f(density) by asklod AS Kremeur 2005-07 234 ! ---------------------- 235 IF( .NOT. ln_rsttr ) THEN ! in case of no restart 236 trn(:,:,:,jpdet) = 0.1 * tmask(:,:,:) 237 trn(:,:,:,jpzoo) = 0.1 * tmask(:,:,:) 238 trn(:,:,:,jpnh4) = 0.1 * tmask(:,:,:) 239 trn(:,:,:,jpphy) = 0.1 * tmask(:,:,:) 240 trn(:,:,:,jpdom) = 1.0 * tmask(:,:,:) 241 WHERE( rhd(:,:,:) <= 24.5e-3 ) ; trn(:,:,:,jpno3 ) = 2._wp * tmask(:,:,:) 242 ELSE WHERE ; trn(:,:,:,jpno3) = ( 15.55 * ( rhd(:,:,:) * 1000. ) - 380.11 ) * tmask(:,:,:) 243 END WHERE 244 ENDIF 245 ! ! Namelist read 246 CALL p2z_opt_init ! Optics parameters 247 CALL p2z_sed_init ! sedimentation 248 CALL p2z_bio_init ! biology 249 CALL p2z_exp_init ! export 250 ! 251 IF(lwp) WRITE(numout,*) 252 IF(lwp) WRITE(numout,*) 'Initialization of LOBSTER tracers done' 253 IF(lwp) WRITE(numout,*) 254 #endif 255 ! 256 END SUBROUTINE p2z_ini 202 257 #else 203 258 !!---------------------------------------------------------------------- -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90
r3294 r3680 1 1 MODULE trcnam_pisces 2 2 !!====================================================================== 3 !! *** MODULE trcnam_ lobster***3 !! *** MODULE trcnam_pisces *** 4 4 !! TOP : initialisation of some run parameters for PISCES bio-model 5 5 !!====================================================================== … … 9 9 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) from trcnam.pisces.h90 10 10 !!---------------------------------------------------------------------- 11 #if defined key_pisces 11 #if defined key_pisces || defined key_pisces_reduced 12 12 !!---------------------------------------------------------------------- 13 13 !! 'key_pisces' : PISCES bio-model … … 19 19 USE trc ! TOP variables 20 20 USE sms_pisces ! sms trends 21 USE trdmod_trc_oce 21 22 USE iom ! I/O manager 22 23 … … 48 49 !! 49 50 INTEGER :: jl, jn 50 TYPE(DIAG), DIMENSION(jp_pisces_2d) :: pisdia2d 51 TYPE(DIAG), DIMENSION(jp_pisces_3d) :: pisdia3d 51 TYPE(DIAG), DIMENSION(jp_pisces_2d) :: pisdia2d 52 TYPE(DIAG), DIMENSION(jp_pisces_3d) :: pisdia3d 53 TYPE(DIAG), DIMENSION(jp_pisces_trd) :: pisdiabio 54 CHARACTER(LEN=20) :: clname 52 55 !! 53 NAMELIST/nampis bio/ nrdttrc, wsbio, xkmort, ferat3, wsbio254 #if defined key_ kriest55 NAMELIST/nampis krp/ xkr_eta, xkr_zeta, xkr_mass_min, xkr_mass_max56 NAMELIST/nampisdia/ pisdia3d, pisdia2d ! additional diagnostics 57 #if defined key_pisces_reduced 58 NAMELIST/nampisdbi/ pisdiabio 56 59 #endif 57 NAMELIST/nampisdia/ pisdia3d, pisdia2d ! additional diagnostics58 NAMELIST/nampisdmp/ ln_pisdmp, nn_pisdmp, ln_pisclo59 60 60 61 !!---------------------------------------------------------------------- 61 62 62 63 IF(lwp) WRITE(numout,*) 63 IF(lwp) WRITE(numout,*) ' trc_nam_pisces : read PISCES namelists' 64 clname = 'namelist_pisces' 65 #if defined key_pisces 66 IF(lwp) WRITE(numout,*) ' trc_nam_pisces : read PISCES namelist' 67 #else 68 IF(lwp) WRITE(numout,*) ' trc_nam_pisces : read LOBSTER namelist' 69 #endif 64 70 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 71 CALL ctl_opn( numnatp, TRIM( clname ), 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 65 72 66 67 ! ! Open the namelist file68 ! ! ----------------------69 CALL ctl_opn( numnatp, 'namelist_pisces', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )70 71 REWIND( numnatp )72 READ ( numnatp, nampisbio )73 74 IF(lwp) THEN ! control print75 WRITE(numout,*) ' Namelist : nampisbio'76 WRITE(numout,*) ' frequence pour la biologie nrdttrc =', nrdttrc77 WRITE(numout,*) ' POC sinking speed wsbio =', wsbio78 WRITE(numout,*) ' half saturation constant for mortality xkmort =', xkmort79 WRITE(numout,*) ' Fe/C in zooplankton ferat3 =', ferat380 WRITE(numout,*) ' Big particles sinking speed wsbio2 =', wsbio281 ENDIF82 83 #if defined key_kriest84 85 ! ! nampiskrp : kriest parameters86 ! ! -----------------------------87 xkr_eta = 0.6288 xkr_zeta = 1.6289 xkr_mass_min = 0.000290 xkr_mass_max = 1.91 92 REWIND( numnatp ) ! read natkriest93 READ ( numnatp, nampiskrp )94 95 IF(lwp) THEN96 WRITE(numout,*)97 WRITE(numout,*) ' Namelist : nampiskrp'98 WRITE(numout,*) ' Sinking exponent xkr_eta = ', xkr_eta99 WRITE(numout,*) ' N content exponent xkr_zeta = ', xkr_zeta100 WRITE(numout,*) ' Minimum mass for Aggregates xkr_mass_min = ', xkr_mass_min101 WRITE(numout,*) ' Maximum mass for Aggregates xkr_mass_max = ', xkr_mass_max102 WRITE(numout,*)103 ENDIF104 105 106 ! Computation of some variables107 xkr_massp = 5.7E-6 * 7.6 * xkr_mass_min**xkr_zeta108 109 #endif110 73 ! 111 74 IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN … … 162 125 ENDIF 163 126 164 REWIND( numnatp ) 165 READ ( numnatp, nampisdmp ) 127 #if defined key_pisces_reduced 166 128 167 IF(lwp) THEN ! control print 168 WRITE(numout,*) 169 WRITE(numout,*) ' Namelist : nampisdmp' 170 WRITE(numout,*) ' Relaxation of tracer to glodap mean value ln_pisdmp =', ln_pisdmp 171 WRITE(numout,*) ' Frequency of Relaxation nn_pisdmp =', nn_pisdmp 172 WRITE(numout,*) ' Restoring of tracer to initial value on closed seas ln_pisclo =', ln_pisclo 173 WRITE(numout,*) ' ' 174 ENDIF 129 IF( ( .NOT.lk_iomput .AND. ln_diabio ) .OR. lk_trdmld_trc ) THEN 130 ! 131 ! Namelist nampisdbi 132 ! ------------------- 133 DO jl = 1, jp_pisces_trd 134 IF( jl < 10 ) THEN ; WRITE (pisdiabio(jl)%sname,'("BIO_",I1)') jl ! short name 135 ELSEIF (jl < 100 ) THEN ; WRITE (pisdiabio(jl)%sname,'("BIO_",I2)') jl 136 ELSE ; WRITE (pisdiabio(jl)%sname,'("BIO_",I3)') jl 137 ENDIF 138 WRITE(pisdiabio(jl)%lname,'("BIOLOGICAL TREND NUMBER ",I2)') jl ! long name 139 pisdiabio(jl)%units = 'mmoleN/m3/s ' ! units 140 END DO 141 142 REWIND( numnatp ) 143 READ ( numnatp, nampisdbi ) 144 145 DO jl = 1, jp_pisces_trd 146 jn = jp_pcs0_trd + jl - 1 147 ctrbio(jl) = pisdiabio(jl)%sname 148 ctrbil(jl) = pisdiabio(jl)%lname 149 ctrbiu(jl) = pisdiabio(jl)%units 150 END DO 151 152 IF(lwp) THEN ! control print 153 WRITE(numout,*) 154 WRITE(numout,*) ' Namelist : nampisdbi' 155 DO jl = 1, jp_pisces_trd 156 jn = jp_pcs0_trd + jl - 1 157 WRITE(numout,*) ' biological trend No : ', jn, ' short name : ', ctrbio(jn), & 158 & ' long name : ', ctrbio(jn), ' unit : ', ctrbio(jn) 159 END DO 160 WRITE(numout,*) ' ' 161 END IF 162 ! 163 END IF 164 165 #endif 175 166 176 167 END SUBROUTINE trc_nam_pisces -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90
r3320 r3680 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 8 8 !!---------------------------------------------------------------------- 9 #if defined key_pisces 9 #if defined key_pisces || defined key_pisces_reduced 10 10 !!---------------------------------------------------------------------- 11 11 !! 'key_pisces' PISCES bio-model … … 13 13 !! trcsms_pisces : Time loop of passive tracers sms 14 14 !!---------------------------------------------------------------------- 15 USE oce_trc ! shared variables between ocean and passive tracers 16 USE trc ! passive tracers common variables 17 USE sms_pisces ! PISCES Source Minus Sink variables 18 USE p4zbio ! Biological model 19 USE p4zche ! Chemical model 20 USE p4zlys ! Calcite saturation 21 USE p4zflx ! Gas exchange 22 USE p4zsed ! Sedimentation 23 USE p4zint ! time interpolation 24 USE trdmod_oce ! Ocean trends variables 25 USE trdmod_trc ! TOP trends variables 26 USE sedmodel ! Sediment model 27 USE prtctl_trc ! print control for debugging 15 USE par_pisces 16 USE p4zsms 17 USE p2zsms 28 18 29 19 IMPLICIT NONE … … 31 21 32 22 PUBLIC trc_sms_pisces ! called in trcsms.F90 33 34 LOGICAL :: ln_check_mass = .false. !: Flag to check mass conservation35 36 INTEGER :: numno3 !: logical unit for NO3 budget37 INTEGER :: numalk !: logical unit for talk budget38 INTEGER :: numsil !: logical unit for Si budget39 40 23 !!---------------------------------------------------------------------- 41 24 !! NEMO/TOP 3.3 , NEMO Consortium (2010) … … 46 29 CONTAINS 47 30 31 !!---------------------------------------------------------------------- 32 !! *** ROUTINE trc_ini_pisces *** 33 !! 34 !! ** Purpose : Initialisation of the PISCES biochemical model 35 !!---------------------------------------------------------------------- 36 37 48 38 SUBROUTINE trc_sms_pisces( kt ) 49 39 !!--------------------------------------------------------------------- … … 51 41 !! 52 42 !! ** Purpose : Managment of the call to Biological sources and sinks 53 !! routines of PISCES bio-model 54 !! 55 !! ** Method : - at each new day ... 56 !! - several calls of bio and sed ??? 57 !! - ... 58 !!--------------------------------------------------------------------- 59 ! 60 INTEGER, INTENT( in ) :: kt ! ocean time-step index 61 !! 62 INTEGER :: jnt, jn, jl 63 CHARACTER (len=25) :: charout 64 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrdpis 65 !!--------------------------------------------------------------------- 66 ! 67 IF( nn_timing == 1 ) CALL timing_start('trc_sms_pisces') 68 ! 69 IF( ln_pisdmp .AND. MOD( kt - nn_dttrc, nn_pisdmp ) == 0 ) CALL trc_sms_pisces_dmp( kt ) ! Relaxation of some tracers 70 CALL trc_sms_pisces_mass_conserv( kt ) ! Mass conservation checking 71 IF( l_trdtrc ) THEN 72 CALL wrk_alloc( jpi, jpj, jpk, jp_pisces, ztrdpis ) 73 DO jn = 1, jp_pisces 74 jl = jn + jp_pcs0 - 1 75 ztrdpis(:,:,:,jn) = trn(:,:,:,jl) 76 ENDDO 77 ENDIF 78 79 IF( ndayflxtr /= nday_year ) THEN ! New days 80 ! 81 ndayflxtr = nday_year 82 83 IF(lwp) write(numout,*) 84 IF(lwp) write(numout,*) ' New chemical constants and various rates for biogeochemistry at new day : ', nday_year 85 IF(lwp) write(numout,*) '~~~~~~' 86 87 CALL p4z_che ! computation of chemical constants 88 CALL p4z_int ! computation of various rates for biogeochemistry 89 ! 90 ENDIF 91 92 93 DO jnt = 1, nrdttrc ! Potential time splitting if requested 94 ! 95 CALL p4z_bio (kt, jnt) ! Compute soft tissue production (POC) 96 CALL p4z_sed (kt, jnt) ! compute soft tissue remineralisation 97 ! 98 DO jn = jp_pcs0, jp_pcs1 99 trb(:,:,:,jn) = trn(:,:,:,jn) 100 ENDDO 101 ! 102 END DO 103 104 IF( l_trdtrc ) THEN 105 DO jn = 1, jp_pisces 106 jl = jn + jp_pcs0 - 1 107 ztrdpis(:,:,:,jn) = ( ztrdpis(:,:,:,jn) - trn(:,:,:,jl) ) * rfact2r 108 ENDDO 109 ENDIF 110 111 CALL p4z_lys( kt ) ! Compute CaCO3 saturation 112 CALL p4z_flx( kt ) ! Compute surface fluxes 113 114 DO jn = jp_pcs0, jp_pcs1 115 CALL lbc_lnk( trn(:,:,:,jn), 'T', 1. ) 116 CALL lbc_lnk( trb(:,:,:,jn), 'T', 1. ) 117 CALL lbc_lnk( tra(:,:,:,jn), 'T', 1. ) 118 END DO 119 120 IF( l_trdtrc ) THEN 121 DO jn = 1, jp_pisces 122 jl = jn + jp_pcs0 - 1 123 ztrdpis(:,:,:,jn) = ztrdpis(:,:,:,jn) + tra(:,:,:,jl) 124 CALL trd_mod_trc( ztrdpis(:,:,:,jn), jn, jptra_trd_sms, kt ) ! save trends 125 END DO 126 CALL wrk_dealloc( jpi, jpj, jpk, jp_pisces, ztrdpis ) 127 END IF 128 129 IF( lk_sed ) THEN 130 ! 131 CALL sed_model( kt ) ! Main program of Sediment model 132 ! 133 DO jn = jp_pcs0, jp_pcs1 134 CALL lbc_lnk( trn(:,:,:,jn), 'T', 1. ) 135 END DO 136 ! 137 ENDIF 138 ! 139 IF( nn_timing == 1 ) CALL timing_stop('trc_sms_pisces') 140 ! 141 END SUBROUTINE trc_sms_pisces 142 143 SUBROUTINE trc_sms_pisces_dmp( kt ) 144 !!---------------------------------------------------------------------- 145 !! *** trc_sms_pisces_dmp *** 146 !! 147 !! ** purpose : Relaxation of some tracers 148 !!---------------------------------------------------------------------- 149 ! 150 INTEGER, INTENT( in ) :: kt ! time step 151 ! 152 REAL(wp) :: alkmean = 2426. ! mean value of alkalinity ( Glodap ; for Goyet 2391. ) 153 REAL(wp) :: po4mean = 2.165 ! mean value of phosphates 154 REAL(wp) :: no3mean = 30.90 ! mean value of nitrate 155 REAL(wp) :: silmean = 91.51 ! mean value of silicate 156 ! 157 REAL(wp) :: zarea, zalksum, zpo4sum, zno3sum, zsilsum 158 !!--------------------------------------------------------------------- 159 160 161 IF(lwp) WRITE(numout,*) 162 IF(lwp) WRITE(numout,*) ' trc_sms_pisces_dmp : Relaxation of nutrients at time-step kt = ', kt 163 IF(lwp) WRITE(numout,*) 164 165 IF( cp_cfg == "orca" .AND. .NOT. lk_c1d ) THEN ! ORCA condiguration (not 1D) ! 166 ! ! --------------------------- ! 167 ! set total alkalinity, phosphate, nitrate & silicate 168 zarea = 1._wp / glob_sum( cvol(:,:,:) ) * 1e6 169 170 zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) ) * zarea 171 zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) ) * zarea / 122. 172 zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) ) * zarea / 7.6 173 zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) ) * zarea 174 175 IF(lwp) WRITE(numout,*) ' TALK mean : ', zalksum 176 trn(:,:,:,jptal) = trn(:,:,:,jptal) * alkmean / zalksum 177 178 IF(lwp) WRITE(numout,*) ' PO4 mean : ', zpo4sum 179 trn(:,:,:,jppo4) = trn(:,:,:,jppo4) * po4mean / zpo4sum 180 181 IF(lwp) WRITE(numout,*) ' NO3 mean : ', zno3sum 182 trn(:,:,:,jpno3) = trn(:,:,:,jpno3) * no3mean / zno3sum 183 184 IF(lwp) WRITE(numout,*) ' SiO3 mean : ', zsilsum 185 trn(:,:,:,jpsil) = MIN( 400.e-6,trn(:,:,:,jpsil) * silmean / zsilsum ) 186 ! 187 ENDIF 188 189 END SUBROUTINE trc_sms_pisces_dmp 190 191 SUBROUTINE trc_sms_pisces_mass_conserv ( kt ) 192 !!---------------------------------------------------------------------- 193 !! *** ROUTINE trc_sms_pisces_mass_conserv *** 194 !! 195 !! ** Purpose : Mass conservation check 43 !! routines of PISCES or LOBSTER bio-model 196 44 !! 197 45 !!--------------------------------------------------------------------- 198 46 ! 199 47 INTEGER, INTENT( in ) :: kt ! ocean time-step index 200 !! 201 REAL(wp) :: zalkbudget, zno3budget, zsilbudget 48 !!--------------------------------------------------------------------- 202 49 ! 203 NAMELIST/nampismass/ ln_check_mass 204 !!--------------------------------------------------------------------- 205 206 IF( kt == nittrc000 ) THEN 207 REWIND( numnatp ) 208 READ ( numnatp, nampismass ) 209 IF(lwp) THEN ! control print 210 WRITE(numout,*) ' ' 211 WRITE(numout,*) ' Namelist parameter for mass conservation checking' 212 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 213 WRITE(numout,*) ' Flag to check mass conservation of NO3/Si/TALK ln_check_mass = ', ln_check_mass 214 ENDIF 215 216 IF( ln_check_mass .AND. lwp) THEN ! Open budget file of NO3, ALK, Si 217 CALL ctl_opn( numno3, 'no3.budget' , 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 218 CALL ctl_opn( numsil, 'sil.budget' , 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 219 CALL ctl_opn( numalk, 'talk.budget', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 220 ENDIF 50 IF( lk_p4z ) THEN ; CALL p4z_sms( kt ) ! PISCES 51 ELSE ; CALL p2z_sms( kt ) ! LOBSTER 221 52 ENDIF 222 223 IF( ln_check_mass ) THEN ! Compute the budget of NO3, ALK, Si 224 zno3budget = glob_sum( ( trn(:,:,:,jpno3) + trn(:,:,:,jpnh4) & 225 & + trn(:,:,:,jpphy) + trn(:,:,:,jpdia) & 226 & + trn(:,:,:,jpzoo) + trn(:,:,:,jpmes) & 227 & + trn(:,:,:,jppoc) + trn(:,:,:,jpgoc) & 228 & + trn(:,:,:,jpdoc) ) * cvol(:,:,:) ) 229 ! 230 zsilbudget = glob_sum( ( trn(:,:,:,jpsil) + trn(:,:,:,jpgsi) & 231 & + trn(:,:,:,jpdsi) ) * cvol(:,:,:) ) 232 ! 233 zalkbudget = glob_sum( ( trn(:,:,:,jpno3) * rno3 & 234 & + trn(:,:,:,jptal) & 235 & + trn(:,:,:,jpcal) * 2. ) * cvol(:,:,:) ) 236 237 IF( lwp ) THEN 238 WRITE(numno3,9500) kt, zno3budget / areatot 239 WRITE(numsil,9500) kt, zsilbudget / areatot 240 WRITE(numalk,9500) kt, zalkbudget / areatot 241 ENDIF 242 ENDIF 243 9500 FORMAT(i10,e18.10) 244 ! 245 END SUBROUTINE trc_sms_pisces_mass_conserv 53 ! 54 END SUBROUTINE trc_sms_pisces 246 55 247 56 #else -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/PISCES/trcwri_pisces.F90
r3295 r3680 6 6 !! History : 1.0 ! 2009-05 (C. Ethe) Original code 7 7 !!---------------------------------------------------------------------- 8 #if defined key_top && key_pisces && defined key_iomput8 #if defined key_top && defined key_iomput && ( defined key_pisces || defined key_pisces_reduced ) 9 9 !!---------------------------------------------------------------------- 10 !! 'key_pisces 'PISCES model10 !! 'key_pisces or key_pisces_reduced' PISCES model 11 11 !!---------------------------------------------------------------------- 12 12 !! trc_wri_pisces : outputs of concentration fields 13 13 !!---------------------------------------------------------------------- 14 14 USE trc ! passive tracers common variables 15 USE sms_pisces ! PISCES variables 15 16 USE iom ! I/O manager 16 17 … … 35 36 ! write the tracer concentrations in the file 36 37 ! --------------------------------------- 37 DO jn = 1, jptra 38 zrfact = 1.0e+6 39 IF( jn == jpno3 .OR. jn == jpnh4 ) zrfact = 1.0e+6 / 7.6 40 IF( jn == jppo4 ) zrfact = 1.0e+6 / 122. 38 #if defined key_pisces_reduced 39 DO jn = jp_pcs0, jp_pcs1 41 40 cltra = TRIM( ctrcnm(jn) ) ! short title for tracer 42 41 CALL iom_put( cltra, trn(:,:,:,jn) * zrfact ) 43 42 END DO 43 #else 44 DO jn = jp_pcs0, jp_pcs1 45 zrfact = 1.0e+6 46 IF( jn == jpno3 .OR. jn == jpnh4 ) zrfact = rno3 * 1.0e+6 47 IF( jn == jppo4 ) zrfact = po4r * 1.0e+6 48 cltra = TRIM( ctrcnm(jn) ) ! short title for tracer 49 CALL iom_put( cltra, trn(:,:,:,jn) * zrfact ) 50 END DO 51 #endif 44 52 ! 45 53 END SUBROUTINE trc_wri_pisces -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90
r3294 r3680 82 82 IF( kt == nittrc000 ) CALL trc_adv_ctl ! initialisation & control of options 83 83 84 #if ! defined key_pisces 85 IF( neuler == 0 .AND. kt == nittrc000 ) THEN ! at nittrc000 86 r2dt(:) = rdttrc(:) ! = rdttrc (restarting with Euler time stepping) 87 ELSEIF( kt <= nittrc000 + 1 ) THEN ! at nittrc000 or nittrc000+1 88 r2dt(:) = 2. * rdttrc(:) ! = 2 rdttrc (leapfrog) 84 IF( ln_top_euler) THEN 85 r2dt(:) = rdttrc(:) ! = rdttrc (use Euler time stepping) 86 ELSE 87 IF( neuler == 0 .AND. kt == nittrc000 ) THEN ! at nittrc000 88 r2dt(:) = rdttrc(:) ! = rdttrc (restarting with Euler time stepping) 89 ELSEIF( kt <= nittrc000 + 1 ) THEN ! at nittrc000 or nittrc000+1 90 r2dt(:) = 2. * rdttrc(:) ! = 2 rdttrc (leapfrog) 91 ENDIF 89 92 ENDIF 90 #else91 r2dt(:) = rdttrc(:) ! = rdttrc (for PISCES use Euler time stepping)92 #endif93 93 94 94 ! ! effective transport -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90
r3294 r3680 81 81 NAMELIST/namtrc_rad/ ln_trcrad 82 82 #if defined key_trcdmp 83 NAMELIST/namtrc_dmp/ nn_hdmp_tr, nn_zdmp_tr, rn_surf_tr, &83 NAMELIST/namtrc_dmp/ ln_trcdmp, nn_hdmp_tr, nn_zdmp_tr, rn_surf_tr, & 84 84 & rn_bot_tr , rn_dep_tr , nn_file_tr 85 85 #endif … … 156 156 WRITE(numout,*) '~~~~~~~' 157 157 WRITE(numout,*) ' Namelist namtrc_dmp : set damping parameter' 158 WRITE(numout,*) ' add a damping term or not ln_trcdmp = ', ln_trcdmp 158 159 WRITE(numout,*) ' tracer damping option nn_hdmp_tr = ', nn_hdmp_tr 159 160 WRITE(numout,*) ' mixed layer damping option nn_zdmp_tr = ', nn_zdmp_tr, '(zoom: forced to 0)' -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90
r3294 r3680 34 34 USE tranxt 35 35 # if defined key_agrif 36 USE agrif_top_update37 36 USE agrif_top_interp 38 37 # endif … … 146 145 ENDIF 147 146 148 #if defined key_agrif149 ! Update tracer at AGRIF zoom boundaries150 IF( .NOT.Agrif_Root() ) CALL Agrif_Update_Trc( kt ) ! children only151 #endif152 153 147 ! trends computation 154 148 IF( l_trdtrc ) THEN ! trends -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90
r3294 r3680 63 63 IF( lk_cfc ) CALL trc_rad_sms( kt, trb, trn, jp_cfc0 , jp_cfc1 ) ! CFC model 64 64 IF( lk_c14b ) CALL trc_rad_sms( kt, trb, trn, jp_c14b0, jp_c14b1 ) ! bomb C14 65 IF( lk_lobster ) CALL trc_rad_sms( kt, trb, trn, jp_lob0 , jp_lob1, cpreserv='Y' ) ! LOBSTER model66 65 IF( lk_pisces ) CALL trc_rad_sms( kt, trb, trn, jp_pcs0 , jp_pcs1, cpreserv='Y' ) ! PISCES model 67 66 IF( lk_my_trc ) CALL trc_rad_sms( kt, trb, trn, jp_myt0 , jp_myt1 ) ! MY_TRC model -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90
r3625 r3680 50 50 !! tra = tra + emp * trn / e3t for k=1 51 51 !! where emp, the surface freshwater budget (evaporation minus 52 !! precipitation minus runoff) given in kg/m2/s is divided52 !! precipitation ) given in kg/m2/s is divided 53 53 !! by 1035 kg/m3 (density of ocean water) to obtain m/s. 54 54 !! … … 79 79 ENDIF 80 80 81 ! Coupling online : river runoff is added to the horizontal divergence (hdivn) in the subroutine sbc_rnf_div 82 ! one only consider the concentration/dilution effect due to evaporation minus precipitation + freezing/melting of sea-ice 81 83 82 IF( lk_offline ) THEN ! sfx in dynamical files contains sfx - rnf 83 zsfx(:,:) = sfx(:,:) 84 ELSE ! Concentration dilution effect on tracer due to evaporation, precipitation, and river runoff 85 IF( lk_vvl ) THEN ! volume variable 86 zsfx(:,:) = sfx(:,:) - emp(:,:) 87 !!ch zsfx(:,:) = 0. 88 ELSE ! linear free surface 89 IF( ln_rnf ) THEN ; zsfx(:,:) = sfx(:,:) - rnf(:,:) ! E-P-R 90 ELSE ; zsfx(:,:) = sfx(:,:) 91 ENDIF 92 ENDIF 93 ENDIF 84 IF( .NOT. lk_offline .AND. lk_vvl ) THEN ! online coupling + volume variable 85 zemps(:,:) = sfx(:,:) - emp(:,:) 86 ELSE 87 zemps(:,:) = emp(:,:) 88 ENDIF 94 89 95 90 ! 0. initialization -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
r3294 r3680 29 29 30 30 #if defined key_agrif 31 USE agrif_top_sponge ! Momemtum and tracers sponges 31 USE agrif_top_sponge ! tracers sponges 32 USE agrif_top_update ! tracers updates 32 33 #endif 33 34 … … 76 77 CALL trc_nxt( kstp ) ! tracer fields at next time step 77 78 IF( ln_trcrad ) CALL trc_rad( kstp ) ! Correct artificial negative concentrations 79 80 #if defined key_agrif 81 IF( .NOT. Agrif_Root()) CALL Agrif_Update_Trc( kstp ) ! Update tracer at AGRIF zoom boundaries : children only 82 #endif 78 83 IF( ln_zps ) CALL zps_hde( kstp, jptra, trn, gtru, gtrv ) ! Partial steps: now horizontal gradient of passive 79 84 ! tracers at the bottom ocean level … … 98 103 !!---------------------------------------------------------------------- 99 104 CONTAINS 100 SUBROUTINE trc_trp( k t) ! Empty routine101 INTEGER, INTENT(in) :: k t102 WRITE(*,*) 'trc_trp: You should not have seen this print! error?', k t105 SUBROUTINE trc_trp( kstp ) ! Empty routine 106 INTEGER, INTENT(in) :: kstp 107 WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kstp 103 108 END SUBROUTINE trc_trp 104 109 #endif -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
r3632 r3680 73 73 IF( kt == nittrc000 ) CALL zdf_ctl ! initialisation & control of options 74 74 75 #if ! defined key_pisces 76 IF( neuler == 0 .AND. kt == nittrc000 ) THEN ! at nittrc000 77 r2dt(:) = rdttrc(:) ! = rdttrc (restarting with Euler time stepping) 78 ELSEIF( kt <= nittrc000 + 1 ) THEN ! at nittrc000 or nittrc000+1 79 r2dt(:) = 2. * rdttrc(:) ! = 2 rdttrc (leapfrog) 75 IF( ln_top_euler) THEN 76 r2dt(:) = rdttrc(:) ! = rdttrc (use Euler time stepping) 77 ELSE 78 IF( neuler == 0 .AND. kt == nittrc000 ) THEN ! at nittrc000 79 r2dt(:) = rdttrc(:) ! = rdttrc (restarting with Euler time stepping) 80 ELSEIF( kt <= nittrc000 + 1 ) THEN ! at nittrc000 or nittrc000+1 81 r2dt(:) = 2. * rdttrc(:) ! = 2 rdttrc (leapfrog) 82 ENDIF 80 83 ENDIF 81 #else82 r2dt(:) = rdttrc(:) ! = rdttrc (for PISCES use Euler time stepping)83 #endif84 84 85 85 IF( l_trdtrc ) THEN -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90
r3320 r3680 34 34 USE prtctl ! print control 35 35 USE sms_pisces ! PISCES bio-model 36 USE sms_lobster ! LOBSTER bio-model37 36 USE wrk_nemo ! Memory allocation 38 37 … … 53 52 INTEGER :: ndimtrd1 54 53 INTEGER, SAVE :: ionce, icount 55 #if defined key_ lobster54 #if defined key_pisces_reduced 56 55 INTEGER :: nidtrdbio, nh_tb 57 56 INTEGER, SAVE :: ioncebio, icountbio … … 62 61 63 62 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: ztmltrd2 ! 64 #if defined key_ lobster63 #if defined key_pisces_reduced 65 64 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ztmltrdbio2 ! only needed for mean diagnostics in trd_mld_bio() 66 65 #endif … … 81 80 !!---------------------------------------------------------------------- 82 81 ALLOCATE( ztmltrd2(jpi,jpj,jpltrd_trc,jptra) , & 83 #if defined key_ lobster82 #if defined key_pisces_reduced 84 83 & ztmltrdbio2(jpi,jpj,jpdiabio) , & 85 84 #endif … … 133 132 SELECT CASE ( nn_ctls_trc ) ! choice of the control surface 134 133 CASE ( -2 ) ; STOP 'trdmld_trc : not ready ' ! -> isopycnal surface (see ???) 135 #if defined key_pisces || defined key_ lobster134 #if defined key_pisces || defined key_pisces_reduced 136 135 CASE ( -1 ) ; nmld_trc(:,:) = neln(:,:) ! -> euphotic layer with light criterion 137 136 #endif … … 232 231 INTEGER , INTENT(in) :: ktrd ! bio trend index 233 232 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: ptrc_trdmld ! passive trc trend 234 #if defined key_ lobster233 #if defined key_pisces_reduced 235 234 ! 236 235 INTEGER :: ji, jj, jk, isum … … 940 939 !!---------------------------------------------------------------------- 941 940 INTEGER, INTENT( in ) :: kt ! ocean time-step index 942 #if defined key_ lobster941 #if defined key_pisces_reduced 943 942 INTEGER :: jl, it, itmod 944 943 LOGICAL :: llwarn = .TRUE., lldebug = .TRUE. … … 1217 1216 tmltrd_csum_ln_trc (:,:,:,:) = 0.e0 ; rmld_sum_trc (:,:) = 0.e0 1218 1217 1219 #if defined key_ lobster1218 #if defined key_pisces_reduced 1220 1219 nmoymltrdbio = 0 1221 1220 tmltrd_sum_bio (:,:,:) = 0.e0 ; tmltrd_csum_ln_bio (:,:,:) = 0.e0 1222 DO jl = 1, jp_ lobster_trd1221 DO jl = 1, jp_pisces_trd 1223 1222 ctrd_bio(jl,1) = ctrbil(jl) ! long name 1224 1223 ctrd_bio(jl,2) = ctrbio(jl) ! short name … … 1234 1233 tml_sumb_trc (:,:,:) = 0.e0 ; tmltrd_csum_ub_trc (:,:,:,:) = 0.e0 ! mean 1235 1234 tmltrd_atf_sumb_trc(:,:,:) = 0.e0 ; tmltrd_rad_sumb_trc(:,:,:) = 0.e0 1236 #if defined key_ lobster1235 #if defined key_pisces_reduced 1237 1236 tmltrd_csum_ub_bio (:,:,:) = 0.e0 1238 1237 #endif … … 1242 1241 icount = 1 ; ionce = 1 ! open specifier 1243 1242 1244 #if defined key_ lobster1243 #if defined key_pisces_reduced 1245 1244 icountbio = 1 ; ioncebio = 1 ! open specifier 1246 1245 #endif … … 1337 1336 END DO 1338 1337 1339 #if defined key_ lobster1338 #if defined key_pisces_reduced 1340 1339 !-- Create a NetCDF file and enter the define mode 1341 1340 CALL dia_nam( clhstnam, nn_trd_trc, 'trdbio' ) … … 1383 1382 END DO 1384 1383 1385 #if defined key_ lobster1386 DO jl = 1, jp_ lobster_trd1384 #if defined key_pisces_reduced 1385 DO jl = 1, jp_pisces_trd 1387 1386 CALL histdef(nidtrdbio, TRIM("ML_"//ctrd_bio(jl,2)), TRIM(clmxl//" ML_"//ctrd_bio(jl,1)) , & 1388 1387 & cltrcu, jpi, jpj, nh_tb, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) ! IOIPSL: time mean … … 1395 1394 END DO 1396 1395 1397 #if defined key_ lobster1396 #if defined key_pisces_reduced 1398 1397 !-- Leave IOIPSL/NetCDF define mode 1399 1398 CALL histend( nidtrdbio, snc4set ) -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc_rst.F90
r2528 r3680 105 105 END DO ! tracer loop 106 106 ! ! =========== 107 #if defined key_ lobster108 DO jl = 1, jp_ lobster_trd107 #if defined key_pisces_reduced 108 DO jl = 1, jp_pisces_trd 109 109 CALL iom_rstput( kt, nitrst, nummldw_trc, 'tmltrd_csum_ub_bio'//ctrd_bio(jl,2), tmltrd_csum_ub_bio(:,:,jl) ) 110 110 ENDDO … … 190 190 ! ! =========== 191 191 192 #if defined key_ lobster193 DO jl = 1, jp_ lobster_trd192 #if defined key_pisces_reduced 193 DO jl = 1, jp_pisces_trd 194 194 CALL iom_get( inum, jpdom_autoglo, 'tmltrd_csum_ub_bio'//ctrd_bio(jl,2), tmltrd_csum_ub_bio(:,:,jl) ) 195 195 ENDDO -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc_oce.F90
r3320 r3680 106 106 # endif 107 107 108 # if defined key_ lobster108 # if defined key_pisces_reduced 109 109 CHARACTER(LEN=80) :: clname_bio, ctrd_bio(jpdiabio,2) 110 110 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: & … … 154 154 #endif 155 155 ! 156 # if defined key_ lobster156 # if defined key_pisces_reduced 157 157 ALLOCATE( tmltrd_bio (jpi,jpj,jpdiabio) , & 158 158 & tmltrd_sum_bio (jpi,jpj,jpdiabio) , & -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
r3625 r3680 56 56 57 57 !* model domain * 58 USE dom_oce , ONLY : lzoom => lzoom !: zoom flag 59 USE dom_oce , ONLY : lzoom_e => lzoom_e !: East zoom type flag 60 USE dom_oce , ONLY : lzoom_w => lzoom_w !: West zoom type flag 61 USE dom_oce , ONLY : lzoom_s => lzoom_s !: South zoom type flag 62 USE dom_oce , ONLY : lzoom_n => lzoom_n !: North zoom type flag 63 USE dom_oce , ONLY : lzoom_arct => lzoom_arct !: ORCA arctic zoom flag 64 USE dom_oce , ONLY : lzoom_anta => lzoom_anta !: ORCA antarctic zoom flag 65 USE dom_oce , ONLY : nperio => nperio !: type of lateral boundary condition 66 USE dom_oce , ONLY : nimpp => nimpp !: i index for mpp-subdomain left bottom 67 USE dom_oce , ONLY : njmpp => njmpp !: j index for mpp-subdomain left bottom 68 USE dom_oce , ONLY : nproc => nproc !: number for local processor 69 USE dom_oce , ONLY : narea => narea !: number for local area 70 USE dom_oce , ONLY : mig => mig !: local ==> global domain i-indice 71 USE dom_oce , ONLY : mjg => mjg !: local ==> global domain i-indice 72 USE dom_oce , ONLY : mi0 => mi0 !: global ==> local domain i-indice 73 USE dom_oce , ONLY : mi1 => mi1 !: (mi0=1 and mi1=0 if the global indice is not in the local one) 74 USE dom_oce , ONLY : mj0 => mj0 !: global ==> local domain j-indice 75 USE dom_oce , ONLY : mj1 => mj1 !: (mj0=1 and mj1=0 if the global indice is not in the local one) 76 USE dom_oce , ONLY : nidom => nidom 77 USE dom_oce , ONLY : nimppt => nimppt !:i-indexes for each processor 78 USE dom_oce , ONLY : njmppt => njmppt !:j-indexes for each processor 79 USE dom_oce , ONLY : ibonit => ibonit !:i-processor neighbour existence 80 USE dom_oce , ONLY : ibonjt => ibonjt !:j- processor neighbour existence 81 USE dom_oce , ONLY : nlci => nlci !:i- & j-dimensions of the local subdomain 82 USE dom_oce , ONLY : nlcj => nlcj !: 83 USE dom_oce , ONLY : nldi => nldi !:first and last indoor i- and j-indexes 84 USE dom_oce , ONLY : nlei => nlei !: 85 USE dom_oce , ONLY : nldj => nldj !: 86 USE dom_oce , ONLY : nlej => nlej !: 87 USE dom_oce , ONLY : nlcit => nlcit !:dimensions of every i-subdomain 88 USE dom_oce , ONLY : nlcjt => nlcjt !:dimensions of every j-subdomain 89 USE dom_oce , ONLY : nldit => nldit !:first indoor index for each i-domain 90 USE dom_oce , ONLY : nleit => nleit !:last indoor index for each i-domain 91 USE dom_oce , ONLY : nldjt => nldjt !:first indoor index for each j-domain 92 USE dom_oce , ONLY : nlejt => nlejt !:last indoor index for each j-domain 93 94 !* horizontal mesh * 95 USE dom_oce , ONLY : glamt => glamt !: longitude of t-point (degre) 96 USE dom_oce , ONLY : glamu => glamu !: longitude of t-point (degre) 97 USE dom_oce , ONLY : glamv => glamv !: longitude of t-point (degre) 98 USE dom_oce , ONLY : glamf => glamf !: longitude of t-point (degre) 99 USE dom_oce , ONLY : gphit => gphit !: latitude of t-point (degre) 100 USE dom_oce , ONLY : gphiu => gphiu !: latitude of t-point (degre) 101 USE dom_oce , ONLY : gphiv => gphiv !: latitude of t-point (degre) 102 USE dom_oce , ONLY : gphif => gphif !: latitude of t-point (degre) 103 USE dom_oce , ONLY : e1t => e1t !: horizontal scale factors at t-point (m) 104 USE dom_oce , ONLY : e2t => e2t !: horizontal scale factors at t-point (m) 105 USE dom_oce , ONLY : e1e2t => e1e2t !: cell surface at t-point (m2) 106 USE dom_oce , ONLY : e1u => e1u !: horizontal scale factors at u-point (m) 107 USE dom_oce , ONLY : e2u => e2u !: horizontal scale factors at u-point (m) 108 USE dom_oce , ONLY : e1v => e1v !: horizontal scale factors at v-point (m) 109 USE dom_oce , ONLY : e2v => e2v !: horizontal scale factors at v-point (m) 110 111 !* vertical mesh * 112 USE dom_oce , ONLY : gdept_0 => gdept_0 !: reference depth of t-points (m) 113 USE dom_oce , ONLY : e3t_0 => e3t_0 !: reference depth of t-points (m) 114 USE dom_oce , ONLY : e3w_0 => e3w_0 !: reference depth of w-points (m) 115 USE dom_oce , ONLY : gdepw_0 => gdepw_0 !: reference depth of w-points (m) 116 # if ! defined key_zco 117 USE dom_oce , ONLY : gdep3w => gdep3w !: ??? 118 USE dom_oce , ONLY : gdept => gdept !: depth of t-points (m) 119 USE dom_oce , ONLY : gdepw => gdepw !: depth of t-points (m) 120 USE dom_oce , ONLY : e3t => e3t !: vertical scale factors at t- 121 USE dom_oce , ONLY : e3u => e3u !: vertical scale factors at u- 122 USE dom_oce , ONLY : e3v => e3v !: vertical scale factors v- 123 USE dom_oce , ONLY : e3w => e3w !: w-points (m) 124 USE dom_oce , ONLY : e3f => e3f !: f-points (m) 125 USE dom_oce , ONLY : e3uw => e3uw !: uw-points (m) 126 USE dom_oce , ONLY : e3vw => e3vw !: vw-points (m) 127 # endif 128 USE dom_oce , ONLY : ln_zps => ln_zps !: partial steps flag 129 USE dom_oce , ONLY : ln_sco => ln_sco !: s-coordinate flag 130 USE dom_oce , ONLY : ln_zco => ln_zco !: z-coordinate flag 131 USE dom_oce , ONLY : hbatt => hbatt !: ocean depth at the vertical of t-point (m) 132 USE dom_oce , ONLY : hbatu => hbatu !: ocean depth at the vertical of u-point (m) 133 USE dom_oce , ONLY : hbatv => hbatv !: ocean depth at the vertical of w-point (m) 134 USE dom_oce , ONLY : gsigt => gsigt !: model level depth coefficient at T-levels 135 USE dom_oce , ONLY : gsigw => gsigw !: model level depth coefficient at W-levels 136 USE dom_oce , ONLY : gsi3w => gsi3w !: model level depth coef at w-levels (defined as the sum of e3w) 137 USE dom_oce , ONLY : esigt => esigt !: vertical scale factor coef. at t-levels 138 USE dom_oce , ONLY : esigw => esigw !: vertical scale factor coef. at w-levels 139 USE dom_oce , ONLY : lk_vvl => lk_vvl !: variable grid flag 140 # if defined key_vvl 141 USE dom_oce , ONLY : gdep3w_1 => gdep3w_1 !: ??? 142 USE dom_oce , ONLY : gdept_1 => gdept_1 !: depth of t-points (m) 143 USE dom_oce , ONLY : gdepw_1 => gdepw_1 !: depth of t-points (m) 144 USE dom_oce , ONLY : e3t_1 => e3t_1 !: vertical scale factors at t- 145 USE dom_oce , ONLY : e3u_1 => e3u_1 !: vertical scale factors at u- 146 USE dom_oce , ONLY : e3v_1 => e3v_1 !: vertical scale factors v- 147 USE dom_oce , ONLY : e3w_1 => e3w_1 !: w-points (m) 148 USE dom_oce , ONLY : e3f_1 => e3f_1 !: f-points (m) 149 USE dom_oce , ONLY : e3uw_1 => e3uw_1 !: uw-points (m) 150 USE dom_oce , ONLY : e3vw_1 => e3vw_1 !: vw-points (m) 151 # endif 152 !* masks, bathymetry * 153 USE dom_oce , ONLY : mbkt => mbkt !: vertical index of the bottom last T- ocean level 154 USE dom_oce , ONLY : mbku => mbku !: vertical index of the bottom last U- ocean level 155 USE dom_oce , ONLY : mbkv => mbkv !: vertical index of the bottom last V- ocean level 156 USE dom_oce , ONLY : tmask_i => tmask_i !: Interior mask at t-points 157 USE dom_oce , ONLY : tmask => tmask !: land/ocean mask at t-points 158 USE dom_oce , ONLY : umask => umask !: land/ocean mask at u-points 159 USE dom_oce , ONLY : vmask => vmask !: land/ocean mask at v-points 160 USE dom_oce , ONLY : fmask => fmask !: land/ocean mask at f-points 161 162 !* time domain * 163 USE dom_oce , ONLY : neuler => neuler !: restart euler forward option (0=Euler) 164 USE dom_oce , ONLY : rdt => rdt !: time step for the dynamics 165 USE dom_oce , ONLY : atfp => atfp !: asselin time filter parameter 166 USE dom_oce , ONLY : atfp1 => atfp1 !: asselin time filter coeff. (atfp1= 1-2*atfp) 167 USE dom_oce , ONLY : rdttra => rdttra !: vertical profile of tracer time step 168 ! !: it is the accumulated duration of previous runs 169 ! !: that may have been run with different time steps. 170 !* calendar variables * 171 USE dom_oce , ONLY : nyear => nyear !: current year 172 USE dom_oce , ONLY : nmonth => nmonth !: current month 173 USE dom_oce , ONLY : nday => nday !: current day of the month 174 USE dom_oce , ONLY : ndastp => ndastp !: time step date in yyyymmdd format 175 USE dom_oce , ONLY : nday_year => nday_year !: current day counted from jan 1st of the current year 176 USE dom_oce , ONLY : nsec_year => nsec_year !: current time step counted in second since 00h jan 1st of the current year 177 USE dom_oce , ONLY : nsec_month => nsec_month !: current time step counted in second since 00h 1st day of the current month 178 USE dom_oce , ONLY : nsec_day => nsec_day !: current time step counted in second since 00h of the current day 179 USE dom_oce , ONLY : fjulday => fjulday !: julian day 180 USE dom_oce , ONLY : adatrj => adatrj !: number of elapsed days since the begining of the whole simulation 181 !: (cumulative duration of previous runs 182 !: that may have used different time-step size) 183 USE dom_oce , ONLY : nyear_len => nyear_len !: length in days of the previous/current year 184 USE dom_oce , ONLY : nmonth_len => nmonth_len !: length in days of the months of the current year 58 USE dom_oce 185 59 186 60 … … 217 91 USE oce , ONLY : grv => grv !: 218 92 #endif 219 220 USE dom_oce , ONLY : nn_cla => nn_cla !: flag (0/1) for cross land advection221 93 222 94 !* surface fluxes * -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/par_trc.F90
r2528 r3680 5 5 !!====================================================================== 6 6 !! History : - ! 1996-01 (M. Levy) original code 7 !! - ! 1999-07 (M. Levy) for LOBSTER1 or NPZD model8 7 !! - ! 2000-04 (O. Aumont, M.A. Foujols) HAMOCC3 and P3ZD 9 8 !! 1.0 ! 2004-03 (C. Ethe) Free form and module … … 12 11 USE par_kind ! kind parameters 13 12 ! 14 USE par_lobster ! LOBSTER model15 13 USE par_pisces ! PISCES model 16 14 USE par_c14b ! C14 bomb tracer … … 22 20 ! Passive tracers : Total size 23 21 ! --------------- ! total number of passive tracers, of 2d and 3d output and trend arrays 24 INTEGER, PUBLIC, PARAMETER :: jptra = jp_ lobster + jp_pisces + jp_cfc + jp_c14b + jp_my_trc25 INTEGER, PUBLIC, PARAMETER :: jpdia2d = jp_ lobster_2d + jp_pisces_2d + jp_cfc_2d + jp_c14b_2d + jp_my_trc_2d26 INTEGER, PUBLIC, PARAMETER :: jpdia3d = jp_ lobster_3d + jp_pisces_3d + jp_cfc_3d + jp_c14b_3d + jp_my_trc_3d22 INTEGER, PUBLIC, PARAMETER :: jptra = jp_pisces + jp_cfc + jp_c14b + jp_my_trc 23 INTEGER, PUBLIC, PARAMETER :: jpdia2d = jp_pisces_2d + jp_cfc_2d + jp_c14b_2d + jp_my_trc_2d 24 INTEGER, PUBLIC, PARAMETER :: jpdia3d = jp_pisces_3d + jp_cfc_3d + jp_c14b_3d + jp_my_trc_3d 27 25 ! ! total number of sms diagnostic arrays 28 INTEGER, PUBLIC, PARAMETER :: jpdiabio = jp_lobster_trd +jp_pisces_trd + jp_cfc_trd + jp_c14b_trd + jp_my_trc_trd26 INTEGER, PUBLIC, PARAMETER :: jpdiabio = jp_pisces_trd + jp_cfc_trd + jp_c14b_trd + jp_my_trc_trd 29 27 30 28 ! 1D configuration ("key_c1d") -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90
r3294 r3680 17 17 USE par_trc ! TOP parameters 18 18 USE oce_trc ! ocean space and time domain variables 19 USE prtctl ! print control for OPA 19 20 20 21 IMPLICIT NONE … … 296 297 END SUBROUTINE prt_ctl_trc_init 297 298 298 299 SUBROUTINE sub_dom300 !!----------------------------------------------------------------------301 !! *** ROUTINE sub_dom ***302 !!303 !! ** Purpose : Lay out the global domain over processors.304 !! CAUTION:305 !! This part has been extracted from the mpp_init306 !! subroutine and names of variables/arrays have been307 !! slightly changed to avoid confusion but the computation308 !! is exactly the same. Any modification about indices of309 !! each sub-domain in the mppini.F90 module should be reported310 !! here.311 !!312 !! ** Method : Global domain is distributed in smaller local domains.313 !! Periodic condition is a function of the local domain position314 !! (global boundary or neighbouring domain) and of the global315 !! periodic316 !! Type : jperio global periodic condition317 !! nperio local periodic condition318 !!319 !! ** Action : - set domain parameters320 !! nimpp : longitudinal index321 !! njmpp : latitudinal index322 !! nperio : lateral condition type323 !! narea : number for local area324 !! nlcil : first dimension325 !! nlcjl : second dimension326 !! nbondil : mark for "east-west local boundary"327 !! nbondjl : mark for "north-south local boundary"328 !!----------------------------------------------------------------------329 INTEGER :: ji, jj, js ! dummy loop indices330 INTEGER :: ii, ij ! temporary integers331 INTEGER :: irestil, irestjl ! " "332 INTEGER :: ijpi , ijpj, nlcil ! temporary logical unit333 INTEGER :: nlcjl , nbondil, nbondjl334 INTEGER :: nrecil, nrecjl, nldil, nleil, nldjl, nlejl335 REAL(wp) :: zidom, zjdom ! temporary scalars336 INTEGER, POINTER, DIMENSION(:,:) :: iimpptl, ijmpptl, ilcitl, ilcjtl ! temporary workspace337 !!----------------------------------------------------------------------338 !339 CALL wrk_alloc( isplt, jsplt, ilcitl, ilcjtl, iimpptl, ijmpptl )340 !341 ! Dimension arrays for subdomains342 ! -------------------------------343 ! Computation of local domain sizes ilcitl() ilcjtl()344 ! These dimensions depend on global sizes isplt,jsplt and jpiglo,jpjglo345 ! The subdomains are squares leeser than or equal to the global346 ! dimensions divided by the number of processors minus the overlap347 ! array (cf. par_oce.F90).348 349 ijpi = ( jpiglo-2*jpreci + (isplt-1) ) / isplt + 2*jpreci350 ijpj = ( jpjglo-2*jprecj + (jsplt-1) ) / jsplt + 2*jprecj351 352 nrecil = 2 * jpreci353 nrecjl = 2 * jprecj354 irestil = MOD( jpiglo - nrecil , isplt )355 irestjl = MOD( jpjglo - nrecjl , jsplt )356 357 IF( irestil == 0 ) irestil = isplt358 DO jj = 1, jsplt359 DO ji = 1, irestil360 ilcitl(ji,jj) = ijpi361 END DO362 DO ji = irestil+1, isplt363 ilcitl(ji,jj) = ijpi -1364 END DO365 END DO366 367 IF( irestjl == 0 ) irestjl = jsplt368 DO ji = 1, isplt369 DO jj = 1, irestjl370 ilcjtl(ji,jj) = ijpj371 END DO372 DO jj = irestjl+1, jsplt373 ilcjtl(ji,jj) = ijpj -1374 END DO375 END DO376 377 zidom = nrecil378 DO ji = 1, isplt379 zidom = zidom + ilcitl(ji,1) - nrecil380 END DO381 382 zjdom = nrecjl383 DO jj = 1, jsplt384 zjdom = zjdom + ilcjtl(1,jj) - nrecjl385 END DO386 387 ! Index arrays for subdomains388 ! ---------------------------389 390 iimpptl(:,:) = 1391 ijmpptl(:,:) = 1392 393 IF( isplt > 1 ) THEN394 DO jj = 1, jsplt395 DO ji = 2, isplt396 iimpptl(ji,jj) = iimpptl(ji-1,jj) + ilcitl(ji-1,jj) - nrecil397 END DO398 END DO399 ENDIF400 401 IF( jsplt > 1 ) THEN402 DO jj = 2, jsplt403 DO ji = 1, isplt404 ijmpptl(ji,jj) = ijmpptl(ji,jj-1)+ilcjtl(ji,jj-1)-nrecjl405 END DO406 END DO407 ENDIF408 409 ! Subdomain description410 ! ---------------------411 412 DO js = 1, ijsplt413 ii = 1 + MOD( js-1, isplt )414 ij = 1 + (js-1) / isplt415 nimpptl(js) = iimpptl(ii,ij)416 njmpptl(js) = ijmpptl(ii,ij)417 nlcitl (js) = ilcitl (ii,ij)418 nlcil = nlcitl (js)419 nlcjtl (js) = ilcjtl (ii,ij)420 nlcjl = nlcjtl (js)421 nbondjl = -1 ! general case422 IF( js > isplt ) nbondjl = 0 ! first row of processor423 IF( js > (jsplt-1)*isplt ) nbondjl = 1 ! last row of processor424 IF( jsplt == 1 ) nbondjl = 2 ! one processor only in j-direction425 ibonjtl(js) = nbondjl426 427 nbondil = 0 !428 IF( MOD( js, isplt ) == 1 ) nbondil = -1 !429 IF( MOD( js, isplt ) == 0 ) nbondil = 1 !430 IF( isplt == 1 ) nbondil = 2 ! one processor only in i-direction431 ibonitl(js) = nbondil432 433 nldil = 1 + jpreci434 nleil = nlcil - jpreci435 IF( nbondil == -1 .OR. nbondil == 2 ) nldil = 1436 IF( nbondil == 1 .OR. nbondil == 2 ) nleil = nlcil437 nldjl = 1 + jprecj438 nlejl = nlcjl - jprecj439 IF( nbondjl == -1 .OR. nbondjl == 2 ) nldjl = 1440 IF( nbondjl == 1 .OR. nbondjl == 2 ) nlejl = nlcjl441 nlditl(js) = nldil442 nleitl(js) = nleil443 nldjtl(js) = nldjl444 nlejtl(js) = nlejl445 END DO446 !447 CALL wrk_dealloc( isplt, jsplt, ilcitl, ilcjtl, iimpptl, ijmpptl )448 !449 END SUBROUTINE sub_dom450 451 299 #else 452 300 !!---------------------------------------------------------------------- -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/trc.F90
r3625 r3680 5 5 !!====================================================================== 6 6 !! History : OPA ! 1996-01 (M. Levy) Original code 7 !! - ! 1999-07 (M. Levy) for LOBSTER1 or NPZD model8 7 !! - ! 2000-04 (O. Aumont, M.A. Foujols) HAMOCC3 and P3ZD 9 8 !! NEMO 1.0 ! 2004-03 (C. Ethe) Free form and module … … 25 24 INTEGER, PUBLIC :: numnat !: logicla unit for the passive tracer NAMELIST 26 25 INTEGER, PUBLIC :: numstr !: logical unit for tracer statistics 26 INTEGER, PUBLIC :: numrtr !: logical unit for trc restart (read ) 27 INTEGER, PUBLIC :: numrtw !: logical unit for trc restart ( write ) 28 LOGICAL, PUBLIC :: ln_top_euler !: boolean term for euler integration in the first timestep 27 29 28 30 !! passive tracers fields (before,now,after) … … 68 70 CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcln !: trccer field long name 69 71 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcun !: tracer unit 70 LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_ini !: Initialisation from data input file71 72 LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_wri !: save the tracer or not 72 73 … … 76 77 CHARACTER(len = 20) :: units !: unit 77 78 END TYPE DIAG 79 80 !! information for inputs 81 !! -------------------------------------------------- 82 LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_ini !: Initialisation from data input file 83 LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_obc !: Use open boundary condition data 84 LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_sbc !: Use surface boundary condition data 85 LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_cbc !: Use coastal boundary condition data 78 86 79 87 !! additional 2D/3D outputs namelist -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/trcini.F90
r3294 r3680 21 21 USE trcnam ! Namelist read 22 22 USE trcini_cfc ! CFC initialisation 23 USE trcini_lobster ! LOBSTER initialisation24 23 USE trcini_pisces ! PISCES initialisation 25 24 USE trcini_c14b ! C14 bomb initialisation … … 70 69 CALL top_alloc() ! allocate TOP arrays 71 70 72 IF( ln_dm2dc .AND. ( lk_pisces .OR. lk_lobster )) &73 & CALL ctl_stop( ' The diurnal cycle is not compatible with PISCES or LOBSTER' )71 IF( ln_dm2dc .AND. lk_pisces ) & 72 & CALL ctl_stop( ' The diurnal cycle is not compatible with PISCES ' ) 74 73 75 74 IF( nn_cla == 1 ) & … … 101 100 areatot = glob_sum( cvol(:,:,:) ) 102 101 103 IF( lk_lobster ) CALL trc_ini_lobster ! LOBSTER bio-model104 102 IF( lk_pisces ) CALL trc_ini_pisces ! PISCES bio-model 105 103 IF( lk_cfc ) CALL trc_ini_cfc ! CFC tracers -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
r3319 r3680 21 21 USE trc ! passive tracers common variables 22 22 USE trcnam_trp ! Transport namelist 23 USE trcnam_lobster ! LOBSTER namelist24 23 USE trcnam_pisces ! PISCES namelist 25 24 USE trcnam_cfc ! CFC SMS namelist … … 53 52 !! ** Method : - read passive tracer namelist 54 53 !! - read namelist of each defined SMS model 55 !! ( ( LOBSTER,PISCES, CFC, MY_TRC )54 !! ( (PISCES, CFC, MY_TRC ) 56 55 !!--------------------------------------------------------------------- 57 56 INTEGER :: jn, ierr … … 60 59 !! 61 60 NAMELIST/namtrc/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, & 62 & cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta, ln_trcdmp 61 & cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta, ln_trcdmp, & 62 & ln_top_euler 63 63 #if defined key_trdmld_trc || defined key_trdtrc 64 64 NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & … … 79 79 nn_dttrc = 1 ! default values 80 80 nn_writetrc = 10 81 ln_top_euler = .FALSE. 81 82 ln_rsttr = .FALSE. 82 83 nn_rsttr = 0 … … 120 121 WRITE(numout,*) ' Read inputs data from file (y/n) ln_trcdta = ', ln_trcdta 121 122 WRITE(numout,*) ' Damping of passive tracer (y/n) ln_trcdmp = ', ln_trcdmp 123 WRITE(numout,*) ' Use euler integration for TRC (y/n) ln_top_euler = ', ln_top_euler 122 124 WRITE(numout,*) ' ' 123 125 DO jn = 1, jptra … … 234 236 ! namelist of SMS 235 237 ! --------------- 236 IF( lk_lobster ) THEN ; CALL trc_nam_lobster ! LOBSTER bio-model237 ELSE ; IF(lwp) WRITE(numout,*) ' LOBSTER not used'238 ENDIF239 240 238 IF( lk_pisces ) THEN ; CALL trc_nam_pisces ! PISCES bio-model 241 239 ELSE ; IF(lwp) WRITE(numout,*) ' PISCES not used' -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
r3294 r3680 27 27 USE trcnam_trp 28 28 USE iom 29 USE trcrst_cfc ! CFC30 USE trcrst_lobster ! LOBSTER restart31 USE trcrst_pisces ! PISCES restart32 USE trcrst_c14b ! C14 bomb restart33 USE trcrst_my_trc ! MY_TRC restart34 29 USE daymod 35 30 IMPLICIT NONE … … 40 35 PUBLIC trc_rst_wri ! called by ??? 41 36 PUBLIC trc_rst_cal 42 43 INTEGER, PUBLIC :: numrtr, numrtw !: logical unit for trc restart (read and write)44 37 45 38 !! * Substitutions … … 115 108 CALL iom_get( numrtr, jpdom_autoglo, 'TRB'//ctrcnm(jn), trb(:,:,:,jn) ) 116 109 END DO 117 118 IF( lk_lobster ) CALL trc_rst_read_lobster( numrtr ) ! LOBSTER bio-model119 IF( lk_pisces ) CALL trc_rst_read_pisces ( numrtr ) ! PISCES bio-model120 IF( lk_cfc ) CALL trc_rst_read_cfc ( numrtr ) ! CFC tracers121 IF( lk_c14b ) CALL trc_rst_read_c14b ( numrtr ) ! C14 bomb tracer122 IF( lk_my_trc ) CALL trc_rst_read_my_trc ( numrtr ) ! MY_TRC tracers123 124 CALL iom_close( numrtr )125 110 ! 126 111 END SUBROUTINE trc_rst_read … … 138 123 !!---------------------------------------------------------------------- 139 124 ! 140 CALL trc_rst_cal( kt, 'WRITE' ) ! calendar141 125 CALL iom_rstput( kt, nitrst, numrtw, 'rdttrc1', rdttrc(1) ) ! surface passive tracer time step 142 126 ! prognostic variables … … 149 133 CALL iom_rstput( kt, nitrst, numrtw, 'TRB'//ctrcnm(jn), trb(:,:,:,jn) ) 150 134 END DO 151 152 IF( lk_lobster ) CALL trc_rst_wri_lobster( kt, nitrst, numrtw ) ! LOBSTER bio-model 153 IF( lk_pisces ) CALL trc_rst_wri_pisces ( kt, nitrst, numrtw ) ! PISCES bio-model 154 IF( lk_cfc ) CALL trc_rst_wri_cfc ( kt, nitrst, numrtw ) ! CFC tracers 155 IF( lk_c14b ) CALL trc_rst_wri_c14b ( kt, nitrst, numrtw ) ! C14 bomb tracer 156 IF( lk_my_trc ) CALL trc_rst_wri_my_trc ( kt, nitrst, numrtw ) ! MY_TRC tracers 157 135 ! 158 136 IF( kt == nitrst ) THEN 159 137 CALL trc_rst_stat ! statistics -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/trcsms.F90
r3294 r3680 15 15 USE oce_trc ! 16 16 USE trc ! 17 USE trcsms_lobster ! LOBSTER bio-model18 17 USE trcsms_pisces ! PISCES biogeo-model 19 18 USE trcsms_cfc ! CFC 11 & 12 … … 49 48 IF( nn_timing == 1 ) CALL timing_start('trc_sms') 50 49 ! 51 IF( lk_lobster ) CALL trc_sms_lobster( kt ) ! main program of LOBSTER52 50 IF( lk_pisces ) CALL trc_sms_pisces ( kt ) ! main program of PISCES 53 51 IF( lk_cfc ) CALL trc_sms_cfc ( kt ) ! surface fluxes of CFC -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
r3319 r3680 78 78 ! 79 79 CALL trc_rst_opn ( kt ) ! Open tracer restart file 80 IF( lrst_trc ) CALL trc_rst_cal ( kt, 'WRITE' ) ! calendar 80 81 IF( lk_iomput ) THEN ; CALL trc_wri ( kt ) ! output of passive tracers with iom I/O manager 81 82 ELSE ; CALL trc_dia ( kt ) ! output of passive tracers with old I/O manager … … 83 84 CALL trc_sms ( kt ) ! tracers: sinks and sources 84 85 CALL trc_trp ( kt ) ! transport of passive tracers 86 IF( kt == nittrc000 ) CALL iom_close( numrtr ) ! close input tracer restart file 85 87 IF( lrst_trc ) CALL trc_rst_wri ( kt ) ! write tracer restart file 86 88 IF( lk_trdmld_trc ) CALL trd_mld_trc ( kt ) ! trends: Mixed-layer -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/trcsub.F90
r3625 r3680 29 29 USE sbc_oce ! surface boundary condition: ocean 30 30 USE bdy_oce 31 #if defined key_obc 32 USE obc_oce, ONLY: obctmsk 33 #endif 31 34 #if defined key_agrif 32 35 USE agrif_opa_update -
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/trcwri.F90
r3295 r3680 18 18 USE dianam ! Output file name 19 19 USE trcwri_pisces 20 USE trcwri_cfc 21 USE trcwri_c14b 22 USE trcwri_my_trc 20 23 21 24 IMPLICIT NONE … … 69 72 ! write the tracer concentrations in the file 70 73 ! --------------------------------------- 71 IF( lk_pisces ) THEN 72 CALL trc_wri_pisces 73 ELSE 74 DO jn = 1, jptra 75 cltra = TRIM( ctrcnm(jn) ) ! short title for tracer 76 CALL iom_put( cltra, trn(:,:,:,jn) ) 77 END DO 78 ENDIF 74 IF( lk_pisces ) CALL trc_wri_pisces ! PISCES 75 IF( lk_cfc ) CALL trc_wri_cfc ! surface fluxes of CFC 76 IF( lk_c14b ) CALL trc_wri_c14b ! surface fluxes of C14 77 IF( lk_my_trc ) CALL trc_wri_my_trc ! MY_TRC tracers 79 78 ! 80 79 END SUBROUTINE trc_wri_trc
Note: See TracChangeset
for help on using the changeset viewer.