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 9169 for branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90 – NEMO

Ignore:
Timestamp:
2017-12-26T17:32:56+01:00 (6 years ago)
Author:
gm
Message:

dev_merge_2017: all SRC: finalize the removal of useless warning when reading namelist_cfg + remove all nn_closea + nn_msh replaced by a logical

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90

    r9125 r9169  
    3232   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    3333   !!---------------------------------------------------------------------- 
    34     
    3534CONTAINS 
    3635 
     
    5049      !!                (the total CFC content is not strictly preserved) 
    5150      !!---------------------------------------------------------------------- 
    52       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index       
     51      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     52      ! 
    5353      CHARACTER (len=22) :: charout 
    5454      !!---------------------------------------------------------------------- 
     
    5656      IF( ln_timing )   CALL timing_start('trc_rad') 
    5757      ! 
    58       IF( kt == nittrc000 ) THEN 
    59          IF(lwp) WRITE(numout,*) 
    60          IF(lwp) WRITE(numout,*) 'trc_rad : Correct artificial negative concentrations ' 
    61          IF(lwp) WRITE(numout,*) '~~~~~~~ ' 
    62       ENDIF 
    63  
    64       IF( ln_age     )   CALL trc_rad_sms( kt, trb, trn, jp_age , jp_age               )  !  AGE 
     58      IF( ln_age     )   CALL trc_rad_sms( kt, trb, trn, jp_age , jp_age                )  !  AGE 
    6559      IF( ll_cfc     )   CALL trc_rad_sms( kt, trb, trn, jp_cfc0, jp_cfc1               )  !  CFC model 
    66       IF( ln_c14     )   CALL trc_rad_sms( kt, trb, trn, jp_c14 , jp_c14               )  !  C14 
     60      IF( ln_c14     )   CALL trc_rad_sms( kt, trb, trn, jp_c14 , jp_c14                )  !  C14 
    6761      IF( ln_pisces  )   CALL trc_rad_sms( kt, trb, trn, jp_pcs0, jp_pcs1, cpreserv='Y' )  !  PISCES model 
    6862      IF( ln_my_trc  )   CALL trc_rad_sms( kt, trb, trn, jp_myt0, jp_myt1               )  !  MY_TRC model 
    69  
    7063      ! 
    7164      IF(ln_ctl) THEN      ! print mean trends (used for debugging) 
     
    7972   END SUBROUTINE trc_rad 
    8073 
     74 
    8175   SUBROUTINE trc_rad_ini 
    8276      !!--------------------------------------------------------------------- 
    8377      !!                  ***  ROUTINE trc _rad_ini *** 
    8478      !! 
    85       !! ** Purpose : read  namelist options  
    86       !!---------------------------------------------------------------------- 
    87       INTEGER ::  ios                 ! Local integer output status for namelist read 
     79      !! ** Purpose :   read  namelist options  
     80      !!---------------------------------------------------------------------- 
     81      INTEGER ::   ios   ! Local integer output status for namelist read 
     82      !! 
    8883      NAMELIST/namtrc_rad/ ln_trcrad 
    8984      !!---------------------------------------------------------------------- 
    90  
    9185      ! 
    9286      REWIND( numnat_ref )              ! namtrc_rad in reference namelist  
    9387      READ  ( numnat_ref, namtrc_rad, IOSTAT = ios, ERR = 907) 
    94 907   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_rad in reference namelist', lwp ) 
    95  
     88907   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrc_rad in reference namelist', lwp ) 
    9689      REWIND( numnat_cfg )              ! namtrc_rad in configuration namelist  
    9790      READ  ( numnat_cfg, namtrc_rad, IOSTAT = ios, ERR = 908 ) 
    98 908   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_rad in configuration namelist', lwp ) 
    99       IF(lwm) WRITE ( numont, namtrc_rad ) 
     91908   IF( ios > 0 )  CALL ctl_nam ( ios , 'namtrc_rad in configuration namelist', lwp ) 
     92      IF(lwm) WRITE( numont, namtrc_rad ) 
    10093 
    10194      IF(lwp) THEN                     !   ! Control print 
    10295         WRITE(numout,*) 
     96         WRITE(numout,*) 'trc_rad : Correct artificial negative concentrations ' 
     97         WRITE(numout,*) '~~~~~~~ ' 
    10398         WRITE(numout,*) '   Namelist namtrc_rad : treatment of negative concentrations' 
    104          WRITE(numout,*) '      correct artificially negative concen. or not ln_trcrad = ', ln_trcrad 
     99         WRITE(numout,*) '      correct artificially negative concen. or not   ln_trcrad = ', ln_trcrad 
     100         WRITE(numout,*) 
     101         IF( ln_trcrad ) THEN   ;   WRITE(numout,*) '      ===>>   ensure the global tracer conservation' 
     102         ELSE                   ;   WRITE(numout,*) '      ===>>   NO strict global tracer conservation'       
     103         ENDIF 
    105104      ENDIF 
    106105      ! 
    107106   END SUBROUTINE trc_rad_ini 
     107 
    108108 
    109109   SUBROUTINE trc_rad_sms( kt, ptrb, ptrn, jp_sms0, jp_sms1, cpreserv ) 
     
    123123      !!                  (the total content of concentration is not strictly preserved) 
    124124      !!-------------------------------------------------------------------------------- 
    125       !! Arguments 
    126       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
    127       INTEGER  , INTENT( in ) ::  & 
    128          jp_sms0, &       !: First index of the passive tracer model 
    129          jp_sms1          !: Last  index of  the passive tracer model 
    130  
    131       REAL(wp), DIMENSION (jpi,jpj,jpk,jptra), INTENT( inout )  :: & 
    132          ptrb, ptrn       !: before and now traceur concentration 
    133  
    134       CHARACTER( len = 1) , INTENT(in), OPTIONAL  :: & 
    135          cpreserv          !: flag to preserve content or not 
    136        
    137       ! Local declarations 
    138       INTEGER  :: ji, jj, jk, jn     ! dummy loop indices 
    139       REAL(wp) :: ztrcorb, ztrmasb   ! temporary scalars 
    140       REAL(wp) :: zcoef, ztrcorn, ztrmasn   !    "         " 
     125      INTEGER                                , INTENT(in   ) ::   kt                 ! ocean time-step index 
     126      INTEGER                                , INTENT(in   ) ::   jp_sms0, jp_sms1   ! First & last index of the passive tracer model 
     127      REAL(wp), DIMENSION (jpi,jpj,jpk,jptra), INTENT(inout) ::   ptrb    , ptrn     ! before and now traceur concentration 
     128      CHARACTER( len = 1), OPTIONAL          , INTENT(in   ) ::   cpreserv           ! flag to preserve content or not 
     129      ! 
     130      INTEGER ::   ji, jj, jk, jn     ! dummy loop indices 
     131      LOGICAL ::   lldebug = .FALSE.           ! local logical 
     132      REAL(wp)::   ztrcorb, ztrmasb, zs2rdt    ! temporary scalars 
     133      REAL(wp)::   zcoef  , ztrcorn, ztrmasn   !    -         - 
    141134      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrtrdb, ztrtrdn   ! workspace arrays 
    142       REAL(wp) :: zs2rdt 
    143       LOGICAL ::   lldebug = .FALSE. 
    144       !!---------------------------------------------------------------------- 
    145  
    146   
    147       IF( l_trdtrc )  ALLOCATE( ztrtrdb(jpi,jpj,jpk), ztrtrdn(jpi,jpj,jpk) ) 
    148        
    149       IF( PRESENT( cpreserv )  ) THEN   !  total tracer concentration is preserved  
    150        
     135      !!---------------------------------------------------------------------- 
     136      ! 
     137      IF( l_trdtrc )   ALLOCATE( ztrtrdb(jpi,jpj,jpk), ztrtrdn(jpi,jpj,jpk) ) 
     138      ! 
     139      IF( PRESENT( cpreserv )  ) THEN     !==  total tracer concentration is preserved  ==! 
     140         ! 
    151141         DO jn = jp_sms0, jp_sms1 
    152             !                                                        ! =========== 
    153             ztrcorb = 0.e0   ;   ztrmasb = 0.e0 
    154             ztrcorn = 0.e0   ;   ztrmasn = 0.e0 
    155  
     142            ! 
     143            ztrcorb = 0._wp   ;   ztrmasb = 0._wp 
     144            ztrcorn = 0._wp   ;   ztrmasn = 0._wp 
     145            ! 
    156146            IF( l_trdtrc ) THEN 
    157147               ztrtrdb(:,:,:) = ptrb(:,:,:,jn)                        ! save input trb for trend computation 
     
    161151            ztrcorb = glob_sum( MIN( 0., ptrb(:,:,:,jn) ) * cvol(:,:,:) ) 
    162152            ztrcorn = glob_sum( MIN( 0., ptrn(:,:,:,jn) ) * cvol(:,:,:) ) 
    163  
     153            ! 
    164154            ztrmasb = glob_sum( MAX( 0., ptrb(:,:,:,jn) ) * cvol(:,:,:) ) 
    165155            ztrmasn = glob_sum( MAX( 0., ptrn(:,:,:,jn) ) * cvol(:,:,:) ) 
    166  
     156            ! 
    167157            IF( ztrcorb /= 0 ) THEN 
    168158               zcoef = 1. + ztrcorb / ztrmasb 
     
    172162               END DO 
    173163            ENDIF 
    174  
     164            ! 
    175165            IF( ztrcorn /= 0 ) THEN 
    176166               zcoef = 1. + ztrcorn / ztrmasn 
     
    190180              ! 
    191181            ENDIF 
    192  
     182            ! 
    193183         END DO 
    194184         ! 
    195          ! 
    196       ELSE  ! total CFC content is not strictly preserved 
    197  
     185      ELSE                                !==  total CFC content is NOT strictly preserved  ==! 
     186         ! 
    198187         DO jn = jp_sms0, jp_sms1   
    199  
    200            IF( l_trdtrc ) THEN 
    201               ztrtrdb(:,:,:) = ptrb(:,:,:,jn)                        ! save input trb for trend computation 
    202               ztrtrdn(:,:,:) = ptrn(:,:,:,jn)                        ! save input trn for trend computation 
    203            ENDIF 
    204  
     188            ! 
     189            IF( l_trdtrc ) THEN 
     190               ztrtrdb(:,:,:) = ptrb(:,:,:,jn)                        ! save input trb for trend computation 
     191               ztrtrdn(:,:,:) = ptrn(:,:,:,jn)                        ! save input trn for trend computation 
     192            ENDIF 
     193            ! 
    205194            DO jk = 1, jpkm1 
    206195               DO jj = 1, jpj 
     
    211200               END DO 
    212201            END DO 
    213           
     202            ! 
    214203            IF( l_trdtrc ) THEN 
    215204               ! 
     
    222211            ENDIF 
    223212            ! 
    224          ENDDO 
    225  
     213         END DO 
     214         ! 
    226215      ENDIF 
    227  
     216      ! 
    228217      IF( l_trdtrc )  DEALLOCATE( ztrtrdb, ztrtrdn ) 
    229  
     218      ! 
    230219   END SUBROUTINE trc_rad_sms 
     220 
    231221#else 
    232222   !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.