Changeset 1601 for trunk/NEMO/OPA_SRC/eosbn2.F90
- Timestamp:
- 2009-08-11T12:09:19+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/eosbn2.F90
r1559 r1601 9 9 !! 6.0 ! 1994-08 (G. Madec) Add Jackett & McDougall eos 10 10 !! 7.0 ! 1996-01 (G. Madec) statement function for e3 11 !! 8.1 ! 1997-07 (G. Madec) introduction of neos, OPA8.112 11 !! 8.1 ! 1997-07 (G. Madec) density instead of volumic mass 13 12 !! - ! 1999-02 (G. Madec, N. Grima) semi-implicit pressure gradient … … 51 50 PUBLIC tfreez ! called by sbcice_... modules 52 51 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 57 57 REAL(wp), PUBLIC :: ralpbet !: alpha / beta ratio 58 58 … … 74 74 !! ** Purpose : Compute the in situ density (ratio rho/rau0) from 75 75 !! potential temperature and salinity using an equation of state 76 !! defined through the namelist parameter n eos.76 !! defined through the namelist parameter nn_eos. 77 77 !! 78 78 !! ** Method : 3 cases: 79 !! n eos = 0 : Jackett and McDougall (1994) equation of state.79 !! nn_eos = 0 : Jackett and McDougall (1994) equation of state. 80 80 !! the in situ density is computed directly as a function of 81 81 !! potential temperature relative to the surface (the opa t … … 92 92 !! Check value: rho = 1060.93298 kg/m**3 for p=10000 dbar, 93 93 !! t = 40 deg celcius, s=40 psu 94 !! n eos = 1 : linear equation of state function of temperature only95 !! prd(t) = 0.0285 - r alpha * t96 !! n eos = 2 : linear equation of state function of temperature and94 !! 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 97 97 !! salinity 98 !! prd(t,s) = r beta * s - ralpha * tn - 1.98 !! prd(t,s) = rn_beta * s - rn_alpha * tn - 1. 99 99 !! Note that no boundary condition problem occurs in this routine 100 100 !! as (ptem,psal) are defined over the whole domain. … … 118 118 !!---------------------------------------------------------------------- 119 119 120 SELECT CASE( n eos )120 SELECT CASE( nn_eos ) 121 121 ! 122 122 CASE( 0 ) !== Jackett and McDougall (1994) formulation ==! … … 169 169 CASE( 1 ) !== Linear formulation function of temperature only ==! 170 170 DO jk = 1, jpkm1 171 prd(:,:,jk) = ( 0.0285 - r alpha * ptem(:,:,jk) ) * tmask(:,:,jk)171 prd(:,:,jk) = ( 0.0285 - rn_alpha * ptem(:,:,jk) ) * tmask(:,:,jk) 172 172 END DO 173 173 ! 174 174 CASE( 2 ) !== Linear formulation function of temperature and salinity ==! 175 175 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 182 178 ! 183 179 END SELECT … … 195 191 !! potential volumic mass (Kg/m3) from potential temperature and 196 192 !! salinity fields using an equation of state defined through the 197 !! namelist parameter n eos.193 !! namelist parameter nn_eos. 198 194 !! 199 195 !! ** Method : 200 !! n eos = 0 : Jackett and McDougall (1994) equation of state.196 !! nn_eos = 0 : Jackett and McDougall (1994) equation of state. 201 197 !! the in situ density is computed directly as a function of 202 198 !! potential temperature relative to the surface (the opa t … … 216 212 !! t = 40 deg celcius, s=40 psu 217 213 !! 218 !! n eos = 1 : linear equation of state function of temperature only219 !! prd(t) = ( rho(t) - rau0 ) / rau0 = 0.028 - r alpha * t214 !! nn_eos = 1 : linear equation of state function of temperature only 215 !! prd(t) = ( rho(t) - rau0 ) / rau0 = 0.028 - rn_alpha * t 220 216 !! rhop(t,s) = rho(t,s) 221 217 !! 222 !! n eos = 2 : linear equation of state function of temperature and218 !! nn_eos = 2 : linear equation of state function of temperature and 223 219 !! salinity 224 220 !! prd(t,s) = ( rho(t,s) - rau0 ) / rau0 225 !! = r beta * s - ralpha * tn - 1.221 !! = rn_beta * s - rn_alpha * tn - 1. 226 222 !! rhop(t,s) = rho(t,s) 227 223 !! Note that no boundary condition problem occurs in this routine … … 245 241 !!---------------------------------------------------------------------- 246 242 247 SELECT CASE ( n eos )243 SELECT CASE ( nn_eos ) 248 244 ! 249 245 CASE( 0 ) !== Jackett and McDougall (1994) formulation ==! … … 299 295 CASE( 1 ) !== Linear formulation = F( temperature ) ==! 300 296 DO jk = 1, jpkm1 301 prd (:,:,jk) = ( 0.0285 - r alpha * ptem(:,:,jk) ) * tmask(:,:,jk)297 prd (:,:,jk) = ( 0.0285 - rn_alpha * ptem(:,:,jk) ) * tmask(:,:,jk) 302 298 prhop(:,:,jk) = ( 1.e0 + prd (:,:,jk) ) * rau0 * tmask(:,:,jk) 303 299 END DO … … 305 301 CASE( 2 ) !== Linear formulation = F( temperature , salinity ) ==! 306 302 DO jk = 1, jpkm1 307 prd (:,:,jk) = ( r beta * psal(:,:,jk) - ralpha * ptem(:,:,jk) ) * tmask(:,:,jk)303 prd (:,:,jk) = ( rn_beta * psal(:,:,jk) - rn_alpha * ptem(:,:,jk) ) * tmask(:,:,jk) 308 304 prhop(:,:,jk) = ( 1.e0 + prd (:,:,jk) ) * rau0 * tmask(:,:,jk) 309 305 END DO 310 !311 CASE DEFAULT312 WRITE(ctmp1,*) ' bad flag value for neos = ', neos313 CALL ctl_stop( ctmp1 )314 306 ! 315 307 END SELECT … … 326 318 !! ** Purpose : Compute the in situ density (ratio rho/rau0) from 327 319 !! potential temperature and salinity using an equation of state 328 !! defined through the namelist parameter n eos. * 2D field case320 !! defined through the namelist parameter nn_eos. * 2D field case 329 321 !! 330 322 !! ** Method : 331 !! n eos = 0 : Jackett and McDougall (1994) equation of state.323 !! nn_eos = 0 : Jackett and McDougall (1994) equation of state. 332 324 !! the in situ density is computed directly as a function of 333 325 !! potential temperature relative to the surface (the opa t … … 344 336 !! Check value: rho = 1060.93298 kg/m**3 for p=10000 dbar, 345 337 !! t = 40 deg celcius, s=40 psu 346 !! n eos = 1 : linear equation of state function of temperature only347 !! prd(t) = 0.0285 - r alpha * t348 !! n eos = 2 : linear equation of state function of temperature and338 !! 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 349 341 !! salinity 350 !! prd(t,s) = r beta * s - ralpha * tn - 1.342 !! prd(t,s) = rn_beta * s - rn_alpha * tn - 1. 351 343 !! Note that no boundary condition problem occurs in this routine 352 344 !! as (ptem,psal) are defined over the whole domain. … … 369 361 prd(:,:) = 0.e0 370 362 371 SELECT CASE( n eos )363 SELECT CASE( nn_eos ) 372 364 ! 373 365 CASE( 0 ) !== Jackett and McDougall (1994) formulation ==! … … 424 416 DO jj = 1, jpjm1 425 417 DO ji = 1, fs_jpim1 ! vector opt. 426 prd(ji,jj) = ( 0.0285 - r alpha * ptem(ji,jj) ) * tmask(ji,jj,1)418 prd(ji,jj) = ( 0.0285 - rn_alpha * ptem(ji,jj) ) * tmask(ji,jj,1) 427 419 END DO 428 420 END DO … … 431 423 DO jj = 1, jpjm1 432 424 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 440 428 ! 441 429 END SELECT … … 454 442 !! 455 443 !! ** Method : 456 !! * n eos = 0 : UNESCO sea water properties444 !! * nn_eos = 0 : UNESCO sea water properties 457 445 !! The brunt-vaisala frequency is computed using the polynomial 458 446 !! polynomial expression of McDougall (1987): … … 461 449 !! computed and used in zdfddm module : 462 450 !! Rrau = alpha/beta * ( dk[ t ] / dk[ s ] ) 463 !! * n eos = 1 : linear equation of state (temperature only)464 !! N^2 = grav * r alpha * dk[ t ]/e3w465 !! * n eos = 2 : linear equation of state (temperature & salinity)466 !! N^2 = grav * (r alpha * dk[ t ] - rbeta * dk[ s ] ) / e3w451 !! * 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 467 455 !! The use of potential density to compute N^2 introduces e r r o r 468 456 !! in the sign of N^2 at great depths. We recommand the use of 469 !! n eos = 0, except for academical studies.457 !! nn_eos = 0, except for academical studies. 470 458 !! Macro-tasked on horizontal slab (jk-loop) 471 459 !! N.B. N^2 is set to zero at the first level (JK=1) in inidtr … … 490 478 ! -------------------------- 491 479 ! 492 SELECT CASE( n eos )480 SELECT CASE( nn_eos ) 493 481 ! 494 482 CASE( 0 ) !== Jackett and McDougall (1994) formulation ==! … … 541 529 CASE( 1 ) !== Linear formulation = F( temperature ) ==! 542 530 DO jk = 2, jpkm1 543 pn2(:,:,jk) = grav * r alpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) ) / fse3w(:,:,jk) * tmask(:,:,jk)531 pn2(:,:,jk) = grav * rn_alpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) ) / fse3w(:,:,jk) * tmask(:,:,jk) 544 532 END DO 545 533 ! 546 534 CASE( 2 ) !== Linear formulation = F( temperature , salinity ) ==! 547 535 DO jk = 2, jpkm1 548 pn2(:,:,jk) = grav * ( r alpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) ) &549 & - r beta * ( psal(:,:,jk-1) - psal(:,:,jk) ) ) &536 pn2(:,:,jk) = grav * ( rn_alpha * ( ptem(:,:,jk-1) - ptem(:,:,jk) ) & 537 & - rn_beta * ( psal(:,:,jk-1) - psal(:,:,jk) ) ) & 550 538 & / fse3w(:,:,jk) * tmask(:,:,jk) 551 539 END DO … … 561 549 END DO 562 550 #endif 563 !564 CASE DEFAULT565 WRITE(ctmp1,*) ' bad flag value for neos = ', neos566 CALL ctl_stop( ctmp1 )567 !568 551 END SELECT 569 552 … … 606 589 !! ** Method : Read the namelist nameos and control the parameters 607 590 !!---------------------------------------------------------------------- 608 NAMELIST/nameos/ n eos, ralpha, rbeta591 NAMELIST/nameos/ nn_eos, rn_alpha, rn_beta 609 592 !!---------------------------------------------------------------------- 610 593 ! … … 617 600 WRITE(numout,*) '~~~~~~~~' 618 601 WRITE(numout,*) ' Namelist nameos : set eos parameters' 619 WRITE(numout,*) ' flag for eq. of state and N^2 n eos = ', neos620 WRITE(numout,*) ' thermal exp. coef. (linear) r alpha = ', ralpha621 WRITE(numout,*) ' saline exp. coef. (linear) r beta = ', rbeta602 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 622 605 ENDIF 623 606 ! 624 SELECT CASE( n eos )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 ==! 627 610 IF(lwp) WRITE(numout,*) 628 611 IF(lwp) WRITE(numout,*) ' use of Jackett & McDougall (1994) equation of state and' 629 612 IF(lwp) WRITE(numout,*) ' McDougall (1987) Brunt-Vaisala frequency' 630 613 ! 631 CASE( 1 ) !== Linear formulation = F( temperature ) ==!614 CASE( 1 ) !== Linear formulation = F( temperature ) ==! 632 615 IF(lwp) WRITE(numout,*) 633 IF(lwp) WRITE(numout,*) ' use of linear eos rho(T) = rau0 * ( 1.0285 - r alpha * T )'616 IF(lwp) WRITE(numout,*) ' use of linear eos rho(T) = rau0 * ( 1.0285 - rn_alpha * T )' 634 617 IF( lk_zdfddm ) CALL ctl_stop( ' double diffusive mixing parameterization requires', & 635 618 & ' that T and S are used as state variables' ) 636 619 ! 637 CASE( 2 ) !== Linear formulation = F( temperature , salinity ) ==!638 ralpbet = r alpha / rbeta620 CASE( 2 ) !== Linear formulation = F( temperature , salinity ) ==! 621 ralpbet = rn_alpha / rn_beta 639 622 IF(lwp) WRITE(numout,*) 640 IF(lwp) WRITE(numout,*) ' use of linear eos rho(T,S) = rau0 * ( r beta * S - ralpha * T )'641 ! 642 CASE DEFAULT !== ERROR in neos ==!643 WRITE(ctmp1,*) ' bad flag value for n eos = ', neos623 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 644 627 CALL ctl_stop( ctmp1 ) 645 628 !
Note: See TracChangeset
for help on using the changeset viewer.