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 1932 for trunk – NEMO

Changeset 1932 for trunk


Ignore:
Timestamp:
2010-06-15T12:28:20+02:00 (14 years ago)
Author:
smasson
Message:

nice version of phycst.F90, see ticket:606

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DOM/phycst.F90

    r1930 r1932  
    44   !!     Definition of of both ocean and ice parameters used in the code 
    55   !!===================================================================== 
    6    !! History :   OPA  !  1990-10  (C. Levy, G. Madec)  Original code 
    7    !!                  !  1991-11  (G. Madec, M. Imbard) 
    8    !!  NEMO       1.0  !  2002-08  (G. Madec, C. Ethe)  F90, add ice constants 
     6   !! History :   OPA  !  1990-10  (C. Levy - G. Madec)  Original code 
     7   !!             8.1  !  1991-11  (G. Madec, M. Imbard)  cosmetic changes 
     8   !!   NEMO      1.0  !  2002-08  (G. Madec, C. Ethe)  F90, add ice constants 
    99   !!              -   !  2006-08  (G. Madec)  style  
     10   !!             3.2  !  2006-08  (S. Masson, G. Madec)  suppress useless variables + style  
    1011   !!---------------------------------------------------------------------- 
    1112 
     
    2324   REAL(wp), PUBLIC ::   rpi = 3.141592653589793_wp             !: pi 
    2425   REAL(wp), PUBLIC ::   rad = 3.141592653589793_wp / 180._wp   !: conversion from degre into radian 
    25    REAL(wp), PUBLIC ::   rsmall = 0.5 * EPSILON( 1. )           !: smallest real computer value 
     26   REAL(wp), PUBLIC ::   rsmall = 0.5 * EPSILON( 1.e0 )         !: smallest real computer value 
    2627    
    27    REAL(wp), PUBLIC ::          & !: 
    28       rday = 24.*60.*60.  ,     & !: day (s) 
    29       rsiyea              ,     & !: sideral year (s) 
    30       rsiday              ,     & !: sideral day (s) 
    31       raamo =  12._wp     ,     & !: number of months in one year 
    32       rjjhh =  24._wp     ,     & !: number of hours in one day 
    33       rhhmm =  60._wp     ,     & !: number of minutes in one hour 
    34       rmmss =  60._wp     ,     & !: number of seconds in one minute 
    35 !!!   omega = 7.292115083046061e-5_wp ,  &  !: change the last digit! 
    36       omega               ,    &  !: earth rotation parameter 
    37       ra    = 6371229._wp ,    &  !: earth radius (meter) 
    38       grav  = 9.80665_wp          !: gravity (m/s2) 
     28   REAL(wp), PUBLIC ::   rday = 24.*60.*60.       !: day (s) 
     29   REAL(wp), PUBLIC ::   rsiyea                   !: sideral year (s) 
     30   REAL(wp), PUBLIC ::   rsiday                   !: sideral day (s) 
     31   REAL(wp), PUBLIC ::   raamo =  12._wp          !: number of months in one year 
     32   REAL(wp), PUBLIC ::   rjjhh =  24._wp          !: number of hours in one day 
     33   REAL(wp), PUBLIC ::   rhhmm =  60._wp          !: number of minutes in one hour 
     34   REAL(wp), PUBLIC ::   rmmss =  60._wp          !: number of seconds in one minute 
     35!! REAL(wp), PUBLIC ::   omega = 7.292115083046061e-5_wp ,  &  !: change the last digit! 
     36   REAL(wp), PUBLIC ::   omega                    !: earth rotation parameter 
     37   REAL(wp), PUBLIC ::   ra    = 6371229._wp      !: earth radius (meter) 
     38   REAL(wp), PUBLIC ::   grav  = 9.80665_wp       !: gravity (m/s2) 
    3939    
    40    REAL(wp), PUBLIC ::         &  !: 
    41       rtt      = 273.16_wp  ,  &  !: triple point of temperature (Kelvin) 
    42       rt0      = 273.15_wp  ,  &  !: freezing point of water (Kelvin) 
     40   REAL(wp), PUBLIC ::   rtt      = 273.16_wp     !: triple point of temperature (Kelvin) 
     41   REAL(wp), PUBLIC ::   rt0      = 273.15_wp     !: freezing point of water (Kelvin) 
    4342#if defined key_lim3 
    44       rt0_snow = 273.16_wp  ,  &  !: melting point of snow  (Kelvin) 
    45       rt0_ice  = 273.16_wp  ,  &  !: melting point of ice   (Kelvin) 
     43   REAL(wp), PUBLIC ::   rt0_snow = 273.16_wp     !: melting point of snow  (Kelvin) 
     44   REAL(wp), PUBLIC ::   rt0_ice  = 273.16_wp     !: melting point of ice   (Kelvin) 
    4645#else 
    47       rt0_snow = 273.15_wp  ,  &  !: melting point of snow  (Kelvin) 
    48       rt0_ice  = 273.05_wp  ,  &  !: melting point of ice   (Kelvin) 
     46   REAL(wp), PUBLIC ::   rt0_snow = 273.15_wp     !: melting point of snow  (Kelvin) 
     47   REAL(wp), PUBLIC ::   rt0_ice  = 273.05_wp     !: melting point of ice   (Kelvin) 
    4948#endif 
    50       rau0     = 1035._wp   ,  &  !: volumic mass of reference (kg/m3) 
    51       rcp      =    4.e+3_wp,  &  !: ocean specific heat 
    52       ro0cpr                      !: = 1. / ( rau0 * rcp ) 
    5349 
    54    REAL(wp), PUBLIC ::            &  !: 
     50   REAL(wp), PUBLIC ::   rau0     = 1020._wp      !: reference volumic mass (density)  (kg/m3) 
     51   REAL(wp), PUBLIC ::   rau0r                    !: reference specific volume         (m3/kg) 
     52   REAL(wp), PUBLIC ::   rcp      =    4.e+3_wp   !: ocean specific heat 
     53   REAL(wp), PUBLIC ::   ro0cpr                   !: = 1. / ( rau0 * rcp ) 
     54 
    5555#if defined key_lim3 
    56       rcdsn   =   0.31_wp     ,   &  !: thermal conductivity of snow 
    57       rcdic   =   2.034396_wp ,   &  !: thermal conductivity of fresh ice 
    58       cpic    = 2067.0        ,   & 
    59       lsub    = 2.834e+6      ,   &  !: pure ice latent heat of sublimation (J.kg-1) 
    60       lfus    = 0.334e+6      ,   &  !: latent heat of fusion of fresh ice   (J.kg-1) 
    61       rhoic   = 917._wp       ,   &  !: volumic mass of sea ice (kg/m3) 
    62       tmut    =   0.054       ,   &  !: decrease of seawater meltpoint with salinity 
     56   REAL(wp), PUBLIC ::   rcdsn   =   0.31_wp      !: thermal conductivity of snow 
     57   REAL(wp), PUBLIC ::   rcdic   =   2.034396_wp  !: thermal conductivity of fresh ice 
     58   REAL(wp), PUBLIC ::   cpic    = 2067.0         !: specific heat of sea ice 
     59   REAL(wp), PUBLIC ::   lsub    = 2.834e+6       !: pure ice latent heat of sublimation (J.kg-1) 
     60   REAL(wp), PUBLIC ::   lfus    = 0.334e+6       !: latent heat of fusion of fresh ice   (J.kg-1) 
     61   REAL(wp), PUBLIC ::   rhoic   = 917._wp        !: volumic mass of sea ice (kg/m3) 
     62   REAL(wp), PUBLIC ::   tmut    =   0.054        !: decrease of seawater meltpoint with salinity 
    6363#else 
    64       rcdsn   =   0.22_wp     ,   &  !: conductivity of the snow 
    65       rcdic   =   2.034396_wp ,   &  !: conductivity of the ice 
    66       rcpsn   =   6.9069e+5_wp,   &  !: density times specific heat for snow 
    67       rcpic   =   1.8837e+6_wp,   &  !: volumetric latent heat fusion of sea ice 
    68       lfus    = 0.3337e+6     ,   &  !: latent heat of fusion of fresh ice   (J.kg-1) 
    69       xlsn    = 110.121e+6_wp ,   &  !: = lfus * rhosn, volumetric latent heat fusion of snow 
    70       xlic    = 300.33e+6_wp  ,   &  !: = lfus * rhosn, volumetric latent heat fusion of ice 
    71       xsn     =   2.8e+6      ,   &  !: latent heat of sublimation of snow 
    72       rhoic   = 900._wp       ,   &  !: volumic mass of sea ice (kg/m3) 
     64   REAL(wp), PUBLIC ::   rcdsn   =   0.22_wp      !: conductivity of the snow 
     65   REAL(wp), PUBLIC ::   rcdic   =   2.034396_wp  !: conductivity of the ice 
     66   REAL(wp), PUBLIC ::   rcpsn   =   6.9069e+5_wp !: density times specific heat for snow 
     67   REAL(wp), PUBLIC ::   rcpic   =   1.8837e+6_wp !: volumetric latent heat fusion of sea ice 
     68   REAL(wp), PUBLIC ::   xlsn    = 110.121e+6_wp  !: volumetric latent heat fusion of snow 
     69   REAL(wp), PUBLIC ::   xlic    = 300.33e+6_wp   !: volumetric latent heat fusion of ice 
     70   REAL(wp), PUBLIC ::   xsn     =   2.8e+6       !: latent heat of sublimation of snow 
     71   REAL(wp), PUBLIC ::   rhoic   = 900._wp        !: volumic mass of sea ice (kg/m3) 
    7372#endif 
    74       rhosn   = 330._wp       ,   &  !: volumic mass of snow (kg/m3) 
    75       emic    =   0.97_wp     ,   &  !: emissivity of snow or ice 
    76       sice    =   6.0_wp      ,   &  !: salinity of ice (psu) 
    77       soce    =  34.7_wp      ,   &  !: salinity of sea (psu) 
    78       cevap   =   2.5e+6_wp   ,   &  !: latent heat of evaporation (water) 
    79       srgamma =   0.9_wp      ,   &  !: correction factor for solar radiation (Oberhuber, 1974) 
    80       vkarmn  =   0.4_wp      ,   &  !: von Karman constant 
    81       stefan  =   5.67e-8_wp         !: Stefan-Boltzmann constant  
    82       !!---------------------------------------------------------------------- 
    83       !! NEMO/OPA 3.2 , LOCEAN-IPSL (2010)  
    84       !! $Id$  
    85       !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    86       !!---------------------------------------------------------------------- 
     73   REAL(wp), PUBLIC ::   rhosn   = 330._wp        !: volumic mass of snow (kg/m3) 
     74   REAL(wp), PUBLIC ::   emic    =   0.97_wp      !: emissivity of snow or ice 
     75   REAL(wp), PUBLIC ::   sice    =   6.0_wp       !: reference salinity of ice (psu) 
     76   REAL(wp), PUBLIC ::   soce    =  34.7_wp       !: reference salinity of sea (psu) 
     77   REAL(wp), PUBLIC ::   cevap   =   2.5e+6_wp    !: latent heat of evaporation (water) 
     78   REAL(wp), PUBLIC ::   srgamma =   0.9_wp       !: correction factor for solar radiation (Oberhuber, 1974) 
     79   REAL(wp), PUBLIC ::   vkarmn  =   0.4_wp       !: von Karman constant 
     80   REAL(wp), PUBLIC ::   stefan  =   5.67e-8_wp   !: Stefan-Boltzmann constant  
     81   !!---------------------------------------------------------------------- 
     82   !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     83   !! $Id$  
     84   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     85   !!---------------------------------------------------------------------- 
    8786    
    8887CONTAINS 
     
    9796      !!---------------------------------------------------------------------- 
    9897 
    99       IF(lwp) WRITE(numout,*) 
    100       IF(lwp) WRITE(numout,*) ' phy_cst : initialization of ocean parameters and constants' 
    101       IF(lwp) WRITE(numout,*) ' ~~~~~~~' 
     98      !                                   ! Define additional parameters 
     99      rsiyea = 365.25 * rday * 2. * rpi / 6.283076 
     100      rsiday = rday / ( 1. + rday / rsiyea ) 
     101      omega  = 2. * rpi / rsiday  
    102102 
    103       ! Ocean Parameters 
    104       ! ---------------- 
    105       IF(lwp) THEN 
     103      rau0r  = 1. /   rau0   
     104      ro0cpr = 1. / ( rau0 * rcp ) 
     105 
     106 
     107      IF(lwp) THEN                        ! control print 
     108         WRITE(numout,*) 
     109         WRITE(numout,*) ' phy_cst : initialization of ocean parameters and constants' 
     110         WRITE(numout,*) ' ~~~~~~~' 
    106111         WRITE(numout,*) '       Domain info' 
    107112         WRITE(numout,*) '          dimension of model' 
     
    116121         WRITE(numout,*) '             jpnij   : ', jpnij 
    117122         WRITE(numout,*) '          lateral domain boundary condition type : jperio  = ', jperio 
    118       ENDIF 
    119  
    120       ! Define constants 
    121       ! ---------------- 
    122       IF(lwp) WRITE(numout,*) 
    123       IF(lwp) WRITE(numout,*) '       Constants' 
    124  
    125       IF(lwp) WRITE(numout,*) 
    126       IF(lwp) WRITE(numout,*) '          mathematical constant                 rpi = ', rpi 
    127  
    128       rsiyea = 365.25 * rday * 2. * rpi / 6.283076 
    129       rsiday = rday / ( 1. + rday / rsiyea ) 
    130       omega  = 2. * rpi / rsiday  
    131       IF(lwp) WRITE(numout,*) 
    132       IF(lwp) WRITE(numout,*) '          day                                rday   = ', rday,   ' s' 
    133       IF(lwp) WRITE(numout,*) '          sideral year                       rsiyea = ', rsiyea, ' s' 
    134       IF(lwp) WRITE(numout,*) '          sideral day                        rsiday = ', rsiday, ' s' 
    135       IF(lwp) WRITE(numout,*) '          omega                              omega  = ', omega,  ' s-1' 
    136  
    137       IF(lwp) WRITE(numout,*) 
    138       IF(lwp) WRITE(numout,*) '          nb of months per year               raamo = ', raamo, ' months' 
    139       IF(lwp) WRITE(numout,*) '          nb of hours per day                 rjjhh = ', rjjhh, ' hours' 
    140       IF(lwp) WRITE(numout,*) '          nb of minutes per hour              rhhmm = ', rhhmm, ' mn' 
    141       IF(lwp) WRITE(numout,*) '          nb of seconds per minute            rmmss = ', rmmss, ' s' 
    142  
    143       IF(lwp) WRITE(numout,*) 
    144       IF(lwp) WRITE(numout,*) '          earth radius                         ra   = ', ra, ' m' 
    145       IF(lwp) WRITE(numout,*) '          gravity                              grav = ', grav , ' m/s^2' 
    146  
    147       IF(lwp) WRITE(numout,*) 
    148       IF(lwp) WRITE(numout,*) '          triple point of temperature      rtt      = ', rtt     , ' K' 
    149       IF(lwp) WRITE(numout,*) '          freezing point of water          rt0      = ', rt0     , ' K' 
    150       IF(lwp) WRITE(numout,*) '          melting point of snow            rt0_snow = ', rt0_snow, ' K' 
    151       IF(lwp) WRITE(numout,*) '          melting point of ice             rt0_ice  = ', rt0_ice , ' K' 
    152  
    153       ro0cpr = 1. / ( rau0 * rcp ) 
    154       IF(lwp) WRITE(numout,*) 
    155       IF(lwp) WRITE(numout,*) '          volumic mass of reference          rau0   = ', rau0, ' kg/m^3' 
    156       IF(lwp) WRITE(numout,*) '          ocean specific heat                rcp    = ', rcp 
    157       IF(lwp) WRITE(numout,*) '                       1. / ( rau0 * rcp ) = ro0cpr = ', ro0cpr 
    158  
    159 #if defined key_lim3 
    160       xlsn = lfus * rhosn        ! volumetric latent heat fusion of snow [J/m3] 
    161 #else 
    162       lfus = xlsn / rhosn        ! latent heat of fusion of fresh ice 
    163 #endif 
    164  
    165       IF(lwp) THEN 
     123         WRITE(numout,*) 
     124         WRITE(numout,*) '       Constants' 
     125         WRITE(numout,*) 
     126         WRITE(numout,*) '          mathematical constant                 rpi = ', rpi 
     127         WRITE(numout,*) '          day                                rday   = ', rday,   ' s' 
     128         WRITE(numout,*) '          sideral year                       rsiyea = ', rsiyea, ' s' 
     129         WRITE(numout,*) '          sideral day                        rsiday = ', rsiday, ' s' 
     130         WRITE(numout,*) '          omega                              omega  = ', omega,  ' s-1' 
     131         WRITE(numout,*) 
     132         WRITE(numout,*) '          nb of months per year               raamo = ', raamo, ' months' 
     133         WRITE(numout,*) '          nb of hours per day                 rjjhh = ', rjjhh, ' hours' 
     134         WRITE(numout,*) '          nb of minutes per hour              rhhmm = ', rhhmm, ' mn' 
     135         WRITE(numout,*) '          nb of seconds per minute            rmmss = ', rmmss, ' s' 
     136         WRITE(numout,*) 
     137         WRITE(numout,*) '          earth radius                         ra   = ', ra, ' m' 
     138         WRITE(numout,*) '          gravity                              grav = ', grav , ' m/s^2' 
     139         WRITE(numout,*) 
     140         WRITE(numout,*) '          triple point of temperature      rtt      = ', rtt     , ' K' 
     141         WRITE(numout,*) '          freezing point of water          rt0      = ', rt0     , ' K' 
     142         WRITE(numout,*) '          melting point of snow            rt0_snow = ', rt0_snow, ' K' 
     143         WRITE(numout,*) '          melting point of ice             rt0_ice  = ', rt0_ice , ' K' 
     144         WRITE(numout,*) 
     145         WRITE(numout,*) '          ocean reference volumic mass       rau0   = ', rau0 , ' kg/m^3' 
     146         WRITE(numout,*) '          ocean reference specific volume    rau0r  = ', rau0r, ' m^3/Kg' 
     147         WRITE(numout,*) '          ocean specific heat                rcp    = ', rcp 
     148         WRITE(numout,*) '                       1. / ( rau0 * rcp ) = ro0cpr = ', ro0cpr 
    166149         WRITE(numout,*) 
    167150         WRITE(numout,*) '          thermal conductivity of the snow          = ', rcdsn   , ' J/s/m/K' 
     
    187170         WRITE(numout,*) '          von Karman constant                       = ', vkarmn  
    188171         WRITE(numout,*) '          Stefan-Boltzmann constant                 = ', stefan  , ' J/s/m^2/K^4' 
    189  
    190172         WRITE(numout,*) 
    191173         WRITE(numout,*) '          conversion: degre ==> radian          rad = ', rad 
    192  
    193174         WRITE(numout,*) 
    194175         WRITE(numout,*) '          smallest real computer value       rsmall = ', rsmall 
Note: See TracChangeset for help on using the changeset viewer.