Changeset 1601 for trunk/NEMO/OPA_SRC/TRD/trdmld.F90
- Timestamp:
- 2009-08-11T12:09:19+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/TRD/trdmld.F90
r1581 r1601 75 75 !! The control surface can be either a mixed layer depth (time varying) 76 76 !! or a fixed surface (jk level or bowl). 77 !! Choose control surface with n ctls in namelist NAMTRD :78 !! n ctls = 0 : use mixed layer with density criterion79 !! n ctls = 1 : read index from file 'ctlsurf_idx'80 !! n ctls > 1 : use fixed level surface jk = nctls77 !! 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 81 81 !! Note: in the remainder of the routine, the volume between the 82 82 !! surface and the control surface is called "mixed-layer" … … 100 100 101 101 ! ... Set nmld(ji,jj) = index of first T point below control surf. or outside mixed-layer 102 IF( n ctls == 0 ) THEN ! * control surface = mixed-layer with density criterion102 IF( nn_ctls == 0 ) THEN ! * control surface = mixed-layer with density criterion 103 103 nmld(:,:) = nmln(:,:) ! array nmln computed in zdfmxl.F90 104 ELSE IF( n ctls == 1 ) THEN ! * control surface = read index from file104 ELSE IF( nn_ctls == 1 ) THEN ! * control surface = read index from file 105 105 nmld(:,:) = nbol(:,:) 106 ELSE IF( n ctls >= 2 ) THEN ! * control surface = model level107 n ctls = MIN( nctls, jpktrd - 1 )108 nmld(:,:) = n ctls + 1106 ELSE IF( nn_ctls >= 2 ) THEN ! * control surface = model level 107 nn_ctls = MIN( nn_ctls, jpktrd - 1 ) 108 nmld(:,:) = nn_ctls + 1 109 109 ENDIF 110 110 … … 193 193 !! 1) to explain the difference between initial and final 194 194 !! mixed-layer T & S (where initial and final relate to the 195 !! current analysis window, defined by n trd in the namelist)195 !! current analysis window, defined by nn_trd in the namelist) 196 196 !! 2) to explain the difference between the current and previous 197 197 !! TIME-AVERAGED mixed-layer T & S (where time-averaging is … … 199 199 !! 200 200 !! ** Consistency check : 201 !! If the control surface is fixed ( n ctls > 1 ), the residual term (dh/dt201 !! If the control surface is fixed ( nn_ctls > 1 ), the residual term (dh/dt 202 202 !! entrainment) should be zero, at machine accuracy. Note that in the case 203 203 !! of time-averaged mixed-layer fields, this residual WILL NOT BE ZERO 204 204 !! over the first two analysis windows (except if restart). 205 !! N.B. For ORCA2_LIM, use e.g. n trd=5, ucf=1., nctls=8205 !! N.B. For ORCA2_LIM, use e.g. nn_trd=5, rn_ucf=1., nn_ctls=8 206 206 !! for checking residuals. 207 207 !! On a NEC-SX5 computer, this typically leads to: … … 351 351 ! 352 352 ! 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. 354 354 ! 1 2 3 4 =5 e.g. =10 355 355 ! … … 386 386 ! N.B. It may be useful to check IOIPSL time averaging with : 387 387 ! 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) 390 390 391 391 ! define time axis … … 393 393 itmod = kt - nit000 + 1 394 394 395 MODULO_NTRD : IF( MOD( itmod, n trd ) == 0 ) THEN ! nitend MUST be multiple of ntrd395 MODULO_NTRD : IF( MOD( itmod, nn_trd ) == 0 ) THEN ! nitend MUST be multiple of nn_trd 396 396 ! 397 397 ztmltot (:,:) = 0.e0 ; zsmltot (:,:) = 0.e0 ! reset arrays to zero … … 519 519 520 520 ! ... temperature ... ... salinity ... 521 ztmltot (:,:) = ztmltot(:,:) * ucf/zfn ; zsmltot (:,:) = zsmltot(:,:) *ucf/zfn522 ztmlres (:,:) = ztmlres(:,:) * ucf/zfn ; zsmlres (:,:) = zsmlres(:,:) *ucf/zfn523 ztmlatf (:,:) = ztmlatf(:,:) * ucf/zfn ; zsmlatf (:,:) = zsmlatf(:,:) *ucf/zfn521 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 524 524 525 525 tml_sum (:,:) = tml_sum (:,:) / (2*zfn) ; sml_sum (:,:) = sml_sum (:,:) / (2*zfn) 526 ztmltot2(:,:) = ztmltot2(:,:) * ucf/zfn2 ; zsmltot2(:,:) = zsmltot2(:,:) *ucf/zfn2527 ztmltrd2(:,:,:) = ztmltrd2(:,:,:)* ucf/zfn2 ; zsmltrd2(:,:,:) = zsmltrd2(:,:,:)*ucf/zfn2528 ztmlatf2(:,:) = ztmlatf2(:,:) * ucf/zfn2 ; zsmlatf2(:,:) = zsmlatf2(:,:) *ucf/zfn2529 ztmlres2(:,:) = ztmlres2(:,:) * ucf/zfn2 ; zsmlres2(:,:) = zsmlres2(:,:) *ucf/zfn2526 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 530 530 531 531 rmld_sum(:,:) = rmld_sum(:,:) / (2*zfn) ! similar to tml_sum and sml_sum … … 578 578 #if defined key_dimgout 579 579 580 IF( MOD( itmod, n trd ) == 0 ) THEN580 IF( MOD( itmod, nn_trd ) == 0 ) THEN 581 581 iyear = ndastp/10000 582 582 imon = (ndastp-iyear*10000)/100 583 583 iday = ndastp - imon*100 - iyear*10000 584 584 WRITE(clname,9000) TRIM(cexper),'MLDiags',iyear,imon,iday 585 WRITE(clmode,'(f5.1,a)') n trd*rdt/86400.,' days average'585 WRITE(clmode,'(f5.1,a)') nn_trd*rdt/86400.,' days average' 586 586 cltext = TRIM(cexper)//' mld diags'//TRIM(clmode) 587 587 CALL dia_wri_dimg (clname, cltext, smltrd, jpltrd, '2') … … 595 595 ! ---------------------------------- 596 596 597 IF( lwp .AND. MOD( itmod , n trd ) == 0 ) THEN597 IF( lwp .AND. MOD( itmod , nn_trd ) == 0 ) THEN 598 598 WRITE(numout,*) ' ' 599 599 WRITE(numout,*) 'trd_mld : write trends in the NetCDF file :' … … 685 685 #endif 686 686 687 IF( MOD( itmod, n trd ) == 0 ) THEN687 IF( MOD( itmod, nn_trd ) == 0 ) THEN 688 688 ! 689 689 ! III.5 Reset cumulative arrays to zero … … 744 744 ! ------------------------------------------------- 745 745 746 IF( ( lk_trdmld ) .AND. ( MOD( nitend, n trd ) /= 0 ) ) THEN746 IF( ( lk_trdmld ) .AND. ( MOD( nitend, nn_trd ) /= 0 ) ) THEN 747 747 WRITE(numout,cform_err) 748 748 WRITE(numout,*) ' Your nitend parameter, nitend = ', nitend 749 749 WRITE(numout,*) ' is no multiple of the trends diagnostics frequency ' 750 WRITE(numout,*) ' you defined, n trd = ', ntrd750 WRITE(numout,*) ' you defined, nn_trd = ', nn_trd 751 751 WRITE(numout,*) ' This will not allow you to restart from this simulation. ' 752 752 WRITE(numout,*) ' You should reconsider this choice. ' … … 797 797 ! ---------------------------------------------- 798 798 799 IF( n ctls == 1 ) THEN799 IF( nn_ctls == 1 ) THEN 800 800 CALL ctl_opn( numbol, 'ctlsurf_idx', 'OLD', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 801 801 READ ( numbol ) nbol … … 811 811 #else 812 812 ! clmxl = legend root for netCDF output 813 IF( n ctls == 0 ) THEN ! control surface = mixed-layer with density criterion813 IF( nn_ctls == 0 ) THEN ! control surface = mixed-layer with density criterion 814 814 clmxl = 'Mixed Layer ' ! (array nmln computed in zdfmxl.F90) 815 ELSE IF( n ctls == 1 ) THEN ! control surface = read index from file815 ELSE IF( nn_ctls == 1 ) THEN ! control surface = read index from file 816 816 clmxl = ' Bowl ' 817 ELSE IF( n ctls >= 2 ) THEN ! control surface = model level818 WRITE(clmxl,'(A10,I2,1X)') 'Levels 1 -', n ctls817 ELSE IF( nn_ctls >= 2 ) THEN ! control surface = model level 818 WRITE(clmxl,'(A10,I2,1X)') 'Levels 1 -', nn_ctls 819 819 END IF 820 820 … … 828 828 CALL ctl_stop( 'trd_mld : this was never checked. Comment this line to proceed...' ) 829 829 END IF 830 zsto = n trd * rdt830 zsto = nn_trd * rdt 831 831 clop = "inst("//TRIM(clop)//")" 832 832 # else … … 834 834 zsto = rdt ! inst. diags : we use IOIPSL time averaging 835 835 ELSE 836 zsto = n trd * rdt ! mean diags : we DO NOT use any IOIPSL time averaging836 zsto = nn_trd * rdt ! mean diags : we DO NOT use any IOIPSL time averaging 837 837 END IF 838 838 clop = "ave("//TRIM(clop)//")" 839 839 # endif 840 zout = n trd * rdt840 zout = nn_trd * rdt 841 841 842 842 IF(lwp) WRITE (numout,*) ' netCDF initialization' … … 870 870 871 871 !-- Create a NetCDF file and enter the define mode 872 CALL dia_nam( clhstnam, n trd, 'trends' )872 CALL dia_nam( clhstnam, nn_trd, 'trends' ) 873 873 IF(lwp) WRITE(numout,*) ' Name of NETCDF file ', clhstnam 874 874 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & … … 880 880 881 881 !-- 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 889 887 890 888 !-- Define miscellaneous T and S mixed-layer variables
Note: See TracChangeset
for help on using the changeset viewer.