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 11629 for NEMO/branches/2019/ENHANCE-03_closea/src/OCE/DOM/closea.F90 – NEMO

Ignore:
Timestamp:
2019-10-01T18:17:20+02:00 (5 years ago)
Author:
mathiot
Message:

ENHANCE-03_closea: cosmetic changes (ticket #2143)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/ENHANCE-03_closea/src/OCE/DOM/closea.F90

    r11295 r11629  
    1616   !!---------------------------------------------------------------------- 
    1717   !!   dom_clo    : read in masks which define closed seas and runoff areas 
    18    !!   sbc_clo    : Special handling of freshwater fluxes over closed seas 
    1918   !!   clo_rnf    : set close sea outflows as river mouths (see sbcrnf) 
    20    !!   clo_bat    : set to zero a field over closed sea (see domzgr) 
     19   !!   clo_msk    : set to zero a field over closed sea (see domzgr) 
    2120   !!---------------------------------------------------------------------- 
    2221   USE oce             ! dynamics and tracers 
     
    3837   PUBLIC dom_clo      ! called by domain module 
    3938   PUBLIC clo_rnf      ! called by sbcrnf module 
    40    PUBLIC clo_bat      ! called in domzgr module 
     39   PUBLIC clo_msk      ! called in domzgr module 
    4140 
    4241   LOGICAL, PUBLIC :: ln_maskcs        !: logical to mask all closed sea 
     
    7776      !! ** Action  :   Read mask_cs* fields (if needed) from domain_cfg file and infer 
    7877      !!                number of closed seas for each case (glo, rnf, emp) from mask_cs* field. 
    79       !!                mask_csglo and mask_csgrpglo  : integer values defining mappings from closed seas and associated groups to the open ocean for net fluxes. 
     78      !! 
     79      !! ** Output  :   mask_csglo and mask_csgrpglo  : integer values defining mappings from closed seas and associated groups to the open ocean for net fluxes. 
    8080      !!                mask_csrnf and mask_csgrprnf  : integer values defining mappings from closed seas and associated groups to a runoff area for downwards flux only. 
    8181      !!                mask_csemp and mask_csgrpemp  : integer values defining mappings from closed seas and associated groups to a runoff area for net fluxes. 
     
    107107      END IF 
    108108      ! 
    109       l_sbc_clo = .false. ; l_clo_rnf = .false. 
    110       IF (.NOT. ln_maskcs)                  l_sbc_clo = .true. 
    111       IF (.NOT. ln_maskcs .AND. ln_clo_rnf) l_clo_rnf = .true. 
    112       ! 
    113109      ! read the closed seas masks (if they exist) from domain_cfg file (if it exists) 
    114110      ! ------------------------------------------------------------------------------ 
     
    119115      ! 
    120116      IF ( ln_maskcs ) THEN 
    121          ! not special treatment of closed sea 
     117         ! closed sea are masked 
     118         ! no special treatment of closed sea 
     119         ! no redistribution of emp unbalance over closed sea into river mouth/open ocean 
    122120         l_sbc_clo = .false. ; l_clo_rnf = .false. 
    123121      ELSE 
    124          ! special treatment of closed seas 
     122         ! redistribution of emp unbalance over closed sea into river mouth/open ocean 
    125123         l_sbc_clo = .true. 
    126124         ! 
     
    128126         IF ( ln_clo_rnf) l_clo_rnf = .true. 
    129127         ! 
     128         ! closed sea not defined (ie not in the domcfg namelist used to build the domcfg.nc file) are masked  
    130129         IF ( ln_mask_csundef) THEN 
    131             ! load undef cs mask (1 in undef closed sea) 
    132130            CALL alloc_csmask( mask_csundef ) 
    133131            CALL read_csmask( cn_domcfg, 'mask_csundef', mask_csundef ) 
    134             ! revert the mask for masking in domzgr 
     132            ! revert the mask for masking of undefined closed seas in domzgr  
     133            ! (0 over the undefined closed sea and 1 elsewhere) 
    135134            mask_csundef = 1 - mask_csundef 
    136135         END IF 
    137136         ! 
    138          ! allocate source mask 
     137         ! allocate source mask for each cases 
    139138         CALL alloc_csmask( mask_csglo ) 
    140139         CALL alloc_csmask( mask_csrnf ) 
     
    151150         ncse = MAXVAL( mask_csemp(:,:) ) ; CALL mpp_max( 'closea', ncse ) 
    152151         ! 
    153          ! allocate closed sea group masks 
     152         ! allocate closed sea group masks  
     153         !(used to defined the target area in case multiple lakes have the same river mouth (great lakes for example) 
    154154         CALL alloc_csmask( mask_csgrpglo ) 
    155155         CALL alloc_csmask( mask_csgrprnf ) 
     
    176176      !! ** Action  :   update (p_)mskrnf (set 1 at closed sea outflow) 
    177177      !!---------------------------------------------------------------------- 
    178       !! 
    179178      !! subroutine parameter 
    180179      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_rnfmsk   ! river runoff mask (rnfmsk array) 
     
    192191   END SUBROUTINE clo_rnf 
    193192       
    194    SUBROUTINE clo_bat( k_top, k_bot, k_mask, cd_prt ) 
    195       !!--------------------------------------------------------------------- 
    196       !!                  ***  ROUTINE clo_bat  *** 
     193   SUBROUTINE clo_msk( k_top, k_bot, k_mask, cd_prt ) 
     194      !!--------------------------------------------------------------------- 
     195      !!                  ***  ROUTINE clo_msk  *** 
    197196      !!                     
    198197      !! ** Purpose :   Suppress closed sea from the domain 
    199198      !! 
    200       !! ** Method  :   Read in closea_mask field (if it exists) from domain_cfg file. 
    201       !!                Where closea_mask > 0 set first and last ocean level to 0 
     199      !! ** Method  :   Where closea_mask > 0 set first and last ocean level to 0 
    202200      !!                (As currently coded you can't define a closea_mask field in  
    203201      !!                usr_def_zgr). 
     
    205203      !! ** Action  :   set k_top=0 and k_bot=0 over closed seas 
    206204      !!---------------------------------------------------------------------- 
    207       !! 
    208205      !! subroutine parameter 
    209206      INTEGER, DIMENSION(:,:), INTENT(inout) ::   k_top, k_bot   ! ocean first and last level indices 
     
    216213      IF ( lwp ) THEN 
    217214         WRITE(numout,*) 
    218          WRITE(numout,*) 'clo_bat : Suppression closed seas based on ',TRIM(cd_prt),' field.' 
     215         WRITE(numout,*) 'clo_msk : Suppression closed seas based on ',TRIM(cd_prt),' field.' 
    219216         WRITE(numout,*) '~~~~~~~' 
    220217         WRITE(numout,*) 
     
    224221      k_bot(:,:) = k_bot(:,:) * k_mask(:,:) 
    225222      !! 
    226    END SUBROUTINE clo_bat 
     223   END SUBROUTINE clo_msk 
    227224 
    228225   SUBROUTINE read_csmask(cd_file, cd_var, k_mskout) 
    229       ! 
     226      !!--------------------------------------------------------------------- 
     227      !!                  ***  ROUTINE read_csmask  *** 
     228      !!                     
     229      !! ** Purpose : read mask in cd_filec file 
     230      !!---------------------------------------------------------------------- 
    230231      ! subroutine parameter 
    231       CHARACTER(256), INTENT(in   ) :: cd_file, cd_var     ! netcdf file and variable name 
    232       INTEGER, DIMENSION(:,:), INTENT(inout) :: k_mskout ! output mask variable 
     232      CHARACTER(256),          INTENT(in   ) :: cd_file, cd_var     ! netcdf file and variable name 
     233      INTEGER, DIMENSION(:,:), INTENT(  out) :: k_mskout            ! output mask variable 
    233234      ! 
    234235      ! local variables 
    235236      INTEGER :: ics                       ! netcdf id 
    236237      REAL(wp), DIMENSION(jpi,jpj) :: zdta ! netcdf data 
     238      !!---------------------------------------------------------------------- 
    237239      ! 
    238240      CALL iom_open ( cd_file, ics ) 
     
    244246 
    245247   SUBROUTINE alloc_csmask( kmask ) 
    246       ! 
     248      !!--------------------------------------------------------------------- 
     249      !!                  ***  ROUTINE alloc_csmask  *** 
     250      !!                     
     251      !! ** Purpose : allocated cs mask 
     252      !!---------------------------------------------------------------------- 
    247253      ! subroutine parameter 
    248254      INTEGER, ALLOCATABLE, DIMENSION(:,:), INTENT(inout) :: kmask 
     
    250256      ! local variables 
    251257      INTEGER :: ierr 
     258      !!---------------------------------------------------------------------- 
    252259      ! 
    253260      ALLOCATE( kmask(jpi,jpj) , STAT=ierr ) 
Note: See TracChangeset for help on using the changeset viewer.