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

Ignore:
Timestamp:
2019-10-04T21:03:26+02:00 (5 years ago)
Author:
mathiot
Message:

ENHANCE-03_closea: add heat/fw fluxes output from closed seas + rm useless USE statements + add USE ONLY when reasonable + ensure heat conservation during the redistribution process (ticket #2143)

File:
1 edited

Legend:

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

    r11629 r11656  
    1919   !!   clo_msk    : set to zero a field over closed sea (see domzgr) 
    2020   !!---------------------------------------------------------------------- 
    21    USE oce             ! dynamics and tracers 
    22    USE dom_oce         ! ocean space and time domain 
    23    USE phycst          ! physical constants 
    24    USE sbc_oce         ! ocean surface boundary conditions 
    25    USE iom             ! I/O routines 
     21   USE in_out_manager  ! I/O manager 
    2622   ! 
    27    USE in_out_manager  ! I/O manager 
    28    USE lib_fortran,    ONLY: glob_sum 
    29    USE lbclnk          ! lateral boundary condition - MPP exchanges 
    30    USE lib_mpp         ! MPP library 
    31    USE timing          ! Timing 
     23   USE diurnal_bulk, ONLY: ln_diurnal_only            ! used for sanity check 
     24   USE iom         , ONLY: iom_open, iom_get, iom_close, jpdom_data ! I/O routines 
     25   USE lib_fortran , ONLY: glob_sum                   ! fortran library 
     26   USE lib_mpp     , ONLY: mpp_max, ctl_nam, ctl_stop ! MPP library 
    3227 
    3328   IMPLICIT NONE 
    34    PRIVATE read_csmask 
    35    PRIVATE alloc_csmask 
     29 
     30   PRIVATE 
    3631 
    3732   PUBLIC dom_clo      ! called by domain module 
     
    5045   INTEGER, PUBLIC :: ncse      !: number of closed seas empmr  mappings (inferred from closea_mask_emp field) 
    5146 
    52    INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_opnsea, mask_csundef !: mask defining the open sea and the undefined closed sea 
     47   INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_opnsea, mask_csundef  !: mask defining the open sea and the undefined closed sea 
    5348  
    54    INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_csglo, mask_csgrpglo !: mask of integers defining closed seas 
    55    INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_csrnf, mask_csgrprnf !: mask of integers defining closed seas rnf mappings 
    56    INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_csemp, mask_csgrpemp !: mask of integers defining closed seas empmr mappings 
     49   INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_csglo , mask_csgrpglo !: mask of integers defining closed seas 
     50   INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_csrnf , mask_csgrprnf !: mask of integers defining closed seas rnf mappings 
     51   INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_csemp , mask_csgrpemp !: mask of integers defining closed seas empmr mappings 
    5752 
    5853   !! * Substitutions 
     
    9792      IF(lwp) WRITE(numout,*)'dom_clo : read in masks to define closed seas ' 
    9893      IF(lwp) WRITE(numout,*)'~~~~~~~' 
     94      IF(lwp) WRITE(numout,*) 
    9995      !! 
    10096      !! check option compatibility 
     
    116112      IF ( ln_maskcs ) THEN 
    117113         ! closed sea are masked 
     114         IF(lwp) WRITE(numout,*)'          ln_maskcs = T : all closed seas are masked' 
     115         IF(lwp) WRITE(numout,*) 
    118116         ! no special treatment of closed sea 
    119117         ! no redistribution of emp unbalance over closed sea into river mouth/open ocean 
     
    121119      ELSE 
    122120         ! redistribution of emp unbalance over closed sea into river mouth/open ocean 
     121         IF(lwp) WRITE(numout,*)'          ln_maskcs = F : net emp is corrected over defined closed seas' 
     122         ! 
    123123         l_sbc_clo = .true. 
    124124         ! 
     
    126126         IF ( ln_clo_rnf) l_clo_rnf = .true. 
    127127         ! 
    128          ! closed sea not defined (ie not in the domcfg namelist used to build the domcfg.nc file) are masked  
    129128         IF ( ln_mask_csundef) THEN 
     129            ! closed sea not defined (ie not in the domcfg namelist used to build the domcfg.nc file) are masked  
     130            IF(lwp) WRITE(numout,*)'          ln_mask_csundef = T : all undefined closed seas are masked' 
     131            ! 
    130132            CALL alloc_csmask( mask_csundef ) 
    131133            CALL read_csmask( cn_domcfg, 'mask_csundef', mask_csundef ) 
    132134            ! revert the mask for masking of undefined closed seas in domzgr  
    133135            ! (0 over the undefined closed sea and 1 elsewhere) 
    134             mask_csundef = 1 - mask_csundef 
     136            mask_csundef(:,:) = 1 - mask_csundef(:,:) 
    135137         END IF 
     138         IF(lwp) WRITE(numout,*) 
    136139         ! 
    137140         ! allocate source mask for each cases 
Note: See TracChangeset for help on using the changeset viewer.