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 1601 for trunk/NEMO/OPA_SRC/TRD/trdmld.F90 – NEMO

Ignore:
Timestamp:
2009-08-11T12:09:19+02:00 (15 years ago)
Author:
ctlod
Message:

Doctor naming of OPA namelist variables , see ticket: #526

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/TRD/trdmld.F90

    r1581 r1601  
    7575      !!      The control surface can be either a mixed layer depth (time varying) 
    7676      !!      or a fixed surface (jk level or bowl).  
    77       !!      Choose control surface with nctls in namelist NAMTRD : 
    78       !!        nctls = 0  : use mixed layer with density criterion  
    79       !!        nctls = 1  : read index from file 'ctlsurf_idx' 
    80       !!        nctls > 1  : use fixed level surface jk = nctls 
     77      !!      Choose control surface with nn_ctls in namelist NAMTRD : 
     78      !!        nn_ctls = 0  : use mixed layer with density criterion  
     79      !!        nn_ctls = 1  : read index from file 'ctlsurf_idx' 
     80      !!        nn_ctls > 1  : use fixed level surface jk = nn_ctls 
    8181      !!      Note: in the remainder of the routine, the volume between the  
    8282      !!            surface and the control surface is called "mixed-layer" 
     
    100100          
    101101         ! ... Set nmld(ji,jj) = index of first T point below control surf. or outside mixed-layer 
    102          IF( nctls == 0 ) THEN       ! * control surface = mixed-layer with density criterion  
     102         IF( nn_ctls == 0 ) THEN       ! * control surface = mixed-layer with density criterion  
    103103            nmld(:,:) = nmln(:,:)    ! array nmln computed in zdfmxl.F90 
    104          ELSE IF( nctls == 1 ) THEN  ! * control surface = read index from file  
     104         ELSE IF( nn_ctls == 1 ) THEN  ! * control surface = read index from file  
    105105            nmld(:,:) = nbol(:,:) 
    106          ELSE IF( nctls >= 2 ) THEN  ! * control surface = model level 
    107             nctls = MIN( nctls, jpktrd - 1 ) 
    108             nmld(:,:) = nctls + 1 
     106         ELSE IF( nn_ctls >= 2 ) THEN  ! * control surface = model level 
     107            nn_ctls = MIN( nn_ctls, jpktrd - 1 ) 
     108            nmld(:,:) = nn_ctls + 1 
    109109         ENDIF 
    110110 
     
    193193      !!          1) to explain the difference between initial and final  
    194194      !!             mixed-layer T & S (where initial and final relate to the 
    195       !!             current analysis window, defined by ntrd in the namelist) 
     195      !!             current analysis window, defined by nn_trd in the namelist) 
    196196      !!          2) to explain the difference between the current and previous  
    197197      !!             TIME-AVERAGED mixed-layer T & S (where time-averaging is 
     
    199199      !! 
    200200      !! ** Consistency check :  
    201       !!        If the control surface is fixed ( nctls > 1 ), the residual term (dh/dt 
     201      !!        If the control surface is fixed ( nn_ctls > 1 ), the residual term (dh/dt 
    202202      !!        entrainment) should be zero, at machine accuracy. Note that in the case 
    203203      !!        of time-averaged mixed-layer fields, this residual WILL NOT BE ZERO 
    204204      !!        over the first two analysis windows (except if restart). 
    205       !!        N.B. For ORCA2_LIM, use e.g. ntrd=5, ucf=1., nctls=8 
     205      !!        N.B. For ORCA2_LIM, use e.g. nn_trd=5, rn_ucf=1., nn_ctls=8 
    206206      !!             for checking residuals. 
    207207      !!             On a NEC-SX5 computer, this typically leads to: 
     
    351351      ! 
    352352      !     o---[--o-----o-----o-----o--]-[--o-----o-----o-----o-----o--]---o-----o--> time steps 
    353       !                            ntrd                             2*ntrd       etc. 
     353      !                          nn_trd                           2*nn_trd       etc. 
    354354      !     1      2     3     4    =5 e.g.                          =10 
    355355      ! 
     
    386386      ! N.B. It may be useful to check IOIPSL time averaging with : 
    387387      !      tmltrd (:,:,:) = 1. ; smltrd (:,:,:) = 1. 
    388       tmltrd(:,:,:) = tmltrd(:,:,:) * ucf   ! (actually needed for 1:jpltrd-1, but trdmld(:,:,jpltrd) 
    389       smltrd(:,:,:) = smltrd(:,:,:) * ucf   !  is no longer used, and is reset to 0. at next time step) 
     388      tmltrd(:,:,:) = tmltrd(:,:,:) * rn_ucf   ! (actually needed for 1:jpltrd-1, but trdmld(:,:,jpltrd) 
     389      smltrd(:,:,:) = smltrd(:,:,:) * rn_ucf   !  is no longer used, and is reset to 0. at next time step) 
    390390       
    391391      ! define time axis 
     
    393393      itmod = kt - nit000 + 1 
    394394 
    395       MODULO_NTRD : IF( MOD( itmod, ntrd ) == 0 ) THEN        ! nitend MUST be multiple of ntrd 
     395      MODULO_NTRD : IF( MOD( itmod, nn_trd ) == 0 ) THEN        ! nitend MUST be multiple of nn_trd 
    396396         ! 
    397397         ztmltot (:,:) = 0.e0   ;   zsmltot (:,:) = 0.e0   ! reset arrays to zero 
     
    519519 
    520520         !    ... temperature ...                         ... salinity ... 
    521          ztmltot (:,:)   = ztmltot(:,:)   * ucf/zfn  ; zsmltot (:,:)   = zsmltot(:,:)   * ucf/zfn 
    522          ztmlres (:,:)   = ztmlres(:,:)   * ucf/zfn  ; zsmlres (:,:)   = zsmlres(:,:)   * ucf/zfn 
    523          ztmlatf (:,:)   = ztmlatf(:,:)   * ucf/zfn  ; zsmlatf (:,:)   = zsmlatf(:,:)   * ucf/zfn 
     521         ztmltot (:,:)   = ztmltot(:,:)   * rn_ucf/zfn  ; zsmltot (:,:)   = zsmltot(:,:)   * rn_ucf/zfn 
     522         ztmlres (:,:)   = ztmlres(:,:)   * rn_ucf/zfn  ; zsmlres (:,:)   = zsmlres(:,:)   * rn_ucf/zfn 
     523         ztmlatf (:,:)   = ztmlatf(:,:)   * rn_ucf/zfn  ; zsmlatf (:,:)   = zsmlatf(:,:)   * rn_ucf/zfn 
    524524 
    525525         tml_sum (:,:)   = tml_sum (:,:)  /  (2*zfn) ; sml_sum (:,:)   = sml_sum (:,:)  /  (2*zfn) 
    526          ztmltot2(:,:)   = ztmltot2(:,:)  * ucf/zfn2 ; zsmltot2(:,:)   = zsmltot2(:,:)  * ucf/zfn2 
    527          ztmltrd2(:,:,:) = ztmltrd2(:,:,:)* ucf/zfn2 ; zsmltrd2(:,:,:) = zsmltrd2(:,:,:)* ucf/zfn2 
    528          ztmlatf2(:,:)   = ztmlatf2(:,:)  * ucf/zfn2 ; zsmlatf2(:,:)   = zsmlatf2(:,:)  * ucf/zfn2 
    529          ztmlres2(:,:)   = ztmlres2(:,:)  * ucf/zfn2 ; zsmlres2(:,:)   = zsmlres2(:,:)  * ucf/zfn2 
     526         ztmltot2(:,:)   = ztmltot2(:,:)  * rn_ucf/zfn2 ; zsmltot2(:,:)   = zsmltot2(:,:)  * rn_ucf/zfn2 
     527         ztmltrd2(:,:,:) = ztmltrd2(:,:,:)* rn_ucf/zfn2 ; zsmltrd2(:,:,:) = zsmltrd2(:,:,:)* rn_ucf/zfn2 
     528         ztmlatf2(:,:)   = ztmlatf2(:,:)  * rn_ucf/zfn2 ; zsmlatf2(:,:)   = zsmlatf2(:,:)  * rn_ucf/zfn2 
     529         ztmlres2(:,:)   = ztmlres2(:,:)  * rn_ucf/zfn2 ; zsmlres2(:,:)   = zsmlres2(:,:)  * rn_ucf/zfn2 
    530530 
    531531         rmld_sum(:,:)   = rmld_sum(:,:)  /  (2*zfn)  ! similar to tml_sum and sml_sum 
     
    578578#if defined key_dimgout 
    579579 
    580       IF( MOD( itmod, ntrd ) == 0 ) THEN 
     580      IF( MOD( itmod, nn_trd ) == 0 ) THEN 
    581581         iyear =  ndastp/10000 
    582582         imon  = (ndastp-iyear*10000)/100 
    583583         iday  =  ndastp - imon*100 - iyear*10000 
    584584         WRITE(clname,9000) TRIM(cexper),'MLDiags',iyear,imon,iday 
    585          WRITE(clmode,'(f5.1,a)') ntrd*rdt/86400.,' days average' 
     585         WRITE(clmode,'(f5.1,a)') nn_trd*rdt/86400.,' days average' 
    586586         cltext = TRIM(cexper)//' mld diags'//TRIM(clmode) 
    587587         CALL dia_wri_dimg (clname, cltext, smltrd, jpltrd, '2') 
     
    595595      ! ---------------------------------- 
    596596 
    597       IF( lwp .AND. MOD( itmod , ntrd ) == 0 ) THEN 
     597      IF( lwp .AND. MOD( itmod , nn_trd ) == 0 ) THEN 
    598598         WRITE(numout,*) ' ' 
    599599         WRITE(numout,*) 'trd_mld : write trends in the NetCDF file :' 
     
    685685#endif 
    686686 
    687       IF( MOD( itmod, ntrd ) == 0 ) THEN 
     687      IF( MOD( itmod, nn_trd ) == 0 ) THEN 
    688688         ! 
    689689         ! III.5 Reset cumulative arrays to zero 
     
    744744      ! ------------------------------------------------- 
    745745 
    746       IF( ( lk_trdmld ) .AND. ( MOD( nitend, ntrd ) /= 0 ) ) THEN 
     746      IF( ( lk_trdmld ) .AND. ( MOD( nitend, nn_trd ) /= 0 ) ) THEN 
    747747         WRITE(numout,cform_err) 
    748748         WRITE(numout,*) '                Your nitend parameter, nitend = ', nitend 
    749749         WRITE(numout,*) '                is no multiple of the trends diagnostics frequency        ' 
    750          WRITE(numout,*) '                          you defined, ntrd   = ', ntrd 
     750         WRITE(numout,*) '                          you defined, nn_trd   = ', nn_trd 
    751751         WRITE(numout,*) '                This will not allow you to restart from this simulation.  ' 
    752752         WRITE(numout,*) '                You should reconsider this choice.                        '  
     
    797797      ! ---------------------------------------------- 
    798798  
    799       IF( nctls == 1 ) THEN 
     799      IF( nn_ctls == 1 ) THEN 
    800800         CALL ctl_opn( numbol, 'ctlsurf_idx', 'OLD', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 
    801801         READ ( numbol ) nbol 
     
    811811#else 
    812812      ! clmxl = legend root for netCDF output 
    813       IF( nctls == 0 ) THEN      ! control surface = mixed-layer with density criterion 
     813      IF( nn_ctls == 0 ) THEN      ! control surface = mixed-layer with density criterion 
    814814         clmxl = 'Mixed Layer '  !                   (array nmln computed in zdfmxl.F90) 
    815       ELSE IF( nctls == 1 ) THEN ! control surface = read index from file  
     815      ELSE IF( nn_ctls == 1 ) THEN ! control surface = read index from file  
    816816         clmxl = '      Bowl ' 
    817       ELSE IF( nctls >= 2 ) THEN ! control surface = model level 
    818          WRITE(clmxl,'(A10,I2,1X)') 'Levels 1 -', nctls 
     817      ELSE IF( nn_ctls >= 2 ) THEN ! control surface = model level 
     818         WRITE(clmxl,'(A10,I2,1X)') 'Levels 1 -', nn_ctls 
    819819      END IF 
    820820 
     
    828828         CALL ctl_stop( 'trd_mld : this was never checked. Comment this line to proceed...' ) 
    829829      END IF 
    830       zsto = ntrd * rdt 
     830      zsto = nn_trd * rdt 
    831831      clop = "inst("//TRIM(clop)//")" 
    832832#  else 
     
    834834         zsto = rdt                 ! inst. diags : we use IOIPSL time averaging 
    835835      ELSE 
    836          zsto = ntrd * rdt          ! mean  diags : we DO NOT use any IOIPSL time averaging 
     836         zsto = nn_trd * rdt          ! mean  diags : we DO NOT use any IOIPSL time averaging 
    837837      END IF 
    838838      clop = "ave("//TRIM(clop)//")" 
    839839#  endif 
    840       zout = ntrd * rdt 
     840      zout = nn_trd * rdt 
    841841 
    842842      IF(lwp) WRITE (numout,*) '                netCDF initialization' 
     
    870870                                                                   
    871871      !-- Create a NetCDF file and enter the define mode  
    872       CALL dia_nam( clhstnam, ntrd, 'trends' ) 
     872      CALL dia_nam( clhstnam, nn_trd, 'trends' ) 
    873873      IF(lwp) WRITE(numout,*) ' Name of NETCDF file ', clhstnam 
    874874      CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,                                            & 
     
    880880 
    881881      !-- Define physical units 
    882       IF( ucf == 1. ) THEN 
    883          cltu = "degC/s"     ;   clsu = "p.s.u./s" 
    884       ELSEIF ( ucf == 3600.*24.) THEN 
    885          cltu = "degC/day"   ;   clsu = "p.s.u./day" 
    886       ELSE 
    887          cltu = "unknown?"   ;   clsu = "unknown?" 
    888       END IF 
     882      IF     ( rn_ucf == 1.       ) THEN   ;   cltu = "degC/s"     ;   clsu = "p.s.u./s" 
     883      ELSEIF ( rn_ucf == 3600.*24.) THEN   ;   cltu = "degC/day"   ;   clsu = "p.s.u./day" 
     884      ELSE                                 ;   cltu = "unknown?"   ;   clsu = "unknown?" 
     885      END IF 
     886 
    889887 
    890888      !-- Define miscellaneous T and S mixed-layer variables  
Note: See TracChangeset for help on using the changeset viewer.