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 15745 for NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/make_dmp_file.F90 – NEMO

Ignore:
Timestamp:
2022-03-08T18:55:08+01:00 (2 years ago)
Author:
dbruciaferri
Message:

modifications for restoring upper 300 m to EN4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/tools_r4.0-HEAD_dev_DMP_TOOLS/DMP_TOOLS/src/make_dmp_file.F90

    r4745 r15745  
    4949 
    5050  ALLOCATE( resto(jpi, jpj) ) 
     51  ALLOCATE( dcst(jpi, jpj) ) 
    5152 
    5253  !Create output file 
     
    5758  !Calculate surface and bottom damping coefficients 
    5859  zsdmp = 1._wp / ( pn_surf * rday ) 
    59   zbdmp = 1._wp / ( pn_bot  * rday ) 
     60  IF (pn_bot > 0.) THEN 
     61     zbdmp = 1._wp / ( pn_bot  * rday ) 
     62  ELSE 
     63     zbdmp = 0. 
     64  ENDIF 
     65 
     66  ! Calculate distance from the coast 
     67  IF (ln_coast) CALL cofdis( dcst )  
    6068 
    6169  !Loop through levels and read in tmask for each level as starting point for 
     
    7482           DO jj = 1, jpj 
    7583              DO ji = 1, jpi 
    76                  resto(ji,jj) = tmask(ji, jj) * (zbdmp + (zsdmp-zbdmp) * EXP(-gdept(ji,jj)/pn_dep)) 
     84                 IF ( ln_exp ) THEN 
     85                    resto(ji,jj) = tmask(ji, jj) * (zbdmp + (zsdmp-zbdmp) * EXP(-gdept(ji,jj)/pn_dep)) 
     86                 ELSE 
     87                    resto(ji,jj) = tmask(ji, jj) * (zbdmp + (zsdmp-zbdmp) / & 
     88                       &           (1._wp + EXP(rn_k * (gdept(ji,jj) - pn_dep) / 100._wp))) 
     89                 ENDIF  
    7790              END DO 
    7891           END DO 
     
    94107           IF (ln_coast) THEN 
    95108              ! Reduce damping in vicinity of coastlines 
    96               CALL coast_dist_weight(resto) 
     109              CALL coast_dist_weight(resto, dcst) 
    97110           ENDIF 
    98111        ENDIF 
     
    109122        !Any user modifications can be added in the custom module 
    110123        IF ( ln_custom ) THEN 
    111               CALL custom_resto( resto ) 
     124              WHERE (resto(:,:) <= 1.e-07) resto(:,:) = 0._wp 
     125              !CALL custom_resto( resto ) 
    112126        ENDIF 
    113127     ENDIF 
Note: See TracChangeset for help on using the changeset viewer.