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 4739 for branches/2014/dev_r4650_UKMO3_masked_damping/NEMOGCM/TOOLS/DMP_TOOLS/src/zoom.F90 – NEMO

Ignore:
Timestamp:
2014-08-13T10:46:04+02:00 (10 years ago)
Author:
timgraham
Message:

Updated C1D/dyndmp.F90 and trcdmp.F90 to read restoration coefficient from a file.
Modified namelist_top_ref to match new options
Bug fixes to DMP_TOOLS tool and addition of custom.F90 to allow users to make modifications. Also changed to use working precision (wp) throughout.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO3_masked_damping/NEMOGCM/TOOLS/DMP_TOOLS/src/zoom.F90

    r4738 r4739  
    1818      !! ** Action  : - resto, the damping coeff. for T and S 
    1919      !!---------------------------------------------------------------------- 
    20       REAL(8), DIMENSION(jpi,jpj), INTENT(inout)  ::   presto   ! restoring coeff. (s-1) 
    21       REAL(8), DIMENSION(jpi,jpj), INTENT(in)  ::   mask   ! restoring coeff. (s-1) 
     20      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout)  ::   presto   ! restoring coeff. (s-1) 
     21      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  ::   mask   ! restoring coeff. (s-1) 
    2222      ! 
    2323      INTEGER  ::   ji, jj, jn   ! dummy loop indices 
    24       REAL(8) ::   zlat, zlat0, zlat1, zlat2, z1_5d   ! local scalar 
    25       REAL(8), DIMENSION(6)  ::   zfact               ! 1Dworkspace 
     24      REAL(wp) ::   zlat, zlat0, zlat1, zlat2, z1_5d   ! local scalar 
     25      REAL(wp), DIMENSION(6)  ::   zfact               ! 1Dworkspace 
     26 
     27      !Namelist variables 
     28      LOGICAL :: lzoom_w, lzoom_e, lzoom_n, lzoom_s  
     29      NAMELIST/nam_zoom_dmp/lzoom_n,lzoom_e,lzoom_w,lzoom_s 
    2630      !!---------------------------------------------------------------------- 
    2731      ! 
     
    2933      ! 
    3034       
     35      ! Read namelist 
     36      OPEN( UNIT=numnam, FILE='namelist', FORM='FORMATTED', STATUS='OLD' ) 
     37      READ( numnam, nam_dmp_create ) 
     38      CLOSE( numnam ) 
    3139 
    32       zfact(1) =  1. 
    33       zfact(2) =  1. 
    34       zfact(3) = 11. / 12. 
    35       zfact(4) =  8. / 12. 
    36       zfact(5) =  4. / 12. 
    37       zfact(6) =  1. / 12. 
    38       zfact(:) = zfact(:) / ( 5. * rday )    ! 5 days max restoring time scale 
     40      zfact(1) =  1._wp 
     41      zfact(2) =  1._wp 
     42      zfact(3) = 11._wp / 12._wp 
     43      zfact(4) =  8._wp / 12._wp 
     44      zfact(5) =  4._wp / 12._wp 
     45      zfact(6) =  1._wp / 12._wp 
     46      zfact(:) = zfact(:) / ( 5._wp * rday )    ! 5 days max restoring time scale 
    3947 
    40       presto(:,:) = 0. 
     48      presto(:,:) = 0._wp 
    4149 
    4250      ! damping along the forced closed boundary over 6 grid-points 
     
    5159      IF( cp_cfz == "arctic" .OR. cp_cfz == "antarctic" ) THEN   !  ORCA configuration : arctic or antarctic zoom 
    5260         !                                        ! ==================================================== 
    53          IF(lwp) WRITE(numout,*) 
    54          IF(lwp .AND. cp_cfz == "arctic" ) WRITE(numout,*) '              dtacof_zoom : ORCA    Arctic zoom' 
    55          IF(lwp .AND. cp_cfz == "antarctic" ) WRITE(numout,*) '           dtacof_zoom : ORCA Antarctic zoom' 
    56          IF(lwp) WRITE(numout,*) 
     61         WRITE(numout,*) 
     62         IF(cp_cfz == "arctic" ) WRITE(numout,*) '              dtacof_zoom : ORCA    Arctic zoom' 
     63         IF(cp_cfz == "antarctic" ) WRITE(numout,*) '           dtacof_zoom : ORCA Antarctic zoom' 
     64         WRITE(numout,*) 
    5765         ! 
    5866         !                          ! Initialization :  
    59          presto(:,:) = 0. 
    60          zlat0 = 10.                     ! zlat0 : latitude strip where resto decreases 
    61          zlat1 = 30.                     ! zlat1 : resto = 1 before zlat1 
     67         presto(:,:) = 0._wp 
     68         zlat0 = 10._wp                     ! zlat0 : latitude strip where resto decreases 
     69         zlat1 = 30._wp                     ! zlat1 : resto = 1 before zlat1 
    6270         zlat2 = zlat1 + zlat0              ! zlat2 : resto decreases from 1 to 0 between zlat1 and zlat2 
    63          z1_5d = 1. / ( 5. * rday )   ! z1_5d : 1 / 5days 
     71         z1_5d = 1._wp / ( 5._wp * rday )   ! z1_5d : 1 / 5days 
    6472 
    6573         DO jj = 1, jpj 
     
    6775               zlat = ABS( gphit(ji,jj) ) 
    6876               IF( zlat1 <= zlat .AND. zlat <= zlat2 ) THEN 
    69                   presto(ji,jj) = 0.5 * z1_5d * (  1. - COS( rpi*(zlat2-zlat)/zlat0 )  )  
     77                  presto(ji,jj) = 0.5_wp * z1_5d * (  1._wp - COS( rpi*(zlat2-zlat)/zlat0 )  )  
    7078               ELSEIF( zlat < zlat1 ) THEN 
    7179                  presto(ji,jj) = z1_5d 
Note: See TracChangeset for help on using the changeset viewer.