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 945 for trunk/NEMO/TOP_SRC/trcdta.F90 – NEMO

Ignore:
Timestamp:
2008-05-14T18:14:53+02:00 (16 years ago)
Author:
cetlod
Message:

Update modules for new version of TOP model, see ticket 144

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/TOP_SRC/trcdta.F90

    r719 r945  
    22   !!====================================================================== 
    33   !!                     ***  MODULE  trcdta  *** 
    4    !! Ocean data :  reads passive tracer data  
     4   !! TOP :  reads passive tracer data  
    55   !!===================================================================== 
    6    !!  TOP 1.0,  LOCEAN-IPSL (2005)  
    7    !! $Header$  
    8    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
    9    !!---------------------------------------------------------------------- 
    10  
    11 #if  defined key_passivetrc && defined key_dtatrc 
    12    !!---------------------------------------------------------------------- 
    13    !!   'key_dtatrc'                           3D tracer data field 
     6   !! History :   1.0  !  2002-04  (O. Aumont)  original code 
     7   !!              -   !  2004-03  (C. Ethe)  module 
     8   !!              -   !  2005-03  (O. Aumont, A. El Moussaoui) F90 
     9   !!---------------------------------------------------------------------- 
     10#if  defined key_top  &&  defined key_dtatrc 
     11   !!---------------------------------------------------------------------- 
     12   !!   'key_top'  and  'key_dtatrc'        TOP model + passive tracer data 
    1413   !!---------------------------------------------------------------------- 
    1514   !!   dta_trc      : read ocean passive tracer data 
    1615   !!---------------------------------------------------------------------- 
    17    !! * Modules used 
    1816   USE oce_trc 
     17   USE par_trc 
    1918   USE trc 
    20    USE par_sms 
    2119   USE lib_print 
     20   USE iom 
    2221 
    2322   IMPLICIT NONE 
    2423   PRIVATE 
    2524 
    26    !! * Routine accessibility 
    27    PUBLIC dta_trc   ! called by trcdtr.F90 and trcdmp.F90 
    28  
    29    !! * Shared module variables 
    30    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk,jptra) ::   &  !: 
    31       trdta             !: tracer data at given time-step 
    32  
    33    !! * Module variables 
    34    REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,2) ::   & 
    35       tracdta            ! tracer data at two consecutive times 
    36    INTEGER , DIMENSION(jptra) :: & 
    37       nlectr  ,   &    !!: switch for reading once 
    38       ntrc1   ,   &    !!: number of first month when reading 12 monthly value 
    39       ntrc2            !!: number of second month when reading 12 monthly value 
     25   PUBLIC dta_trc   ! called in trcdtr.F90 and trcdmp.F90 
     26 
     27   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk,jptra) ::   trdta   !: tracer data at given time-step 
     28 
     29   REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,2) ::   tracdta            ! tracer data at two consecutive times 
     30   INTEGER , DIMENSION(jptra) ::   nlectr      !: switch for reading once 
     31   INTEGER , DIMENSION(jptra) ::   ntrc1       !: number of first month when reading 12 monthly value 
     32   INTEGER , DIMENSION(jptra) ::   ntrc2       !: number of second month when reading 12 monthly value 
    4033 
    4134   !! * Substitutions 
    42 #  include "passivetrc_substitute.h90" 
    43  
    44    !!---------------------------------------------------------------------- 
    45    !!   OPA 9.0 , LODYC-IPSL  (2003) 
     35#  include "top_substitute.h90" 
     36   !!---------------------------------------------------------------------- 
     37   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)  
     38   !! $Header:$  
     39   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4640   !!---------------------------------------------------------------------- 
    4741 
     
    6458      !!      At each time step, a linear interpolation is applied between  
    6559      !!      two monthly values. 
     60      !!---------------------------------------------------------------------- 
     61      INTEGER, INTENT( in ) ::   kt     ! ocean time-step 
    6662      !! 
    67       !! History : 
    68       !!   8.2  !  02-04  (O. Aumont)  Original code 
    69       !!   9.0  !  04-03  (C. Ethe)     
    70       !!   9.0  !  05-03  (O. Aumont and A. El Moussaoui) F90 
    71       !!---------------------------------------------------------------------- 
    72       !! * Modules used 
    73       USE iom 
    74  
    75       !! * Arguments 
    76       INTEGER, INTENT( in ) ::   kt     ! ocean time-step 
    77  
    78       !! * Local declarations 
    79       INTEGER :: ji, jj, jn, jl  
    80       INTEGER, PARAMETER ::  & 
    81          jpmois  = 12        ! number of months 
    82  
    83       INTEGER ::   & 
    84          imois, iman, i15, ik  ! temporary integers  
    85       CHARACTER (len=39) :: clname(jptra) 
    86       REAL(wp) :: zxy, zl 
     63      CHARACTER (len=39) ::   clname(jptra) 
     64      INTEGER, PARAMETER ::   jpmois  = 12        ! number of months 
     65      INTEGER ::   ji, jj, jn, jl  
     66      INTEGER ::   imois, iman, i15, ik  ! temporary integers  
     67      REAL(wp) ::   zxy, zl 
    8768      !!---------------------------------------------------------------------- 
    8869 
     
    11394               IF(lwp) WRITE(numout,*) ' trc_dta : Levitus tracer data monthly fields' 
    11495               ! open file  
    115 #if defined key_trc_pisces 
     96# if defined key_pisces 
    11697               clname(jn) = 'LEVITUS_'//ctrcnm(jn) 
    117 #else 
     98# else 
    11899               clname(jn) = ctrcnm(jn) 
    119 #endif 
     100# endif 
    120101               CALL iom_open ( clname(jn), numtr(jn) )               
    121102 
    122103            ENDIF 
    123104 
    124 #if defined key_trc_pisces 
     105# if defined key_pisces 
    125106            ! Read montly file 
    126107            IF( ( kt == nittrc000 .AND. nlectr(jn) == 0)  .OR. imois /= ntrc1(jn) ) THEN 
     
    161142                           ik = mbathy(ji,jj) - 1 
    162143                           IF( ik > 2 ) THEN 
    163                               zl = ( gdept(ik) - fsdept(ji,jj,ik) ) / ( gdept(ik) - gdept(ik-1) ) 
    164                               tracdta(ji,jj,ik,jn,jl) = (1.-zl) * tracdta(ji,jj,ik,jn,jl) + zl * tracdta(ji,jj,ik-1,jn,jl) 
     144                              zl = ( gdept_0(ik) - fsdept(ji,jj,ik) ) / ( gdept_0(ik) - gdept_0(ik-1) ) 
     145                              tracdta(ji,jj,ik,jn,jl) = (1.-zl) * tracdta(ji,jj,ik  ,jn,jl)   & 
     146                                 &                    +     zl  * tracdta(ji,jj,ik-1,jn,jl) 
    165147                           ENDIF 
    166148                        END DO 
     
    173155 
    174156            IF(lwp) THEN 
    175                WRITE(numout,*) ctrcnm(jn), 'Levitus month ', ntrc1(jn),   & 
    176                   ntrc2(jn) 
     157               WRITE(numout,*) ctrcnm(jn), 'Levitus month ', ntrc1(jn), ntrc2(jn) 
    177158               WRITE(numout,*) 
    178                WRITE(numout,*) ' Levitus month = ', ntrc1(jn),   & 
    179                   '  level = 1' 
     159               WRITE(numout,*) ' Levitus month = ', ntrc1(jn), '  level = 1' 
    180160               CALL prihre( tracdta(1,1,1,jn,1), jpi, jpj, 1, jpi, 20, 1   & 
    181                   ,jpj, 20, 1., numout ) 
    182                WRITE(numout,*) ' Levitus month = ', ntrc1(jn),    & 
    183                   '  level = ',jpk/2 
     161                  &        ,jpj, 20, 1., numout ) 
     162               WRITE(numout,*) ' Levitus month = ', ntrc1(jn), '  level = ',jpk/2 
    184163               CALL prihre( tracdta(1,1,jpk/2,jn,1), jpi, jpj, 1, jpi,    & 
    185                   20, 1, jpj, 20, 1., numout ) 
    186                WRITE(numout,*) ' Levitus month = ',ntrc1(jn)     & 
    187                   ,'  level = ',jpkm1 
     164                  &         20, 1, jpj, 20, 1., numout ) 
     165               WRITE(numout,*) ' Levitus month = ',ntrc1(jn),'  level = ',jpkm1 
    188166               CALL prihre( tracdta(1,1,jpkm1,jn,1), jpi, jpj, 1, jpi,     & 
    189                   20, 1, jpj, 20, 1., numout ) 
     167                  &         20, 1, jpj, 20, 1., numout ) 
    190168            ENDIF 
    191169 
    192170            ! At every time step compute temperature data 
    193  
    194171            zxy = FLOAT( nday + 15 - 30 * i15 ) / 30. 
    195             trdta(:,:,:,jn)=  ( 1. - zxy ) * tracdta(:,:,:,jn,1)    & 
    196                +       zxy   * tracdta(:,:,:,jn,2)  
    197  
    198             IF( jn == jpno3) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 7.6E-6 
    199             IF( jn == jpdic) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 1.E-6 
    200             IF( jn == jptal) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 1.E-6 
    201             IF( jn == jpoxy) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 44.6E-6 
    202             IF( jn == jpsil) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 1.E-6 
    203             IF( jn == jppo4) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 122.E-6 
     172            trdta(:,:,:,jn) =  ( 1. - zxy ) * tracdta(:,:,:,jn,1)    & 
     173               &              +       zxy   * tracdta(:,:,:,jn,2)  
     174 
     175            IF( jn == jpno3 )   trdta(:,:,:,jn) = trdta(:,:,:,jn) *   7.6e-6 
     176            IF( jn == jpdic )   trdta(:,:,:,jn) = trdta(:,:,:,jn) *   1.0e-6 
     177            IF( jn == jptal )   trdta(:,:,:,jn) = trdta(:,:,:,jn) *   1.0e-6 
     178            IF( jn == jpoxy )   trdta(:,:,:,jn) = trdta(:,:,:,jn) *  44.6e-6 
     179            IF( jn == jpsil )   trdta(:,:,:,jn) = trdta(:,:,:,jn) *   1.0e-6 
     180            IF( jn == jppo4 )   trdta(:,:,:,jn) = trdta(:,:,:,jn) * 122.0e-6 
    204181 
    205182            ! Close the file 
    206183            ! -------------- 
    207184             
    208             IF( kt == nitend )   CALL iom_close ( numtr(jn) ) 
    209  
    210 #else 
     185            IF( kt == nitend )   CALL iom_close( numtr(jn) ) 
     186 
     187# else 
    211188            ! Read init file only 
    212189            IF( kt == nittrc000  ) THEN 
     
    215192               CALL iom_close ( numtr(jn) ) 
    216193            ENDIF  
    217 #endif 
    218  
    219         ENDIF 
    220  
    221        END DO 
    222  
     194# endif 
     195 
     196         ENDIF 
     197 
     198      END DO 
     199      ! 
    223200   END SUBROUTINE dta_trc 
    224201 
    225202#else 
    226  
    227    !!---------------------------------------------------------------------- 
    228    !!   Default case                        NO 3D passive tracer data field 
     203   !!---------------------------------------------------------------------- 
     204   !!   Dummy module                              NO 3D passive tracer data 
    229205   !!---------------------------------------------------------------------- 
    230206CONTAINS 
     
    232208      WRITE(*,*) 'dta_trc: You should not have seen this print! error?', kt 
    233209   END SUBROUTINE dta_trc 
    234  
    235210#endif 
    236211 
     212   !!====================================================================== 
    237213END MODULE trcdta 
Note: See TracChangeset for help on using the changeset viewer.