Changeset 2335
- Timestamp:
- 2010-10-29T09:39:51+02:00 (13 years ago)
- Location:
- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/floblk.F90
r2287 r2335 8 8 !! 'key_floats' float trajectories 9 9 !!---------------------------------------------------------------------- 10 11 !!----------------------------------------------------------------------12 10 !! flotblk : compute float trajectories with Blanke algorithme 13 11 !!---------------------------------------------------------------------- 14 !! * Modules used15 12 USE flo_oce ! ocean drifting floats 16 13 USE oce ! ocean dynamics and tracers … … 23 20 PRIVATE 24 21 25 !! * Accessibility 26 PUBLIC flo_blk ! routine called by floats.F90 22 PUBLIC flo_blk ! routine called by floats.F90 27 23 28 24 !! * Substitutions … … 31 27 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 32 28 !! $Id$ 33 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 34 !!---------------------------------------------------------------------- 35 29 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 30 !!---------------------------------------------------------------------- 36 31 CONTAINS 37 32 … … 46 41 !! algorithm. We need to know the velocity field, the old positions 47 42 !! of the floats and the grid defined on the domain. 43 !!---------------------------------------------------------------------- 44 INTEGER, INTENT( in ) :: kt ! ocean time step 48 45 !! 49 !!----------------------------------------------------------------------50 !! * arguments51 INTEGER, INTENT( in ) :: kt ! ocean time step52 53 !! * Local declarations54 46 INTEGER :: jfl ! dummy loop arguments 55 47 INTEGER :: ind, ifin, iloop … … 78 70 zsurfz, & ! surface of the face of the mesh 79 71 zind 80 REAL(wp), DIMENSION ( 2 ) :: & 81 zsurfx, zsurfy ! surface of the face of the mesh 72 REAL(wp), DIMENSION ( 2 ) :: zsurfx, zsurfy ! surface of the face of the mesh 82 73 !!--------------------------------------------------------------------- 83 74 … … 111 102 iloop = 0 112 103 222 DO jfl = 1, jpnfl 113 # if defined key_mpp_mpi || defined key_mpp_shmem104 # if defined key_mpp_mpi 114 105 IF( (iil(jfl) >= (mig(nldi)-jpizoom+1)) .AND. (iil(jfl) <= (mig(nlei)-jpizoom+1)) .AND. & 115 106 (ijl(jfl) >= (mjg(nldj)-jpjzoom+1)) .AND. (ijl(jfl) <= (mjg(nlej)-jpjzoom+1)) ) THEN … … 327 318 ! reinitialisation of the age of FLOAT 328 319 zagefl(jfl) = zagenewfl(jfl) 329 # if defined key_mpp_mpi || defined key_mpp_shmem320 # if defined key_mpp_mpi 330 321 ELSE 331 322 ! we put zgifl, zgjfl, zgkfl, zagefl … … 413 404 GO TO 222 414 405 ENDIF 415 406 ! 416 407 END SUBROUTINE flo_blk 417 408 -
branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/flodom.F90
r2287 r2335 4 4 !! Ocean floats : domain 5 5 !!====================================================================== 6 !! History : OPA ! 1998-07 (Y.Drillet, CLIPPER) Original code 7 !!---------------------------------------------------------------------- 6 8 #if defined key_floats || defined key_esopa 7 9 !!---------------------------------------------------------------------- … … 12 14 !! dstnce : compute distance between face mesh and floats 13 15 !!---------------------------------------------------------------------- 14 !! * Modules used15 16 USE oce ! ocean dynamics and tracers 16 17 USE dom_oce ! ocean space and time domain … … 20 21 21 22 IMPLICIT NONE 22 23 !! * Accessibility 24 PRIVATE dstnce 25 PUBLIC flo_dom ! routine called by floats.F90 23 PRIVATE 24 25 PUBLIC flo_dom ! routine called by floats.F90 26 26 27 27 !! * Substitutions … … 30 30 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 31 31 !! $Id$ 32 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 33 !!---------------------------------------------------------------------- 34 32 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 33 !!---------------------------------------------------------------------- 35 34 CONTAINS 36 35 … … 42 41 !! 43 42 !! ** Method : We put the floats in the domain with the latitude, 44 !! the longitude (degree) and the depth (m). 45 !! 43 !! the longitude (degree) and the depth (m). 46 44 !!---------------------------------------------------------------------- 47 !! * Local declarations 48 LOGICAL :: llinmesh 49 INTEGER :: ji, jj, jk ! DO loop index on 3 directions 50 INTEGER :: jfl, jfl1 ! number of floats 51 INTEGER :: inum ! logical unit for file read 52 INTEGER, DIMENSION ( jpnfl ) :: & 53 iimfl, ijmfl, ikmfl, & ! index mesh of floats 54 idomfl, ivtest, ihtest 55 REAL(wp) :: zdxab, zdyad 56 REAL(wp), DIMENSION ( jpnnewflo+1 ) :: zgifl, zgjfl, zgkfl 45 LOGICAL :: llinmesh 46 INTEGER :: ji, jj, jk ! DO loop index on 3 directions 47 INTEGER :: jfl, jfl1 ! number of floats 48 INTEGER :: inum ! logical unit for file read 49 INTEGER, DIMENSION(jpnfl) :: iimfl, ijmfl, ikmfl ! index mesh of floats 50 INTEGER, DIMENSION(jpnfl) :: idomfl, ivtest, ihtest ! - - 51 REAL(wp) :: zdxab, zdyad 52 REAL(wp), DIMENSION(jpnnewflo+1) :: zgifl, zgjfl, zgkfl 57 53 !!--------------------------------------------------------------------- 58 54 … … 102 98 ivtest(jfl) = 0 103 99 ikmfl(jfl) = 0 104 # if defined key_mpp_mpi || defined key_mpp_shmem100 # if defined key_mpp_mpi 105 101 DO ji = MAX(nldi,2), nlei 106 102 DO jj = MAX(nldj,2), nlej ! NO vector opt. … … 139 135 140 136 ! A zero in the sum of the arrays "ihtest" and "ivtest" 141 # if defined key_mpp_mpi || defined key_mpp_shmem137 # if defined key_mpp_mpi 142 138 CALL mpp_sum(ihtest,jpnfl) 143 139 CALL mpp_sum(ivtest,jpnfl) … … 233 229 ivtest(jfl) = 0 234 230 ikmfl(jfl) = 0 235 # if defined key_mpp_mpi || defined key_mpp_shmem231 # if defined key_mpp_mpi 236 232 DO ji = MAX(nldi,2), nlei 237 233 DO jj = MAX(nldj,2), nlej ! NO vector opt. … … 357 353 !! 358 354 !! ** Method : 359 !!360 !! History :361 !! 8.0 ! 98-07 (Y.Drillet) Original code362 355 !!---------------------------------------------------------------------- 363 !! * Arguments364 356 REAL(wp) :: & 365 357 pax, pay, pbx, pby, & ! ??? … … 368 360 ptx, pty ! ??? 369 361 LOGICAL :: ldinmesh ! ??? 370 371 !! * local declarations 372 REAL(wp) :: & 373 zabt, zbct, zcdt, zdat, zabpt, zbcpt, zcdpt, zdapt, & 374 psax,psay,psbx,psby,psx,psy 375 REAL(wp) :: fsline ! Statement function 376 377 !! * Substitutions 378 fsline(psax, psay, psbx, psby, psx, psy) = psy * ( psbx - psax ) & 379 - psx * ( psby - psay ) & 380 + psax * psby - psay * psbx 362 !! 363 REAL(wp) :: zabt, zbct, zcdt, zdat, zabpt, zbcpt, zcdpt, zdapt 364 !!--------------------------------------------------------------------- 365 !! Statement function 366 REAL(wp) :: fsline 367 REAL(wp) :: psax, psay, psbx, psby, psx, psy 368 fsline( psax, psay, psbx, psby, psx, psy ) = psy * ( psbx - psax ) & 369 & - psx * ( psby - psay ) & 370 & + psax * psby - psay * psbx 381 371 !!--------------------------------------------------------------------- 382 372 … … 411 401 ldinmesh=.FALSE. 412 402 ENDIF 413 403 ! 414 404 END SUBROUTINE findmesh 415 405 … … 422 412 !! points 423 413 !! ** Method : 424 !!425 414 !!---------------------------------------------------------------------- 426 !! * Arguments427 415 REAL(wp), INTENT(in) :: pla1, phi1, pla2, phi2 ! ??? 428 429 !! * Local variables 416 !! 430 417 REAL(wp) :: dly1, dly2, dlx1, dlx2, dlx, dls, dld, dpi 431 418 REAL(wp) :: dstnce 432 419 !!--------------------------------------------------------------------- 433 420 ! 434 421 dpi = 2.* ASIN(1.) 435 422 dls = dpi / 180. … … 438 425 dlx1 = pla1 * dls 439 426 dlx2 = pla2 * dls 440 427 ! 441 428 dlx = SIN(dly1) * SIN(dly2) + COS(dly1) * COS(dly2) * COS(dlx2-dlx1) 442 429 ! 443 430 IF( ABS(dlx) > 1.0 ) dlx = 1.0 444 431 ! 445 432 dld = ATAN(DSQRT( ( 1-dlx )/( 1+dlx ) )) * 222.24 / dls 446 433 dstnce = dld * 1000. 447 434 ! 448 435 END FUNCTION dstnce 449 436 -
branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/FLO/flowri.F90
r2287 r2335 8 8 !! NEMO 1.0 ! 2002-11 (G. Madec, A. Bozec) F90: Free form and module 9 9 !!---------------------------------------------------------------------- 10 11 10 #if defined key_floats || defined key_esopa 12 11 !!---------------------------------------------------------------------- … … 34 33 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 35 34 !! $Id$ 36 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 37 !!---------------------------------------------------------------------- 38 35 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 36 !!---------------------------------------------------------------------- 39 37 CONTAINS 40 38 … … 52 50 CHARACTER (len=21) :: clname 53 51 INTEGER :: inum ! temporary logical unit for restart file 54 INTEGER :: iafl, ibfl, icfl, ia1fl, ib1fl, ic1fl, jfl, irecflo , &52 INTEGER :: iafl, ibfl, icfl, ia1fl, ib1fl, ic1fl, jfl, irecflo 55 53 INTEGER :: iafloc, ibfloc, ia1floc, ib1floc, iafln, ibfln 56 54 INTEGER :: ic, jc , jpn 57 INTEGER, DIMENSION ( jpnij ) :: iproc 58 59 REAL(wp) :: zafl,zbfl,zcfl,zdtj 60 REAL(wp) :: zxxu, zxxu_01,zxxu_10, zxxu_11 61 REAL(wp), DIMENSION (jpk,jpnfl) :: ztemp, zsal 55 INTEGER, DIMENSION ( jpnij ) :: iproc 56 REAL(wp) :: zafl,zbfl,zcfl,zdtj 57 REAL(wp) :: zxxu, zxxu_01,zxxu_10, zxxu_11 58 REAL(wp), DIMENSION (jpk,jpnfl) :: ztemp, zsal ! 2D workspace 62 59 !!--------------------------------------------------------------------- 63 60 … … 74 71 ! open the file numflo 75 72 CALL ctl_opn( numflo, 'trajec_float', 'REPLACE', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 76 ! REWIND numflo77 73 78 74 IF( kt == nit000 ) THEN … … 80 76 IF(lwp) WRITE(numflo)cexper,no,irecflo,jpnfl,nn_writefl 81 77 ENDIF 82 zdtj = rdt / 86400. !!bug use of 86400 instead of the phycst parameter78 zdtj = rdt / 86400._wp 83 79 84 80 ! translation of index position in geographical position … … 195 191 ! iafln=NINT(tpifl(jfl)) 196 192 ! ibfln=NINT(tpjfl(jfl)) 197 !# if defined key_mpp_mpi || defined key_mpp_shmem193 !# if defined key_mpp_mpi 198 194 ! IF ( (iafl >= (mig(nldi)-jpizoom+1)) .AND. 199 195 ! $ (iafl <= (mig(nlei)-jpizoom+1)) .AND. … … 214 210 ! ztemp(jfl)=tn(iafloc,ibfloc,jk) 215 211 ! zsal(jfl)=sn(iaflo!,ibfloc,jk) 216 !# if defined key_mpp_mpi || defined key_mpp_shmem212 !# if defined key_mpp_mpi 217 213 ! ELSE 218 214 ! ztemp(jfl) = 0. … … 298 294 299 295 IF( kt == nitend ) CLOSE( numflo ) 300 296 ! 301 297 END SUBROUTINE flo_wri 302 298 -
branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBC/obc_vectopt_loop_substitute.h90
r2287 r2335 5 5 !! to allow unrolling of do-loop using CPP macro. 6 6 !!---------------------------------------------------------------------- 7 !!---------------------------------------------------------------------- 8 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 9 !! $Id$ 10 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 11 !!---------------------------------------------------------------------- 12 #if defined key_vectopt_loop && defined key_obc && ! defined key_mpp_mpi && ! defined key_mpp_shmem 7 #if defined key_vectopt_loop && defined key_obc && ! defined key_mpp_mpi 13 8 # define fs_niw0 jpiwob 14 9 # define fs_niw1 jpiwob … … 29 24 # define fs_njs1 njs1 30 25 #endif 26 !!---------------------------------------------------------------------- 27 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 28 !! $Id$ 29 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 30 !!---------------------------------------------------------------------- -
branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBS/mpp_map.F90
r2287 r2335 4 4 !! NEMOVAR: MPP global grid point mapping to processors 5 5 !!====================================================================== 6 !! History : 2.0 ! 2007-08 (K. Mogensen) Original code 7 !!---------------------------------------------------------------------- 6 8 7 9 !!---------------------------------------------------------------------- 8 !! mppmap : Global array which maps i,j to area number. 9 !! mppmap_init : Initialize mppmap. 10 !! mppmap_init : Initialize mppmap. 10 11 !!---------------------------------------------------------------------- 11 !! * Modules used 12 USE par_kind, ONLY : & ! Precision variables 13 & wp 14 USE par_oce, ONLY : & ! Ocean parameters 15 & jpi, & 16 & jpj 17 USE dom_oce, ONLY : & ! Ocean space and time domain variables 18 & mig, & 19 & mjg, & 20 & nldi, & 21 & nlei, & 22 & nldj, & 23 & nlej, & 24 & narea 12 USE par_kind, ONLY : wp ! Precision variables 13 USE par_oce , ONLY : jpi, jpj ! Ocean parameters 14 USE dom_oce , ONLY : mig, mjg, nldi, nlei, nldj, nlej, narea ! Ocean space and time domain variables 25 15 #if defined key_mpp_mpi 26 USE lib_mpp, ONLY : & ! MPP library 27 & mpi_comm_opa 16 USE lib_mpp, ONLY : mpi_comm_opa ! MPP library 28 17 #endif 29 USE in_out_manager 18 USE in_out_manager ! I/O manager 30 19 31 20 IMPLICIT NONE 32 33 !! * Routine accessibility34 21 PRIVATE 35 22 36 PUBLIC & 37 & mppmap_init, & 38 & mppmap 23 PUBLIC :: mppmap_init, mppmap !: ??? 39 24 40 !! * Module variables 41 42 INTEGER, DIMENSION(:,:), ALLOCATABLE :: & 43 & mppmap 25 INTEGER, DIMENSION(:,:), ALLOCATABLE :: mppmap ! ??? 44 26 45 27 !!---------------------------------------------------------------------- 46 28 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 47 29 !! $Id$ 48 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)30 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 49 31 !!---------------------------------------------------------------------- 50 51 32 CONTAINS 52 33 … … 60 41 !! 61 42 !! ** Action : This does only work for MPI. 62 !! It does not work for SHMEM.63 43 !! 64 44 !! References : http://www.mpi-forum.org 65 !!66 !! History :67 !! ! 07-08 (K. Mogensen) Original code68 45 !!---------------------------------------------------------------------- 69 70 !! * Arguments 71 INTEGER, DIMENSION(:,:), ALLOCATABLE :: imppmap 46 INTEGER, DIMENSION(:,:), ALLOCATABLE :: imppmap ! 72 47 #if defined key_mpp_mpi 73 !! * Local declarations74 48 INTEGER :: ierr 75 49 INCLUDE 'mpif.h' 76 50 #endif 51 !!---------------------------------------------------------------------- 77 52 78 53 ALLOCATE( & … … 95 70 96 71 ! Call the MPI library to find the max across processors 97 98 CALL mpi_allreduce( imppmap, mppmap, jpiglo*jpjglo, mpi_integer, & 72 CALL mpi_allreduce( imppmap, mppmap, jpiglo*jpjglo, mpi_integer, & 99 73 & mpi_max, mpi_comm_opa, ierr ) 100 #elif defined key_mpp_shmem101 #error "Only MPI support for MPP in NEMOVAR"102 74 #else 103 75 104 ! Just copy the data 105 76 ! No MPP: Just copy the data 106 77 mppmap(:,:) = imppmap(:,:) 107 108 78 #endif 109 79 ! 110 80 END SUBROUTINE mppmap_init 111 81 82 !!====================================================================== 112 83 END MODULE mpp_map -
branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90
r2287 r2335 1 #if defined key_mpp_mpi2 #if defined key_sp3 #define mpivar mpi_real4 #else5 #define mpivar mpi_double_precision6 #endif7 #endif8 1 MODULE obs_mpp 9 2 !!====================================================================== … … 11 4 !! Observation diagnostics: Various MPP support routines 12 5 !!====================================================================== 13 6 !! History : 2.0 ! 2006-03 (K. Mogensen) Original code 7 !! - ! 2006-05 (K. Mogensen) Reformatted 8 !! - ! 2008-01 (K. Mogensen) add mpp_global_max 14 9 !!---------------------------------------------------------------------- 15 !! obs_mpp_bcast_integer : Broadcast an integer array from a processor 16 !! to all processors 17 !! obs_mpp_max_integer : Find maximum on all processors of each 18 !! value in an integer on all processors 10 #if defined key_mpp_mpi 11 # if defined key_sp 12 # define mpivar mpi_real 13 # else 14 # define mpivar mpi_double_precision 15 # endif 16 #endif 17 !!---------------------------------------------------------------------- 18 !! obs_mpp_bcast_integer : Broadcast an integer array from a processor to all processors 19 !! obs_mpp_max_integer : Find maximum on all processors of each value in an integer on all processors 19 20 !! obs_mpp_find_obs_proc : Find processors which should hold the observations 20 21 !! obs_mpp_sum_integers : Sum an integer array from all processors 21 22 !! obs_mpp_sum_integer : Sum an integer from all processors 22 23 !!---------------------------------------------------------------------- 23 !! * Modules used 24 USE dom_oce, ONLY : & ! Ocean space and time domain variables 25 & nproc, & 26 & mig,mjg 27 USE mpp_map, ONLY : & 28 & mppmap 24 USE dom_oce, ONLY : nproc, mig, mjg ! Ocean space and time domain variables 25 USE mpp_map, ONLY : mppmap 29 26 USE in_out_manager 30 27 #if defined key_mpp_mpi 31 USE lib_mpp, ONLY : & ! MPP library 32 & mpi_comm_opa 28 USE lib_mpp, ONLY : mpi_comm_opa ! MPP library 33 29 #endif 34 30 IMPLICIT NONE 35 36 !! * Routine accessibility37 31 PRIVATE 38 32 39 PUBLIC obs_mpp_bcast_integer, & ! Broadcast an integer array from a proc to all procs40 & obs_mpp_max_integer, & ! Find maximum across processors in an integer array41 & obs_mpp_find_obs_proc, & ! Find processors which should hold the observations42 & obs_mpp_sum_integers, & ! Sum an integer array from all processors43 & obs_mpp_sum_integer, & ! Sum an integer from all processors33 PUBLIC obs_mpp_bcast_integer, & !: Broadcast an integer array from a proc to all procs 34 & obs_mpp_max_integer, & !: Find maximum across processors in an integer array 35 & obs_mpp_find_obs_proc, & !: Find processors which should hold the observations 36 & obs_mpp_sum_integers, & !: Sum an integer array from all processors 37 & obs_mpp_sum_integer, & !: Sum an integer from all processors 44 38 & mpp_alltoall_int, & 45 39 & mpp_alltoallv_int, & … … 50 44 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 51 45 !! $Id$ 52 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)46 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 53 47 !!---------------------------------------------------------------------- 54 55 48 CONTAINS 56 49 57 SUBROUTINE obs_mpp_bcast_integer( kvals,kno,kroot)50 SUBROUTINE obs_mpp_bcast_integer( kvals, kno, kroot ) 58 51 !!---------------------------------------------------------------------- 59 52 !! *** ROUTINE obs_mpp_bcast_integer *** … … 64 57 !! 65 58 !! ** Action : This does only work for MPI. 66 !! It does not work for SHMEM.67 59 !! MPI_COMM_OPA needs to be replace for OASIS4.! 68 60 !! 69 61 !! References : http://www.mpi-forum.org 70 !! 71 !! History : 72 !! ! 06-03 (K. Mogensen) Original code 73 !! ! 06-05 (K. Mogensen) Reformatted 74 !!---------------------------------------------------------------------- 75 76 !! * Arguments 77 INTEGER, INTENT(IN) :: kno ! Number of elements in array 78 INTEGER, INTENT(IN) :: kroot ! Processor to send data 79 INTEGER, DIMENSION(kno), INTENT(INOUT) :: & 80 & kvals ! Array to send on kroot, receive for non-kroot 62 !!---------------------------------------------------------------------- 63 INTEGER , INTENT(in ) :: kno ! Number of elements in array 64 INTEGER , INTENT(in ) :: kroot ! Processor to send data 65 INTEGER, DIMENSION(kno), INTENT(inout) :: kvals ! Array to send on kroot, receive for non-kroot 66 !! 67 #if defined key_mpp_mpi 68 INTEGER :: ierr 69 INCLUDE 'mpif.h' 70 !!---------------------------------------------------------------------- 71 72 ! Call the MPI library to broadcast data 73 CALL mpi_bcast( kvals, kno, mpi_integer, & 74 & kroot, mpi_comm_opa, ierr ) 75 #else 76 ! no MPI: empty routine 77 #endif 78 ! 79 END SUBROUTINE obs_mpp_bcast_integer 80 81 81 82 #if defined key_mpp_mpi83 !! * Local declarations84 INTEGER :: ierr85 INCLUDE 'mpif.h'86 87 !-----------------------------------------------------------------------88 ! Call the MPI library to broadcast data89 !-----------------------------------------------------------------------90 CALL mpi_bcast( kvals, kno, mpi_integer, &91 & kroot, mpi_comm_opa, ierr )92 #elif defined key_mpp_shmem93 error "Only MPI support for MPP in NEMOVAR"94 #endif95 96 END SUBROUTINE obs_mpp_bcast_integer97 98 82 SUBROUTINE obs_mpp_max_integer( kvals, kno ) 99 83 !!---------------------------------------------------------------------- … … 109 93 !! 110 94 !! References : http://www.mpi-forum.org 111 !! 112 !! History : 113 !! ! 06-03 (K. Mogensen) Original code 114 !! ! 06-05 (K. Mogensen) Reformatted 115 !!---------------------------------------------------------------------- 116 117 !! * Arguments 118 INTEGER, INTENT(IN) ::kno ! Number of elements in array 119 INTEGER, DIMENSION(kno), INTENT(INOUT) :: & 120 & kvals ! Array to send on kroot, receive for non-kroot 121 122 #if defined key_mpp_mpi 123 !! * Local declarations 124 INTEGER :: ierr 125 INTEGER, DIMENSION(kno) :: & 126 & ivals 127 INCLUDE 'mpif.h' 128 129 !----------------------------------------------------------------------- 95 !!---------------------------------------------------------------------- 96 INTEGER , INTENT(in ) :: kno ! Number of elements in array 97 INTEGER, DIMENSION(kno), INTENT(inout) :: kvals ! Array to send on kroot, receive for non-kroot 98 !! 99 #if defined key_mpp_mpi 100 INTEGER :: ierr 101 INTEGER, DIMENSION(kno) :: ivals 102 INCLUDE 'mpif.h' 103 !!---------------------------------------------------------------------- 104 130 105 ! Call the MPI library to find the maximum across processors 131 !----------------------------------------------------------------------- 132 CALL mpi_allreduce( kvals, ivals, kno, mpi_integer, & 106 CALL mpi_allreduce( kvals, ivals, kno, mpi_integer, & 133 107 & mpi_max, mpi_comm_opa, ierr ) 134 108 kvals(:) = ivals(:) 135 #el if defined key_mpp_shmem136 error "Only MPI support for MPP in NEMOVAR" 109 #else 110 ! no MPI: empty routine 137 111 #endif 138 112 END SUBROUTINE obs_mpp_max_integer 139 113 140 SUBROUTINE obs_mpp_find_obs_proc(kobsp,kobsi,kobsj,kno) 114 115 SUBROUTINE obs_mpp_find_obs_proc( kobsp, kobsi, kobsj, kno ) 141 116 !!---------------------------------------------------------------------- 142 117 !! *** ROUTINE obs_mpp_find_obs_proc *** … … 155 130 !! 156 131 !! References : http://www.mpi-forum.org 157 !! 158 !! History : 159 !! ! 06-07 (K. Mogensen) Original code 160 !!---------------------------------------------------------------------- 161 162 !! * Arguments 163 INTEGER, INTENT(IN) :: kno 164 INTEGER, DIMENSION(kno), INTENT(IN) :: & 165 & kobsi, & 166 & kobsj 167 INTEGER, DIMENSION(kno), INTENT(INOUT) :: & 168 & kobsp 169 170 #if defined key_mpp_mpi 171 !! * Local declarations 132 !!---------------------------------------------------------------------- 133 INTEGER , INTENT(in ) :: kno 134 INTEGER, DIMENSION(kno), INTENT(in ) :: kobsi, kobsj 135 INTEGER, DIMENSION(kno), INTENT(inout) :: kobsp 136 !! 137 #if defined key_mpp_mpi 172 138 INTEGER :: ji 173 139 INTEGER :: jj … … 177 143 INTEGER :: iobsjp 178 144 INTEGER :: num_sus_obs 179 INTEGER, DIMENSION(kno) :: & 180 & iobsig, & 181 & iobsjg 182 INTEGER, ALLOCATABLE, DIMENSION(:,:) :: & 183 & iobsp, iobsi, iobsj 184 185 INCLUDE 'mpif.h' 145 INTEGER, DIMENSION(kno) :: iobsig, iobsjg 146 INTEGER, ALLOCATABLE, DIMENSION(:,:) :: iobsp, iobsi, iobsj 147 !! 148 INCLUDE 'mpif.h' 149 !!---------------------------------------------------------------------- 186 150 187 151 !----------------------------------------------------------------------- … … 258 222 DEALLOCATE( iobsi ) 259 223 DEALLOCATE( iobsp ) 260 #el if defined key_mpp_shmem261 error "Only MPI support for MPP in NEMOVAR" 262 #endif 263 224 #else 225 ! no MPI: empty routine 226 #endif 227 ! 264 228 END SUBROUTINE obs_mpp_find_obs_proc 265 229 230 266 231 SUBROUTINE obs_mpp_sum_integers( kvalsin, kvalsout, kno ) 267 232 !!---------------------------------------------------------------------- … … 276 241 !! 277 242 !! References : http://www.mpi-forum.org 278 !! 279 !! History : 280 !! ! 06-07 (K. Mogensen) Original code 281 !!---------------------------------------------------------------------- 282 283 !! * Arguments 284 INTEGER, INTENT(IN) :: kno 285 INTEGER, DIMENSION(kno), INTENT(IN) :: & 286 & kvalsin 287 INTEGER, DIMENSION(kno), INTENT(OUT) :: & 288 & kvalsout 289 290 #if defined key_mpp_mpi 291 !! * Local declarations 292 INTEGER :: ierr 293 INCLUDE 'mpif.h' 294 243 !!---------------------------------------------------------------------- 244 INTEGER , INTENT(in ) :: kno 245 INTEGER, DIMENSION(kno), INTENT(in ) :: kvalsin 246 INTEGER, DIMENSION(kno), INTENT( out) :: kvalsout 247 !! 248 #if defined key_mpp_mpi 249 INTEGER :: ierr 250 !! 251 INCLUDE 'mpif.h' 252 !!---------------------------------------------------------------------- 253 ! 295 254 !----------------------------------------------------------------------- 296 255 ! Call the MPI library to find the sum across processors … … 298 257 CALL mpi_allreduce( kvalsin, kvalsout, kno, mpi_integer, & 299 258 & mpi_sum, mpi_comm_opa, ierr ) 300 #elif defined key_mpp_shmem 301 error "Only MPI support for MPP in NEMOVAR" 302 #else 303 259 #else 304 260 !----------------------------------------------------------------------- 305 261 ! For no-MPP just return input values … … 307 263 kvalsout(:) = kvalsin(:) 308 264 #endif 309 265 ! 310 266 END SUBROUTINE obs_mpp_sum_integers 311 267 268 312 269 SUBROUTINE obs_mpp_sum_integer( kvalin, kvalout ) 313 270 !!---------------------------------------------------------------------- … … 322 279 !! 323 280 !! References : http://www.mpi-forum.org 324 !! 325 !! History : 326 !! ! 06-07 (K. Mogensen) Original code 327 !!---------------------------------------------------------------------- 328 329 !! * Arguments 330 INTEGER, INTENT(IN) :: kvalin 331 INTEGER, INTENT(OUT) :: kvalout 332 333 #if defined key_mpp_mpi 334 !! * Local declarations 335 INTEGER :: ierr 336 INCLUDE 'mpif.h' 337 281 !!---------------------------------------------------------------------- 282 INTEGER, INTENT(in ) :: kvalin 283 INTEGER, INTENT( out) :: kvalout 284 !! 285 #if defined key_mpp_mpi 286 INTEGER :: ierr 287 !! 288 INCLUDE 'mpif.h' 289 !!---------------------------------------------------------------------- 290 ! 338 291 !----------------------------------------------------------------------- 339 292 ! Call the MPI library to find the sum across processors 340 293 !----------------------------------------------------------------------- 341 CALL mpi_allreduce( kvalin, kvalout, 1, mpi_integer, &294 CALL mpi_allreduce( kvalin, kvalout, 1, mpi_integer, & 342 295 & mpi_sum, mpi_comm_opa, ierr ) 343 #elif defined key_mpp_shmem 344 error "Only MPI support for MPP in NEMOVAR" 345 #else 346 296 #else 347 297 !----------------------------------------------------------------------- 348 298 ! For no-MPP just return input values … … 350 300 kvalout = kvalin 351 301 #endif 302 ! 352 303 END SUBROUTINE obs_mpp_sum_integer 304 353 305 354 306 SUBROUTINE mpp_global_max( pval ) … … 365 317 !! 366 318 !! References : http://www.mpi-forum.org 367 !! 368 !! History : 369 !! ! 08-01 (K. Mogensen) Original code 370 !!---------------------------------------------------------------------- 371 372 !! * Arguments 373 REAL(KIND=wp), DIMENSION(jpiglo,jpjglo), INTENT(INOUT) :: & 374 & pval 375 !! * Local declarations 376 INTEGER :: ierr 377 #if defined key_mpp_mpi 378 INCLUDE 'mpif.h' 379 REAL(KIND=wp), DIMENSION(:,:), ALLOCATABLE :: & 380 & zcp 319 !!---------------------------------------------------------------------- 320 REAL(KIND=wp), DIMENSION(jpiglo,jpjglo), INTENT(inout) :: pval 321 !! 322 INTEGER :: ierr 323 #if defined key_mpp_mpi 324 INCLUDE 'mpif.h' 325 REAL(KIND=wp), DIMENSION(:,:), ALLOCATABLE :: zcp 326 !!---------------------------------------------------------------------- 381 327 382 328 ! Copy data for input to MPI … … 396 342 & ) 397 343 398 #el if defined key_mpp_shmem399 error "Only MPI support for MPP in NEMOVAR" 400 #endif 401 344 #else 345 ! no MPI: empty routine 346 #endif 347 ! 402 348 END SUBROUTINE mpp_global_max 403 349 350 404 351 SUBROUTINE mpp_alltoall_int( kno, kvalsin, kvalsout ) 405 352 !!---------------------------------------------------------------------- … … 414 361 !! 415 362 !! References : http://www.mpi-forum.org 416 !! 417 !! History : 418 !! ! 06-09 (K. Mogensen) Original code 419 !!---------------------------------------------------------------------- 420 421 !! * Arguments 422 INTEGER, INTENT(IN) :: kno 423 INTEGER, DIMENSION(kno*jpnij), INTENT(IN) :: & 424 & kvalsin 425 INTEGER, DIMENSION(kno*jpnij), INTENT(OUT) :: & 426 & kvalsout 427 !! * Local declarations 363 !!---------------------------------------------------------------------- 364 INTEGER , INTENT(in ) :: kno 365 INTEGER, DIMENSION(kno*jpnij), INTENT(in ) :: kvalsin 366 INTEGER, DIMENSION(kno*jpnij), INTENT( out) :: kvalsout 367 !! 428 368 INTEGER :: ierr 429 369 #if defined key_mpp_mpi … … 435 375 & kvalsout, kno, mpi_integer, & 436 376 & mpi_comm_opa, ierr ) 437 #elif defined key_mpp_shmem438 error "Only MPI support for MPP in NEMOVAR"439 377 #else 440 378 !----------------------------------------------------------------------- … … 443 381 kvalsout = kvalsin 444 382 #endif 445 383 ! 446 384 END SUBROUTINE mpp_alltoall_int 447 385 448 SUBROUTINE mpp_alltoallv_int( kvalsin, knoin, kinv, kvalsout, & 449 & knoout, koutv ) 386 387 SUBROUTINE mpp_alltoallv_int( kvalsin, knoin , kinv , kvalsout, & 388 & knoout, koutv ) 450 389 !!---------------------------------------------------------------------- 451 390 !! *** ROUTINE mpp_alltoallv_int *** … … 459 398 !! 460 399 !! References : http://www.mpi-forum.org 461 !! 462 !! History : 463 !! ! 06-09 (K. Mogensen) Original code 464 !!---------------------------------------------------------------------- 465 466 !! * Arguments 467 INTEGER, INTENT(IN) :: knoin 468 INTEGER, INTENT(IN) :: knoout 469 INTEGER, DIMENSION(jpnij) :: & 470 & kinv, & 471 & koutv 472 INTEGER, DIMENSION(knoin), INTENT(IN) :: & 473 & kvalsin 474 INTEGER, DIMENSION(knoout), INTENT(OUT) :: & 475 & kvalsout 476 !! * Local declarations 400 !!---------------------------------------------------------------------- 401 INTEGER , INTENT(in) :: knoin 402 INTEGER , INTENT(in) :: knoout 403 INTEGER, DIMENSION(jpnij) :: kinv, koutv 404 INTEGER, DIMENSION(knoin) , INTENT(in ) :: kvalsin 405 INTEGER, DIMENSION(knoout), INTENT( out) :: kvalsout 406 !! 477 407 INTEGER :: ierr 478 408 INTEGER :: jproc 479 409 #if defined key_mpp_mpi 480 410 INCLUDE 'mpif.h' 481 INTEGER, DIMENSION(jpnij) :: & 482 & irdsp, & 483 & isdsp 411 INTEGER, DIMENSION(jpnij) :: irdsp, isdsp 484 412 !----------------------------------------------------------------------- 485 413 ! Compute displacements … … 497 425 & kvalsout, koutv, irdsp, mpi_integer, & 498 426 & mpi_comm_opa, ierr ) 499 #elif defined key_mpp_shmem500 error "Only MPI support for MPP in NEMOVAR"501 427 #else 502 428 !----------------------------------------------------------------------- … … 505 431 kvalsout = kvalsin 506 432 #endif 507 433 ! 508 434 END SUBROUTINE mpp_alltoallv_int 509 435 510 SUBROUTINE mpp_alltoallv_real( pvalsin, knoin, kinv, pvalsout, & 511 & knoout, koutv ) 436 437 SUBROUTINE mpp_alltoallv_real( pvalsin, knoin , kinv , pvalsout, & 438 & knoout, koutv ) 512 439 !!---------------------------------------------------------------------- 513 440 !! *** ROUTINE mpp_alltoallv_real *** … … 521 448 !! 522 449 !! References : http://www.mpi-forum.org 523 !! 524 !! History : 525 !! ! 06-09 (K. Mogensen) Original code 526 !!---------------------------------------------------------------------- 527 528 !! * Arguments 529 INTEGER, INTENT(IN) :: knoin 530 INTEGER, INTENT(IN) :: knoout 531 INTEGER, DIMENSION(jpnij) :: & 532 & kinv, & 533 & koutv 534 REAL(KIND=wp), DIMENSION(knoin), INTENT(IN) :: & 535 & pvalsin 536 REAL(KIND=wp), DIMENSION(knoout), INTENT(OUT) :: & 537 & pvalsout 538 !! * Local declarations 450 !!---------------------------------------------------------------------- 451 INTEGER , INTENT(in ) :: knoin 452 INTEGER , INTENT(in ) :: knoout 453 INTEGER , DIMENSION(jpnij) :: kinv, koutv 454 REAL(wp), DIMENSION(knoin) , INTENT(in ) :: pvalsin 455 REAL(wp), DIMENSION(knoout), INTENT( out) :: pvalsout 456 !! 539 457 INTEGER :: ierr 540 458 INTEGER :: jproc 541 459 #if defined key_mpp_mpi 542 460 INCLUDE 'mpif.h' 543 INTEGER, DIMENSION(jpnij) :: &544 & irdsp, &545 & isdsp461 INTEGER, DIMENSION(jpnij) :: irdsp, isdsp 462 !!---------------------------------------------------------------------- 463 ! 546 464 !----------------------------------------------------------------------- 547 465 ! Compute displacements … … 559 477 & pvalsout, koutv, irdsp, mpivar, & 560 478 & mpi_comm_opa, ierr ) 561 #elif defined key_mpp_shmem562 error "Only MPI support for MPP in NEMOVAR"563 479 #else 564 480 !----------------------------------------------------------------------- … … 567 483 pvalsout = pvalsin 568 484 #endif 569 485 ! 570 486 END SUBROUTINE mpp_alltoallv_real 571 487 488 !!====================================================================== 572 489 END MODULE obs_mpp -
branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/lbclnk.F90
r2287 r2335 4 4 !! Ocean : lateral boundary conditions 5 5 !!===================================================================== 6 !! History : OPA ! 1997-06 (G. Madec) Original code 7 !! NEMO 1.0 ! 2002-09 (G. Madec) F90: Free form and module 8 !! 3.2 ! 2009-03 (R. Benshila) External north fold treatment 9 !!---------------------------------------------------------------------- 10 #if defined key_mpp_mpi 11 !!---------------------------------------------------------------------- 12 !! 'key_mpp_mpi' MPI massively parallel processing library 13 !!---------------------------------------------------------------------- 14 !! lbc_lnk : generic interface for mpp_lnk_3d and mpp_lnk_2d routines defined in lib_mpp 15 !! lbc_lnk_e : generic interface for mpp_lnk_2d_e routine defined in lib_mpp 16 !!---------------------------------------------------------------------- 17 USE lib_mpp ! distributed memory computing library 18 19 INTERFACE lbc_lnk 20 MODULE PROCEDURE mpp_lnk_3d_gather, mpp_lnk_3d, mpp_lnk_2d 21 END INTERFACE 22 23 INTERFACE lbc_lnk_e 24 MODULE PROCEDURE mpp_lnk_2d_e 25 END INTERFACE 26 27 PUBLIC lbc_lnk ! ocean lateral boundary conditions 28 PUBLIC lbc_lnk_e 29 30 !!---------------------------------------------------------------------- 6 31 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 7 32 !! $Id$ 8 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 9 !!---------------------------------------------------------------------- 10 #if defined key_mpp_mpi || defined key_mpp_shmem 11 !!---------------------------------------------------------------------- 12 !! 'key_mpp_mpi' OR MPI massively parallel processing library 13 !! 'key_mpp_shmem' SHMEM massively parallel processing library 14 !!---------------------------------------------------------------------- 15 !!---------------------------------------------------------------------- 16 !! lbc_lnk : generic interface for mpp_lnk_3d and mpp_lnk_2d 17 !! routines defined in lib_mpp 18 !! lbc_lnk_e : generic interface for mpp_lnk_2d_e 19 !! routinee defined in lib_mpp 20 !!---------------------------------------------------------------------- 21 !! * Modules used 22 USE lib_mpp ! distributed memory computing library 23 24 INTERFACE lbc_lnk 25 MODULE PROCEDURE mpp_lnk_3d_gather, mpp_lnk_3d, mpp_lnk_2d 26 END INTERFACE 27 28 INTERFACE lbc_lnk_e 29 MODULE PROCEDURE mpp_lnk_2d_e 30 END INTERFACE 31 32 PUBLIC lbc_lnk ! ocean lateral boundary conditions 33 PUBLIC lbc_lnk_e 33 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 34 34 !!---------------------------------------------------------------------- 35 35 … … 39 39 !!---------------------------------------------------------------------- 40 40 !! lbc_lnk : generic interface for lbc_lnk_3d and lbc_lnk_2d 41 !! lbc_lnk_3d : set the lateral boundary condition on a 3D variable 42 !! on OPA ocean mesh 43 !! lbc_lnk_2d : set the lateral boundary condition on a 2D variable 44 !! on OPA ocean mesh 45 !!---------------------------------------------------------------------- 46 !! * Modules used 41 !! lbc_lnk_3d : set the lateral boundary condition on a 3D variable on ocean mesh 42 !! lbc_lnk_2d : set the lateral boundary condition on a 2D variable on ocean mesh 43 !!---------------------------------------------------------------------- 47 44 USE oce ! ocean dynamics and tracers 48 45 USE dom_oce ! ocean space and time domain … … 61 58 END INTERFACE 62 59 63 PUBLIC lbc_lnk ! ocean/ice lateral boundary conditions 64 PUBLIC lbc_lnk_e 65 !!---------------------------------------------------------------------- 66 60 PUBLIC lbc_lnk ! ocean/ice lateral boundary conditions 61 PUBLIC lbc_lnk_e 62 63 !!---------------------------------------------------------------------- 64 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 65 !! $Id$ 66 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 67 !!---------------------------------------------------------------------- 67 68 CONTAINS 68 69 … … 71 72 !! *** ROUTINE lbc_lnk_3d_gather *** 72 73 !! 73 !! ** Purpose : set lateral boundary conditions (non mpp case) 74 !! 75 !! ** Method : 76 !! 77 !! History : 78 !! ! 97-06 (G. Madec) Original code 79 !! 8.5 ! 02-09 (G. Madec) F90: Free form and module 80 !! ! 09-03 (R. Benshila) External north fold treatment 81 !!---------------------------------------------------------------------- 82 !! * Arguments 83 CHARACTER(len=1), INTENT( in ) :: & 84 cd_type1, cd_type2 ! nature of pt3d grid-points 85 ! ! = T , U , V , F or W gridpoints 86 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) :: & 87 pt3d1, pt3d2 ! 3D array on which the boundary condition is applied 88 REAL(wp), INTENT( in ) :: & 89 psgn ! control of the sign change 90 ! ! =-1 , the sign is changed if north fold boundary 91 ! ! = 1 , no sign change 92 ! ! = 0 , no sign change and > 0 required (use the inner 93 ! ! row/column if closed boundary) 94 74 !! ** Purpose : set lateral boundary conditions on two 3D arrays (non mpp case) 75 !! 76 !! ** Method : psign = -1 : change the sign across the north fold 77 !! = 1 : no change of the sign across the north fold 78 !! = 0 : no change of the sign across the north fold and 79 !! strict positivity preserved: use inner row/column 80 !! for closed boundaries. 81 !!---------------------------------------------------------------------- 82 CHARACTER(len=1) , INTENT(in ) :: cd_type1, cd_type2 ! nature of pt3d grid-points 83 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt3d1 , pt3d2 ! 3D array on which the lbc is applied 84 REAL(wp) , INTENT(in ) :: psgn ! control of the sign 85 !!---------------------------------------------------------------------- 86 ! 95 87 CALL lbc_lnk_3d( pt3d1, cd_type1, psgn) 96 88 CALL lbc_lnk_3d( pt3d2, cd_type2, psgn) 97 89 ! 98 90 END SUBROUTINE lbc_lnk_3d_gather 99 91 … … 103 95 !! *** ROUTINE lbc_lnk_3d *** 104 96 !! 105 !! ** Purpose : set lateral boundary conditions (non mpp case) 106 !! 107 !! ** Method : 108 !! 109 !! History : 110 !! ! 97-06 (G. Madec) Original code 111 !! 8.5 ! 02-09 (G. Madec) F90: Free form and module 112 !! ! 09-03 (R. Benshila) External north fold treatment 113 !!---------------------------------------------------------------------- 114 !! * Arguments 115 CHARACTER(len=1), INTENT( in ) :: & 116 cd_type ! nature of pt3d grid-points 117 ! ! = T , U , V , F or W gridpoints 118 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) :: & 119 pt3d ! 3D array on which the boundary condition is applied 120 REAL(wp), INTENT( in ) :: & 121 psgn ! control of the sign change 122 ! ! =-1 , the sign is changed if north fold boundary 123 ! ! = 1 , no sign change 124 ! ! = 0 , no sign change and > 0 required (use the inner 125 ! ! row/column if closed boundary) 126 CHARACTER(len=3), INTENT( in ), OPTIONAL :: & 127 cd_mpp ! fill the overlap area only (here do nothing) 128 REAL(wp) , INTENT(in ), OPTIONAL :: pval ! background value (used at closed boundaries) 129 130 !! * Local declarations 97 !! ** Purpose : set lateral boundary conditions on a 3D array (non mpp case) 98 !! 99 !! ** Method : psign = -1 : change the sign across the north fold 100 !! = 1 : no change of the sign across the north fold 101 !! = 0 : no change of the sign across the north fold and 102 !! strict positivity preserved: use inner row/column 103 !! for closed boundaries. 104 !!---------------------------------------------------------------------- 105 CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points 106 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt3d ! 3D array on which the lbc is applied 107 REAL(wp) , INTENT(in ) :: psgn ! control of the sign 108 CHARACTER(len=3) , INTENT(in ), OPTIONAL :: cd_mpp ! MPP only (here do nothing) 109 REAL(wp) , INTENT(in ), OPTIONAL :: pval ! background value (for closed boundaries) 110 !! 131 111 REAL(wp) :: zland 132 133 IF( PRESENT( pval ) ) THEN ! set land value (zero by default) 134 zland = pval 135 ELSE 136 zland = 0.e0 112 !!---------------------------------------------------------------------- 113 114 IF( PRESENT( pval ) ) THEN ; zland = pval ! set land value (zero by default) 115 ELSE ; zland = 0.e0 137 116 ENDIF 138 117 … … 142 121 ! this is in mpp case. In this module, just do nothing 143 122 ELSE 144 123 ! 145 124 ! ! East-West boundaries 146 125 ! ! ====================== … … 161 140 ! 162 141 END SELECT 163 142 ! 164 143 ! ! North-South boundaries 165 144 ! ! ====================== … … 196 175 ! 197 176 END SELECT 198 199 ENDIF 200 177 ! 178 ENDIF 179 ! 201 180 END SUBROUTINE lbc_lnk_3d 202 181 … … 206 185 !! *** ROUTINE lbc_lnk_2d *** 207 186 !! 208 !! ** Purpose : set lateral boundary conditions (non mpp case) 209 !! 210 !! ** Method : 211 !! 212 !! History : 213 !! ! 97-06 (G. Madec) Original code 214 !! ! 01-05 (E. Durand) correction 215 !! 8.5 ! 02-09 (G. Madec) F90: Free form and module 216 !! ! 09-03 (R. Benshila) External north fold treatment 217 !!---------------------------------------------------------------------- 218 !! * Arguments 219 CHARACTER(len=1), INTENT( in ) :: & 220 cd_type ! nature of pt2d grid-point 221 ! ! = T , U , V , F or W gridpoints 222 ! ! = I sea-ice U-V gridpoint (= F ocean grid point with indice shift) 223 REAL(wp), INTENT( in ) :: & 224 psgn ! control of the sign change 225 ! ! =-1 , the sign is modified following the type of b.c. used 226 ! ! = 1 , no sign change 227 REAL(wp), DIMENSION(jpi,jpj), INTENT( inout ) :: & 228 pt2d ! 2D array on which the boundary condition is applied 229 CHARACTER(len=3), INTENT( in ), OPTIONAL :: & 230 cd_mpp ! fill the overlap area only (here do nothing) 231 REAL(wp) , INTENT(in ), OPTIONAL :: pval ! background value (used at closed boundaries) 232 233 !! * Local declarations 187 !! ** Purpose : set lateral boundary conditions on a 2D array (non mpp case) 188 !! 189 !! ** Method : psign = -1 : change the sign across the north fold 190 !! = 1 : no change of the sign across the north fold 191 !! = 0 : no change of the sign across the north fold and 192 !! strict positivity preserved: use inner row/column 193 !! for closed boundaries. 194 !!---------------------------------------------------------------------- 195 CHARACTER(len=1) , INTENT(in ) :: cd_type ! nature of pt3d grid-points 196 REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pt3d ! 2D array on which the lbc is applied 197 REAL(wp) , INTENT(in ) :: psgn ! control of the sign 198 CHARACTER(len=3) , INTENT(in ), OPTIONAL :: cd_mpp ! MPP only (here do nothing) 199 REAL(wp) , INTENT(in ), OPTIONAL :: pval ! background value (for closed boundaries) 200 !! 234 201 REAL(wp) :: zland 235 236 IF( PRESENT( pval ) ) THEN ! set land value (zero by default) 237 zland = pval 238 ELSE 239 zland = 0.e0 202 !!---------------------------------------------------------------------- 203 204 IF( PRESENT( pval ) ) THEN ; zland = pval ! set land value (zero by default) 205 ELSE ; zland = 0.e0 240 206 ENDIF 241 207 … … 244 210 ! this is in mpp case. In this module, just do nothing 245 211 ELSE 246 212 ! 247 213 ! ! East-West boundaries 248 214 ! ! ==================== … … 263 229 ! 264 230 END SELECT 265 231 ! 266 232 ! ! North-South boundaries 267 233 ! ! ====================== … … 299 265 ! 300 266 END SELECT 301 302 ENDIF 303 267 ! 268 ENDIF 269 ! 304 270 END SUBROUTINE lbc_lnk_2d 305 271
Note: See TracChangeset
for help on using the changeset viewer.