New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 1601 for trunk/NEMO/OPA_SRC/eosbn2.F90 – NEMO

Ignore:
Timestamp:
2009-08-11T12:09:19+02:00 (15 years ago)
Author:
ctlod
Message:

Doctor naming of OPA namelist variables , see ticket: #526

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/eosbn2.F90

    r1559 r1601  
    99   !!            6.0  ! 1994-08  (G. Madec)  Add Jackett & McDougall eos 
    1010   !!            7.0  ! 1996-01  (G. Madec)  statement function for e3 
    11    !!            8.1  ! 1997-07  (G. Madec)  introduction of neos, OPA8.1 
    1211   !!            8.1  ! 1997-07  (G. Madec)  density instead of volumic mass 
    1312   !!             -   ! 1999-02  (G. Madec, N. Grima) semi-implicit pressure gradient 
     
    5150   PUBLIC   tfreez     ! called by sbcice_... modules 
    5251 
    53    !                                      !!* Namelist (nameos) * 
    54    INTEGER , PUBLIC ::   neos   = 0        !: = 0/1/2 type of eq. of state and Brunt-Vaisala frequ. 
    55    REAL(wp), PUBLIC ::   ralpha = 2.0e-4   !: thermal expension coeff. (linear equation of state) 
    56    REAL(wp), PUBLIC ::   rbeta  = 7.7e-4   !: saline  expension coeff. (linear equation of state) 
     52   !                                        !!* Namelist (nameos) * 
     53   INTEGER , PUBLIC ::   nn_eos   = 0        !: = 0/1/2 type of eq. of state and Brunt-Vaisala frequ. 
     54   REAL(wp), PUBLIC ::   rn_alpha = 2.0e-4   !: thermal expension coeff. (linear equation of state) 
     55   REAL(wp), PUBLIC ::   rn_beta  = 7.7e-4   !: saline  expension coeff. (linear equation of state) 
     56 
    5757   REAL(wp), PUBLIC ::   ralpbet           !: alpha / beta ratio 
    5858    
     
    7474      !! ** Purpose :   Compute the in situ density (ratio rho/rau0) from  
    7575      !!       potential temperature and salinity using an equation of state 
    76       !!       defined through the namelist parameter neos. 
     76      !!       defined through the namelist parameter nn_eos. 
    7777      !! 
    7878      !! ** Method  :   3 cases: 
    79       !!      neos = 0 : Jackett and McDougall (1994) equation of state. 
     79      !!      nn_eos = 0 : Jackett and McDougall (1994) equation of state. 
    8080      !!         the in situ density is computed directly as a function of 
    8181      !!         potential temperature relative to the surface (the opa t 
     
    9292      !!         Check value: rho = 1060.93298 kg/m**3 for p=10000 dbar, 
    9393      !!          t = 40 deg celcius, s=40 psu 
    94       !!      neos = 1 : linear equation of state function of temperature only 
    95       !!              prd(t) = 0.0285 - ralpha * t 
    96       !!      neos = 2 : linear equation of state function of temperature and 
     94      !!      nn_eos = 1 : linear equation of state function of temperature only 
     95      !!              prd(t) = 0.0285 - rn_alpha * t 
     96      !!      nn_eos = 2 : linear equation of state function of temperature and 
    9797      !!               salinity 
    98       !!              prd(t,s) = rbeta * s - ralpha * tn - 1. 
     98      !!              prd(t,s) = rn_beta * s - rn_alpha * tn - 1. 
    9999      !!      Note that no boundary condition problem occurs in this routine 
    100100      !!      as (ptem,psal) are defined over the whole domain. 
     
    118118      !!---------------------------------------------------------------------- 
    119119 
    120       SELECT CASE( neos ) 
     120      SELECT CASE( nn_eos ) 
    121121      ! 
    122122      CASE( 0 )                !==  Jackett and McDougall (1994) formulation  ==! 
     
    169169      CASE( 1 )                !==  Linear formulation function of temperature only  ==! 
    170170         DO jk = 1, jpkm1 
    171             prd(:,:,jk) = ( 0.0285 - ralpha * ptem(:,:,jk) ) * tmask(:,:,jk) 
     171            prd(:,:,jk) = ( 0.0285 - rn_alpha * ptem(:,:,jk) ) * tmask(:,:,jk) 
    172172         END DO 
    173173         ! 
    174174      CASE( 2 )                !==  Linear formulation function of temperature and salinity  ==! 
    175175         DO jk = 1, jpkm1 
    176             prd(:,:,jk) = ( rbeta  * psal(:,:,jk) - ralpha * ptem(:,:,jk) ) * tmask(:,:,jk) 
    177          END DO 
    178          ! 
    179       CASE DEFAULT 
    180          WRITE(ctmp1,*) '          bad flag value for neos = ', neos 
    181          CALL ctl_stop( ctmp1 ) 
     176            prd(:,:,jk) = ( rn_beta  * psal(:,:,jk) - rn_alpha * ptem(:,:,jk) ) * tmask(:,:,jk) 
     177         END DO 
    182178         ! 
    183179      END SELECT 
     
    195191      !!      potential volumic mass (Kg/m3) from potential temperature and 
    196192      !!      salinity fields using an equation of state defined through the  
    197       !!     namelist parameter neos. 
     193      !!     namelist parameter nn_eos. 
    198194      !! 
    199195      !! ** Method  : 
    200       !!      neos = 0 : Jackett and McDougall (1994) equation of state. 
     196      !!      nn_eos = 0 : Jackett and McDougall (1994) equation of state. 
    201197      !!         the in situ density is computed directly as a function of 
    202198      !!         potential temperature relative to the surface (the opa t 
     
    216212      !!          t = 40 deg celcius, s=40 psu 
    217213      !! 
    218       !!      neos = 1 : linear equation of state function of temperature only 
    219       !!              prd(t) = ( rho(t) - rau0 ) / rau0 = 0.028 - ralpha * t 
     214      !!      nn_eos = 1 : linear equation of state function of temperature only 
     215      !!              prd(t) = ( rho(t) - rau0 ) / rau0 = 0.028 - rn_alpha * t 
    220216      !!              rhop(t,s)  = rho(t,s) 
    221217      !! 
    222       !!      neos = 2 : linear equation of state function of temperature and 
     218      !!      nn_eos = 2 : linear equation of state function of temperature and 
    223219      !!               salinity 
    224220      !!              prd(t,s) = ( rho(t,s) - rau0 ) / rau0  
    225       !!                       = rbeta * s - ralpha * tn - 1. 
     221      !!                       = rn_beta * s - rn_alpha * tn - 1. 
    226222      !!              rhop(t,s)  = rho(t,s) 
    227223      !!      Note that no boundary condition problem occurs in this routine 
     
    245241      !!---------------------------------------------------------------------- 
    246242 
    247       SELECT CASE ( neos ) 
     243      SELECT CASE ( nn_eos ) 
    248244      ! 
    249245      CASE( 0 )                !==  Jackett and McDougall (1994) formulation  ==! 
     
    299295      CASE( 1 )                !==  Linear formulation = F( temperature )  ==! 
    300296         DO jk = 1, jpkm1 
    301             prd  (:,:,jk) = ( 0.0285 - ralpha * ptem(:,:,jk) )        * tmask(:,:,jk) 
     297            prd  (:,:,jk) = ( 0.0285 - rn_alpha * ptem(:,:,jk) )        * tmask(:,:,jk) 
    302298            prhop(:,:,jk) = ( 1.e0   +          prd (:,:,jk) ) * rau0 * tmask(:,:,jk) 
    303299         END DO 
     
    305301      CASE( 2 )                !==  Linear formulation = F( temperature , salinity )  ==! 
    306302         DO jk = 1, jpkm1 
    307             prd  (:,:,jk) = ( rbeta  * psal(:,:,jk) - ralpha * ptem(:,:,jk) )        * tmask(:,:,jk) 
     303            prd  (:,:,jk) = ( rn_beta  * psal(:,:,jk) - rn_alpha * ptem(:,:,jk) )        * tmask(:,:,jk) 
    308304            prhop(:,:,jk) = ( 1.e0   + prd (:,:,jk) )                         * rau0 * tmask(:,:,jk) 
    309305         END DO 
    310          ! 
    311       CASE DEFAULT 
    312          WRITE(ctmp1,*) '          bad flag value for neos = ', neos 
    313          CALL ctl_stop( ctmp1 ) 
    314306         ! 
    315307      END SELECT 
     
    326318      !! ** Purpose :   Compute the in situ density (ratio rho/rau0) from  
    327319      !!      potential temperature and salinity using an equation of state 
    328       !!      defined through the namelist parameter neos. * 2D field case 
     320      !!      defined through the namelist parameter nn_eos. * 2D field case 
    329321      !! 
    330322      !! ** Method : 
    331       !!      neos = 0 : Jackett and McDougall (1994) equation of state. 
     323      !!      nn_eos = 0 : Jackett and McDougall (1994) equation of state. 
    332324      !!         the in situ density is computed directly as a function of 
    333325      !!         potential temperature relative to the surface (the opa t 
     
    344336      !!         Check value: rho = 1060.93298 kg/m**3 for p=10000 dbar, 
    345337      !!          t = 40 deg celcius, s=40 psu 
    346       !!      neos = 1 : linear equation of state function of temperature only 
    347       !!              prd(t) = 0.0285 - ralpha * t 
    348       !!      neos = 2 : linear equation of state function of temperature and 
     338      !!      nn_eos = 1 : linear equation of state function of temperature only 
     339      !!              prd(t) = 0.0285 - rn_alpha * t 
     340      !!      nn_eos = 2 : linear equation of state function of temperature and 
    349341      !!               salinity 
    350       !!              prd(t,s) = rbeta * s - ralpha * tn - 1. 
     342      !!              prd(t,s) = rn_beta * s - rn_alpha * tn - 1. 
    351343      !!      Note that no boundary condition problem occurs in this routine 
    352344      !!      as (ptem,psal) are defined over the whole domain. 
     
    369361      prd(:,:) = 0.e0 
    370362 
    371       SELECT CASE( neos ) 
     363      SELECT CASE( nn_eos ) 
    372364      ! 
    373365      CASE( 0 )                !==  Jackett and McDougall (1994) formulation  ==! 
     
    424416         DO jj = 1, jpjm1 
    425417            DO ji = 1, fs_jpim1   ! vector opt. 
    426                prd(ji,jj) = ( 0.0285 - ralpha * ptem(ji,jj) ) * tmask(ji,jj,1) 
     418               prd(ji,jj) = ( 0.0285 - rn_alpha * ptem(ji,jj) ) * tmask(ji,jj,1) 
    427419            END DO 
    428420         END DO 
     
    431423         DO jj = 1, jpjm1 
    432424            DO ji = 1, fs_jpim1   ! vector opt. 
    433                prd(ji,jj) = ( rbeta * psal(ji,jj) - ralpha * ptem(ji,jj) ) * tmask(ji,jj,1)  
    434             END DO 
    435          END DO 
    436          ! 
    437       CASE DEFAULT 
    438          WRITE(ctmp1,*) '          bad flag value for neos = ', neos 
    439          CALL ctl_stop( ctmp1 ) 
     425               prd(ji,jj) = ( rn_beta * psal(ji,jj) - rn_alpha * ptem(ji,jj) ) * tmask(ji,jj,1)  
     426            END DO 
     427         END DO 
    440428         ! 
    441429      END SELECT 
     
    454442      !!       
    455443      !! ** Method : 
    456       !!       * neos = 0  : UNESCO sea water properties 
     444      !!       * nn_eos = 0  : UNESCO sea water properties 
    457445      !!         The brunt-vaisala frequency is computed using the polynomial 
    458446      !!      polynomial expression of McDougall (1987): 
     
    461449      !!      computed and used in zdfddm module : 
    462450      !!              Rrau = alpha/beta * ( dk[ t ] / dk[ s ] ) 
    463       !!       * neos = 1  : linear equation of state (temperature only) 
    464       !!            N^2 = grav * ralpha * dk[ t ]/e3w 
    465       !!       * neos = 2  : linear equation of state (temperature & salinity) 
    466       !!            N^2 = grav * (ralpha * dk[ t ] - rbeta * dk[ s ] ) / e3w 
     451      !!       * nn_eos = 1  : linear equation of state (temperature only) 
     452      !!            N^2 = grav * rn_alpha * dk[ t ]/e3w 
     453      !!       * nn_eos = 2  : linear equation of state (temperature & salinity) 
     454      !!            N^2 = grav * (rn_alpha * dk[ t ] - rn_beta * dk[ s ] ) / e3w 
    467455      !!      The use of potential density to compute N^2 introduces e r r o r 
    468456      !!      in the sign of N^2 at great depths. We recommand the use of  
    469       !!      neos = 0, except for academical studies. 
     457      !!      nn_eos = 0, except for academical studies. 
    470458      !!        Macro-tasked on horizontal slab (jk-loop) 
    471459      !!      N.B. N^2 is set to zero at the first level (JK=1) in inidtr 
     
    490478      ! --------------------------  
    491479      ! 
    492       SELECT CASE( neos ) 
     480      SELECT CASE( nn_eos ) 
    493481      ! 
    494482      CASE( 0 )                !==  Jackett and McDougall (1994) formulation  ==! 
     
    541529      CASE( 1 )                !==  Linear formulation = F( temperature )  ==! 
    542530         DO jk = 2, jpkm1 
    543             pn2(:,:,jk) = grav * ralpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) ) / fse3w(:,:,jk) * tmask(:,:,jk) 
     531            pn2(:,:,jk) = grav * rn_alpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) ) / fse3w(:,:,jk) * tmask(:,:,jk) 
    544532         END DO 
    545533         ! 
    546534      CASE( 2 )                !==  Linear formulation = F( temperature , salinity )  ==! 
    547535         DO jk = 2, jpkm1 
    548             pn2(:,:,jk) = grav * (  ralpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) )      & 
    549                &                  - rbeta  * ( psal(:,:,jk-1) - psal(:,:,jk) )  )   & 
     536            pn2(:,:,jk) = grav * (  rn_alpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) )      & 
     537               &                  - rn_beta  * ( psal(:,:,jk-1) - psal(:,:,jk) )  )   & 
    550538               &               / fse3w(:,:,jk) * tmask(:,:,jk) 
    551539         END DO  
     
    561549         END DO 
    562550#endif 
    563          ! 
    564       CASE DEFAULT 
    565          WRITE(ctmp1,*) '          bad flag value for neos = ', neos 
    566          CALL ctl_stop( ctmp1 ) 
    567          ! 
    568551      END SELECT 
    569552 
     
    606589      !! ** Method  :   Read the namelist nameos and control the parameters 
    607590      !!---------------------------------------------------------------------- 
    608       NAMELIST/nameos/ neos, ralpha, rbeta 
     591      NAMELIST/nameos/ nn_eos, rn_alpha, rn_beta 
    609592      !!---------------------------------------------------------------------- 
    610593      ! 
     
    617600         WRITE(numout,*) '~~~~~~~~' 
    618601         WRITE(numout,*) '          Namelist nameos : set eos parameters' 
    619          WRITE(numout,*) '             flag for eq. of state and N^2  neos   = ', neos 
    620          WRITE(numout,*) '             thermal exp. coef. (linear)    ralpha = ', ralpha 
    621          WRITE(numout,*) '             saline  exp. coef. (linear)    rbeta  = ', rbeta 
     602         WRITE(numout,*) '             flag for eq. of state and N^2  nn_eos   = ', nn_eos 
     603         WRITE(numout,*) '             thermal exp. coef. (linear)    rn_alpha = ', rn_alpha 
     604         WRITE(numout,*) '             saline  exp. coef. (linear)    rn_beta  = ', rn_beta 
    622605      ENDIF 
    623606      ! 
    624       SELECT CASE( neos ) 
    625       ! 
    626       CASE( 0 )                   !==  Jackett and McDougall (1994) formulation  ==! 
     607      SELECT CASE( nn_eos )         ! check option 
     608      ! 
     609      CASE( 0 )                        !==  Jackett and McDougall (1994) formulation  ==! 
    627610         IF(lwp) WRITE(numout,*) 
    628611         IF(lwp) WRITE(numout,*) '          use of Jackett & McDougall (1994) equation of state and' 
    629612         IF(lwp) WRITE(numout,*) '                 McDougall (1987) Brunt-Vaisala frequency' 
    630613         ! 
    631       CASE( 1 )                   !==  Linear formulation = F( temperature )  ==! 
     614      CASE( 1 )                        !==  Linear formulation = F( temperature )  ==! 
    632615         IF(lwp) WRITE(numout,*) 
    633          IF(lwp) WRITE(numout,*) '          use of linear eos rho(T) = rau0 * ( 1.0285 - ralpha * T )' 
     616         IF(lwp) WRITE(numout,*) '          use of linear eos rho(T) = rau0 * ( 1.0285 - rn_alpha * T )' 
    634617         IF( lk_zdfddm ) CALL ctl_stop( '          double diffusive mixing parameterization requires',   & 
    635618              &                         ' that T and S are used as state variables' ) 
    636619         ! 
    637       CASE( 2 )                   !==  Linear formulation = F( temperature , salinity )  ==! 
    638          ralpbet = ralpha / rbeta 
     620      CASE( 2 )                        !==  Linear formulation = F( temperature , salinity )  ==! 
     621         ralpbet = rn_alpha / rn_beta 
    639622         IF(lwp) WRITE(numout,*) 
    640          IF(lwp) WRITE(numout,*) '          use of linear eos rho(T,S) = rau0 * ( rbeta * S - ralpha * T )' 
    641          ! 
    642       CASE DEFAULT                !==  ERROR in neos  ==! 
    643          WRITE(ctmp1,*) '          bad flag value for neos = ', neos 
     623         IF(lwp) WRITE(numout,*) '          use of linear eos rho(T,S) = rau0 * ( rn_beta * S - rn_alpha * T )' 
     624         ! 
     625      CASE DEFAULT                     !==  ERROR in nn_eos  ==! 
     626         WRITE(ctmp1,*) '          bad flag value for nn_eos = ', nn_eos 
    644627         CALL ctl_stop( ctmp1 ) 
    645628         ! 
Note: See TracChangeset for help on using the changeset viewer.