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 775 for branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zday.F90 – NEMO

Ignore:
Timestamp:
2007-12-19T14:45:15+01:00 (16 years ago)
Author:
gm
Message:

dev_001_GM - PISCES in F90 : encapsulation of all p4z...F files in module F90 + doctor norme for local variables - compilation OK

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/dev_001_GM/NEMO/TOP_SRC/PISCES_SMS/p4zday.F90

    r774 r775  
    1 CCC$Header$ 
    2 CCC  TOP 1.0 , LOCEAN-IPSL (2005) 
    3 C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
    4 C --------------------------------------------------------------------------- 
    5 CDIR$ LIST 
    6       SUBROUTINE p4zday 
    7 #if defined key_top && defined key_pisces 
    8 CCC--------------------------------------------------------------------- 
    9 CCC 
    10 CCC          ROUTINE p4zday : PISCES MODEL 
    11 CCC          ***************************** 
    12 CCC 
    13 CCC  PURPOSE : 
    14 CCC  --------- 
    15 CCC        PISCES : compute the day length depending on latitude 
    16 CCC                 and the day 
    17 CCC 
    18 CC   INPUT : 
    19 CC   ----- 
    20 CC      argument 
    21 CC              ktask           : task identificator 
    22 CC      common 
    23 CC              all the common defined in opa 
    24 CC 
    25 CC 
    26 CC   OUTPUT :                   : no 
    27 CC   ------ 
    28 CC 
    29 CC   EXTERNAL : 
    30 CC   -------- 
    31 CC            None 
    32 CC 
    33 CC   MODIFICATIONS: 
    34 CC   -------------- 
    35 CC      original  : E. Maier-Reimer (GBC 1993) 
    36 CC      additions : C. Le Quere (1999) 
    37 CC      modifications : O. Aumont (2004) 
    38 CC---------------------------------------------------------------------- 
    39 CC parameters and commons 
    40 CC ====================== 
    41       USE oce_trc 
    42       USE trp_trc 
    43       USE sms 
    44       IMPLICIT NONE 
    45 CC---------------------------------------------------------------------- 
    46 CC local declarations 
    47 CC ================== 
    48       INTEGER ji, jj, iyy 
    49       REAL rum, delta, codel, phi, argu 
    50 C 
    51 C Get year 
    52 C -------- 
    53 C 
    54       iyy = ndastp/10000 
     1MODULE p4zday 
     2   !!====================================================================== 
     3   !!                         ***  MODULE p4zday  *** 
     4   !! TOP :   PISCES compute the day length depending on latitude and the day 
     5   !!====================================================================== 
     6   !! History :    -   !  1993     (E. Maier-Reimer) Original code GBC 1993 
     7   !!              -   !  1999     (C. Le Quere) 
     8   !!             1.0  !  2004     (O. Aumont) Original code 
     9   !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90 
     10   !!---------------------------------------------------------------------- 
     11#if defined key_pisces 
     12   !!---------------------------------------------------------------------- 
     13   !!   'key_pisces'                                       PISCES bio-model 
     14   !!---------------------------------------------------------------------- 
     15   !!   p4z_day       :   compute the day length depending on latitude and the day 
     16   !!---------------------------------------------------------------------- 
     17   USE oce_trc         ! 
     18   USE trp_trc         !  
     19   USE sms             !  
    5520 
    56        IF(lwp) write(numout,*) 
    57        IF(lwp) write(numout,*) 'p4zday - Julian day ', nday_year 
    58        IF(lwp) write(numout,*) 
     21   IMPLICIT NONE 
     22   PRIVATE 
     23 
     24   PUBLIC   p4z_day    ! called in p4zprod.F90 
     25 
     26   !!* Substitution 
     27#  include "domzgr_substitute.h90" 
     28   !!---------------------------------------------------------------------- 
     29   !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)  
     30   !! $Header:$  
     31   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     32   !!---------------------------------------------------------------------- 
     33 
     34CONTAINS 
     35 
     36   SUBROUTINE p4z_day 
     37      !!--------------------------------------------------------------------- 
     38      !!                     ***  ROUTINE p4z_day  *** 
     39      !! 
     40      !! ** Purpose :   compute the day length depending on latitude and the day 
     41      !! 
     42      !! ** Method  : - ??? 
     43      !!--------------------------------------------------------------------- 
     44      INTEGER  ::   ji, jj 
     45      INTEGER  ::   iyy 
     46      REAL(wp) ::   zrum, zdelta, zcodel, zphi, zargu 
     47      !!--------------------------------------------------------------------- 
     48 
     49      ! Get year 
     50      ! -------- 
     51 
     52      iyy = ndastp / 10000 
     53 
     54      IF(lwp) write(numout,*) 
     55      IF(lwp) write(numout,*) 'p4zday : - Julian day ', nday_year 
     56      IF(lwp) write(numout,*) '~~~~~~' 
    5957 
    6058 
    61       IF (nleapy.EQ.1 .AND. MOD(iyy,4).EQ.0) THEN 
    62           rum = FLOAT(nday_year-80)/366. 
     59      IF( nleapy == 1 .AND. MOD( iyy, 4 ) == 0 ) THEN 
     60         zrum = FLOAT( nday_year - 80 ) / 366. 
    6361      ELSE 
    64           rum = FLOAT(nday_year-80)/365. 
     62         zrum = FLOAT( nday_year - 80 ) / 365. 
    6563      ENDIF 
    6664 
    67 C 
    68       delta = SIN(rum*rpi*2.)*sin(rpi*23.5/180.) 
    69       codel = asin(delta) 
     65      zdelta = SIN( zrum * rpi * 2. ) * sin( rpi * 23.5 / 180. ) 
     66      zcodel = ASIN( zdelta ) 
    7067 
    71       DO jj = 1,jpj 
    72         DO ji = 1,jpi 
    73           phi = gphit(ji,jj)*rpi/180. 
    74           argu = tan(codel)*tan(phi) 
    75           strn(ji,jj) = 0. 
    76           argu=min(1.,argu) 
    77           argu=max(-1.,argu) 
    78           strn(ji,jj)=24.-2.*acos(argu)*180./rpi/15. 
    79           strn(ji,jj)=max(strn(ji,jj),0.) 
    80         END DO 
     68      DO jj = 1, jpj 
     69         DO ji = 1, jpi 
     70            zphi = gphit(ji,jj) * rpi / 180. 
     71            zargu = TAN( zcodel ) * TAN( zphi ) 
     72            strn(ji,jj) = 0.e0 
     73            zargu = MIN(  1., zargu ) 
     74            zargu = MAX( -1., zargu ) 
     75            strn(ji,jj) = 24.- 2.* ACOS( zargu ) * 180./ rpi / 15. 
     76            strn(ji,jj) = MAX( strn(ji,jj), 0.e0 ) 
     77         END DO 
    8178      END DO 
    82 C 
    83 #endif 
    84       RETURN 
    85       END 
     79      ! 
     80   END SUBROUTINE p4z_day 
     81 
     82#else 
     83   !!====================================================================== 
     84   !!  Dummy module :                                   No PISCES bio-model 
     85   !!====================================================================== 
     86CONTAINS 
     87   SUBROUTINE p4z_day                    ! Empty routine 
     88   END SUBROUTINE p4z_day 
     89#endif  
     90 
     91   !!====================================================================== 
     92END MODULE  p4zday 
Note: See TracChangeset for help on using the changeset viewer.