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/make_dmp_file.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/make_dmp_file.F90

    r4738 r4739  
    2424  USE med_red_seas 
    2525  USE zoom 
     26  USE custom 
    2627 
    2728  IMPLICIT NONE 
    2829  INTEGER  :: ji, jj, jk                         ! dummpy loop variables 
    29   REAL(8) :: zsdmp, zbdmp                     ! Surface and bottom damping coeff 
     30  REAL(wp) :: zsdmp, zbdmp                     ! Surface and bottom damping coeff 
    3031  CHARACTER(LEN=200) :: meshfile = 'mesh_mask.nc'   ! mesh file 
    31   CHARACTER(LEN=200) :: outfile = 'dmp_mask.nc'     ! output file 
    32   REAL(8) :: zlat, zlat2, zlat0 
     32  CHARACTER(LEN=200) :: outfile = 'resto.nc'     ! output file 
     33  REAL(wp) :: zlat, zlat2, zlat0 
    3334 
    3435  ! Read namelist 
     
    5556 
    5657  !Calculate surface and bottom damping coefficients 
    57   zsdmp = 1. / ( pn_surf * rday ) 
    58   zbdmp = 1. / ( pn_bot  * rday ) 
     58  zsdmp = 1._wp / ( pn_surf * rday ) 
     59  zbdmp = 1._wp / ( pn_bot  * rday ) 
    5960 
    6061  !Loop through levels and read in tmask for each level as starting point for 
    6162  !coefficient array 
    6263  DO jk = 1, jpk-1 
    63      resto(:,:) = 0. 
     64     resto(:,:) = 0._wp 
    6465      
    6566     IF (.NOT. (jk == 1 .AND. ln_zero_top_layer) ) THEN  
     
    8384                    zlat = ABS(gphit(ji,jj)) 
    8485                    IF ( nn_hdmp <= zlat .AND. zlat <= zlat2 ) THEN 
    85                        resto(ji,jj) = resto(ji,jj) * 0.5 * (  1. - COS( rpi*(zlat-nn_hdmp)/zlat0 ) ) 
     86                       resto(ji,jj) = resto(ji,jj) * 0.5_wp * (  1._wp - COS( rpi*(zlat-nn_hdmp)/zlat0 ) ) 
    8687                    ELSE IF ( zlat < nn_hdmp ) THEN 
    87                        resto(ji,jj) = 0. 
     88                       resto(ji,jj) = 0._wp 
    8889                    ENDIF 
    8990                 END DO 
     
    9899 
    99100        ! Damping in Med/Red Seas (or local modifications if full field is set) 
    100         IF (ln_med_red_seas .AND. (cp_cfg == 'orca')) THEN 
    101            CALL med_red_dmp(resto) 
     101        IF (ln_med_red_seas .AND. (cp_cfg == 'orca') .AND. (.NOT. lzoom)) THEN 
     102           CALL med_red_dmp(resto, jk, ln_old_31_lev_code) 
    102103        ENDIF 
    103104 
     
    105106              CALL dtacof_zoom(resto, tmask) 
    106107        ENDIF 
    107  
     108         
     109        !Any user modifications can be added in the custom module 
     110        IF ( ln_custom ) THEN 
     111              CALL custom_resto( resto ) 
     112        ENDIF 
    108113     ENDIF 
    109114 
Note: See TracChangeset for help on using the changeset viewer.