Changeset 2622 for branches/dev_r2586_dynamic_mem/NEMOGCM
- Timestamp:
- 2011-02-27T11:51:17+01:00 (14 years ago)
- Location:
- branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/SOL/sol_oce.F90
r2590 r2622 4 4 !! Ocean solver : elliptic solver variables defined in memory 5 5 !!====================================================================== 6 !! History : 1.0 ! 02-11 (G. Madec) F90: Free form and module 6 !! History : 1.0 ! 2002-11 (G. Madec) F90: Free form and module 7 !! 4.0 ! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation 7 8 !!---------------------------------------------------------------------- 8 USE par_oce ! ocean parameters 9 10 !!---------------------------------------------------------------------- 11 !! sol_oce_alloc : allocate the solver arrays 12 !!---------------------------------------------------------------------- 13 USE par_oce ! ocean parameters 14 USE in_out_manager ! I/O manager 15 USE lib_mpp ! distributed memory computing 9 16 10 17 IMPLICIT NONE 11 18 PRIVATE 12 19 13 PUBLIC sol_oce_alloc ! routine called in nemogcm.F9020 PUBLIC sol_oce_alloc ! routine called in solver.F90 14 21 15 22 ! !!* Namelist namsol : elliptic solver * … … 54 61 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 55 62 !! $Id$ 56 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)63 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 57 64 !!---------------------------------------------------------------------- 58 65 CONTAINS 59 66 60 FUNCTION sol_oce_alloc() 61 USE in_out_manager, ONLY: ctl_warn 62 IMPLICIT none 63 INTEGER :: sol_oce_alloc 64 ! Local vars 67 INTEGER FUNCTION sol_oce_alloc() 68 !!---------------------------------------------------------------------- 69 !! *** FUNCTION sol_oce_alloc *** 70 !!---------------------------------------------------------------------- 65 71 INTEGER :: ierr(3) 72 !!---------------------------------------------------------------------- 73 ierr(:) = 0 74 ! 75 ALLOCATE( gcp (1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4) , & 76 & gcx (1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) , & 77 & gcxb(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) , STAT=ierr(1) ) 66 78 67 ierr(:) = 0 79 ALLOCATE( gcdprc(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) , & 80 & gcdmat(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) , & 81 & gcb (1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) , STAT=ierr(2) ) 68 82 69 ALLOCATE(gcp(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4), & 70 gcx(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj), & 71 gcxb(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj), Stat=ierr(1)) 83 ALLOCATE( gcr (1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) , & 84 & gcdes(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) , & 85 & gccd (1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) , & 86 #if defined key_agrif 87 & laplacu(jpi,jpj), laplacv(jpi,jpj), & 88 #endif 89 & STAT=ierr(3) ) 90 ! 91 sol_oce_alloc = MAXVAL(ierr) 92 ! 93 IF( lk_mpp ) CALL mpp_sum ( sol_oce_alloc ) 94 IF( sol_oce_alloc > 0 ) CALL ctl_warn('sol_oce_alloc: allocation of arrays failed') 95 ! 96 END FUNCTION sol_oce_alloc 72 97 73 ALLOCATE(gcdprc(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj),& 74 gcdmat(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj),& 75 gcb(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj), Stat=ierr(2)) 76 77 ALLOCATE(gcr(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj), & 78 gcdes(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj), & 79 gccd(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj), & 80 #if defined key_agrif 81 laplacu(jpi,jpj), laplacv(jpi,jpj), & 82 #endif 83 Stat=ierr(3)) 84 85 sol_oce_alloc = MAXVAL(ierr) 86 87 IF(sol_oce_alloc > 0)THEN 88 CALL ctl_warn('sol_oce_alloc: allocation of arrays failed.') 89 END IF 90 91 END FUNCTION sol_oce_alloc 92 98 !!====================================================================== 93 99 END MODULE sol_oce -
branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90
r2590 r2622 35 35 PRIVATE 36 36 37 PUBLIC sol_mat ! routine called by inisol.F90 38 PUBLIC sol_mat_alloc ! routine called by nemogcm.F90 39 40 ! Workspace array for sol_exd(). 41 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ztab 37 PUBLIC sol_mat ! routine called by inisol.F90 42 38 43 39 !!---------------------------------------------------------------------- 44 40 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 45 41 !! $Id$ 46 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 47 !!---------------------------------------------------------------------- 48 42 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 43 !!---------------------------------------------------------------------- 49 44 CONTAINS 50 51 FUNCTION sol_mat_alloc()52 !!----------------------------------------------------------------------53 !! *** ROUTINE sol_mat_alloc ***54 !!----------------------------------------------------------------------55 INTEGER :: sol_mat_alloc56 !!----------------------------------------------------------------------57 58 ALLOCATE(ztab(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4), &59 Stat=sol_mat_alloc)60 61 IF(sol_mat_alloc /= 0)THEN62 CALL ctl_warn('sol_mat_alloc: failed to allocate array.')63 END IF64 65 END FUNCTION sol_mat_alloc66 67 45 68 46 SUBROUTINE sol_mat( kt ) … … 341 319 !! 342 320 INTEGER :: ji, jk ! dummy loop indices 343 INTEGER :: iloc ! temporary integers 344 !!---------------------------------------------------------------------- 345 321 INTEGER :: iloc ! local integers 322 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ztab ! workspace allocated one for all 323 !!---------------------------------------------------------------------- 324 325 IF( .NOT. ALLOCATED( ztab ) ) THEN 326 ALLOCATE( ztab(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4), STAT=iloc ) 327 IF( lk_mpp ) CALL mpp_sum ( iloc ) 328 IF( iloc /= 0 ) CALL ctl_stop('STOP', 'sol_exd: failed to allocate array') 329 ENDIF 330 346 331 ztab = pt3d 347 332 -
branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/SOL/solver.F90
r2528 r2622 33 33 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 34 34 !! $Id$ 35 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)35 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 36 36 !!---------------------------------------------------------------------- 37 37 … … 80 80 eps = rn_eps 81 81 82 ! ! allocate solver arrays 83 IF( sol_oce_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'solver_init : unable to allocate sol_oce arrays' ) 84 82 85 SELECT CASE( nn_solv ) !* parameter check 83 86 ! -
branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r2621 r2622 479 479 #endif 480 480 481 USE sol_oce, ONLY: sol_oce_alloc482 USE solmat, ONLY: sol_mat_alloc483 481 USE traadv, ONLY: tra_adv_alloc 484 482 USE traadv_cen2, ONLY: tra_adv_cen2_alloc … … 562 560 #endif 563 561 564 ierr = ierr + sol_oce_alloc()565 ierr = ierr + sol_mat_alloc()566 562 ierr = ierr + tra_adv_alloc() 567 563 ierr = ierr + tra_adv_cen2_alloc()
Note: See TracChangeset
for help on using the changeset viewer.