[3] | 1 | MODULE solver |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE solver *** |
---|
| 4 | !! Ocean solver : initialization of ocean solver |
---|
| 5 | !!===================================================================== |
---|
[1601] | 6 | !! History : OPA ! 1990-10 (G. Madec) Original code |
---|
| 7 | !! ! 1993-02 (O. Marti) |
---|
| 8 | !! ! 1997-02 (G. Madec) local depth inverse computation |
---|
| 9 | !! ! 1998-10 (G. Roullet, G. Madec) free surface |
---|
| 10 | !! NEMO 1.0 ! 2003-07 (G. Madec) free form, F90 |
---|
| 11 | !! 3.2 ! 2009-07 (R. Benshila) suppression of rigid-lid & FETI solver |
---|
[3] | 12 | !!---------------------------------------------------------------------- |
---|
[1601] | 13 | #if defined key_dynspg_flt || defined key_esopa |
---|
| 14 | !!---------------------------------------------------------------------- |
---|
| 15 | !! 'key_dynspg_flt' filtered free surface |
---|
| 16 | !!---------------------------------------------------------------------- |
---|
[3] | 17 | !! solver_init: solver initialization |
---|
| 18 | !!---------------------------------------------------------------------- |
---|
| 19 | USE oce ! ocean dynamics and tracers variables |
---|
| 20 | USE dom_oce ! ocean space and time domain variables |
---|
| 21 | USE zdf_oce ! ocean vertical physics variables |
---|
| 22 | USE sol_oce ! solver variables |
---|
[1601] | 23 | USE dynspg_oce ! choice/control of key cpp for surface pressure gradient |
---|
| 24 | USE solmat ! matrix of the solver |
---|
[3] | 25 | USE obc_oce ! Lateral open boundary condition |
---|
| 26 | USE in_out_manager ! I/O manager |
---|
| 27 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
[16] | 28 | USE lib_mpp |
---|
[3] | 29 | |
---|
| 30 | IMPLICIT NONE |
---|
| 31 | |
---|
| 32 | !!---------------------------------------------------------------------- |
---|
[1601] | 33 | !! NEMO/OPA 9.0 , LOCEAN-IPSL (2009) |
---|
[1152] | 34 | !! $Id$ |
---|
[2208] | 35 | !! Software governed by the CeCILL licence (NEMOGCM/License_CeCILL.txt) |
---|
[3] | 36 | !!---------------------------------------------------------------------- |
---|
| 37 | |
---|
| 38 | CONTAINS |
---|
| 39 | |
---|
[413] | 40 | SUBROUTINE solver_init( kt ) |
---|
[3] | 41 | !!---------------------------------------------------------------------- |
---|
| 42 | !! *** ROUTINE solver_init *** |
---|
| 43 | !! |
---|
[1601] | 44 | !! ** Purpose : Initialization of the elliptic solver |
---|
[3] | 45 | !! |
---|
[1601] | 46 | !! ** Method : a solver is required when using the filtered free |
---|
| 47 | !! surface. |
---|
[3] | 48 | !! |
---|
[1601] | 49 | !! ** Action : - c_solver_pt : nature of the gridpoint at which the solver is applied |
---|
[3] | 50 | !! |
---|
[1601] | 51 | !! References : Jensen, 1986: Adv. Phys. Oceanogr. Num. Mod.,Ed. O Brien,87-110. |
---|
[3] | 52 | !!---------------------------------------------------------------------- |
---|
[413] | 53 | INTEGER, INTENT(in) :: kt |
---|
[1601] | 54 | !! |
---|
| 55 | NAMELIST/namsol/ nn_solv, nn_sol_arp, nn_nmin, nn_nmax, nn_nmod, rn_eps, rn_resmax, rn_sor |
---|
[3] | 56 | !!---------------------------------------------------------------------- |
---|
| 57 | |
---|
[1601] | 58 | IF(lwp) THEN !* open elliptic solver statistics file (only on the printing processors) |
---|
[1581] | 59 | CALL ctl_opn( numsol, 'solver.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) |
---|
| 60 | ENDIF |
---|
[3] | 61 | |
---|
[1601] | 62 | REWIND( numnam ) !* Namelist namsol : elliptic solver / free surface |
---|
[3] | 63 | READ ( numnam, namsol ) |
---|
| 64 | |
---|
[1601] | 65 | IF(lwp) THEN !* Control print |
---|
[3] | 66 | WRITE(numout,*) |
---|
[1601] | 67 | WRITE(numout,*) 'solver_init : solver to compute the surface pressure gradient' |
---|
| 68 | WRITE(numout,*) '~~~~~~~~~~~' |
---|
| 69 | WRITE(numout,*) ' Namelist namsol : set solver parameters' |
---|
| 70 | WRITE(numout,*) ' type of elliptic solver nn_solv = ', nn_solv |
---|
| 71 | WRITE(numout,*) ' absolute/relative (0/1) precision nn_sol_arp = ', nn_sol_arp |
---|
| 72 | WRITE(numout,*) ' minimum iterations for solver nn_nmin = ', nn_nmin |
---|
| 73 | WRITE(numout,*) ' maximum iterations for solver nn_nmax = ', nn_nmax |
---|
| 74 | WRITE(numout,*) ' frequency for test nn_nmod = ', nn_nmod |
---|
| 75 | WRITE(numout,*) ' absolute precision of solver rn_eps = ', rn_eps |
---|
| 76 | WRITE(numout,*) ' absolute precision for SOR solver rn_resmax = ', rn_resmax |
---|
| 77 | WRITE(numout,*) ' optimal coefficient of sor rn_sor = ', rn_sor |
---|
| 78 | WRITE(numout,*) |
---|
[3] | 79 | ENDIF |
---|
[1601] | 80 | eps = rn_eps |
---|
[3] | 81 | |
---|
[1601] | 82 | SELECT CASE( nn_solv ) !* parameter check |
---|
| 83 | ! |
---|
| 84 | CASE ( 1 ) ! preconditioned conjugate gradient solver |
---|
| 85 | IF(lwp) WRITE(numout,*) ' a preconditioned conjugate gradient solver is used' |
---|
| 86 | IF( jpr2di /= 0 .AND. jpr2dj /= 0 ) CALL ctl_stop( ' jpr2di and jpr2dj should be equal to zero' ) |
---|
| 87 | ! |
---|
| 88 | CASE ( 2 ) ! successive-over-relaxation solver |
---|
| 89 | IF(lwp) WRITE(numout,*) ' a successive-over-relaxation solver with extra outer halo is used' |
---|
| 90 | IF(lwp) WRITE(numout,*) ' with jpr2di =', jpr2di, ' and jpr2dj =', jpr2dj |
---|
[784] | 91 | IF( .NOT. lk_mpp .AND. jpr2di /= 0 .AND. jpr2dj /= 0 ) THEN |
---|
[1601] | 92 | CALL ctl_stop( 'jpr2di and jpr2dj are not equal to zero', & |
---|
| 93 | & 'In this case the algorithm should be used only with the key_mpp_... option' ) |
---|
[784] | 94 | ELSE |
---|
| 95 | IF( ( ( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 ) .OR. ( jpni /= 1 ) ) & |
---|
[1601] | 96 | & .AND. ( jpr2di /= jpr2dj ) ) CALL ctl_stop( 'jpr2di should be equal to jpr2dj' ) |
---|
[784] | 97 | ENDIF |
---|
[1601] | 98 | ! |
---|
| 99 | CASE DEFAULT ! error in parameter |
---|
| 100 | WRITE(ctmp1,*) ' bad flag value for nn_solv = ', nn_solv |
---|
[474] | 101 | CALL ctl_stop( ctmp1 ) |
---|
[3] | 102 | END SELECT |
---|
[1601] | 103 | ! |
---|
| 104 | IF( nbit_cmp == 1 ) THEN ! reproductibility test SOR required |
---|
| 105 | IF( nn_solv /= 2 ) THEN |
---|
| 106 | CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require the SOR solver: nn_solv = 2' ) |
---|
[784] | 107 | ELSE IF( MAX( jpr2di, jpr2dj ) > 0 ) THEN |
---|
| 108 | CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require jpr2di = jpr2dj = 0' ) |
---|
| 109 | END IF |
---|
[531] | 110 | END IF |
---|
| 111 | |
---|
[1601] | 112 | ! !* Grid-point at which the solver is applied |
---|
| 113 | !!gm c_solver_pt should be removed: nomore bsf, only T-point is used |
---|
| 114 | IF( lk_mpp ) THEN ; c_solver_pt = 'S' ! S=T with special staff ??? which one? |
---|
| 115 | ELSE ; c_solver_pt = 'T' |
---|
[16] | 116 | ENDIF |
---|
| 117 | |
---|
[1601] | 118 | CALL sol_mat( kt ) !* Construction of the elliptic system matrix |
---|
[1556] | 119 | ! |
---|
[3] | 120 | END SUBROUTINE solver_init |
---|
[1601] | 121 | #endif |
---|
[3] | 122 | |
---|
| 123 | !!====================================================================== |
---|
| 124 | END MODULE solver |
---|