- Timestamp:
- 2019-10-01T18:17:20+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/ENHANCE-03_closea/src/OCE/DOM/closea.F90
r11295 r11629 16 16 !!---------------------------------------------------------------------- 17 17 !! dom_clo : read in masks which define closed seas and runoff areas 18 !! sbc_clo : Special handling of freshwater fluxes over closed seas19 18 !! 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) 21 20 !!---------------------------------------------------------------------- 22 21 USE oce ! dynamics and tracers … … 38 37 PUBLIC dom_clo ! called by domain module 39 38 PUBLIC clo_rnf ! called by sbcrnf module 40 PUBLIC clo_ bat! called in domzgr module39 PUBLIC clo_msk ! called in domzgr module 41 40 42 41 LOGICAL, PUBLIC :: ln_maskcs !: logical to mask all closed sea … … 77 76 !! ** Action : Read mask_cs* fields (if needed) from domain_cfg file and infer 78 77 !! 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. 80 80 !! mask_csrnf and mask_csgrprnf : integer values defining mappings from closed seas and associated groups to a runoff area for downwards flux only. 81 81 !! mask_csemp and mask_csgrpemp : integer values defining mappings from closed seas and associated groups to a runoff area for net fluxes. … … 107 107 END IF 108 108 ! 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 !113 109 ! read the closed seas masks (if they exist) from domain_cfg file (if it exists) 114 110 ! ------------------------------------------------------------------------------ … … 119 115 ! 120 116 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 122 120 l_sbc_clo = .false. ; l_clo_rnf = .false. 123 121 ELSE 124 ! special treatment of closed seas122 ! redistribution of emp unbalance over closed sea into river mouth/open ocean 125 123 l_sbc_clo = .true. 126 124 ! … … 128 126 IF ( ln_clo_rnf) l_clo_rnf = .true. 129 127 ! 128 ! closed sea not defined (ie not in the domcfg namelist used to build the domcfg.nc file) are masked 130 129 IF ( ln_mask_csundef) THEN 131 ! load undef cs mask (1 in undef closed sea)132 130 CALL alloc_csmask( mask_csundef ) 133 131 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) 135 134 mask_csundef = 1 - mask_csundef 136 135 END IF 137 136 ! 138 ! allocate source mask 137 ! allocate source mask for each cases 139 138 CALL alloc_csmask( mask_csglo ) 140 139 CALL alloc_csmask( mask_csrnf ) … … 151 150 ncse = MAXVAL( mask_csemp(:,:) ) ; CALL mpp_max( 'closea', ncse ) 152 151 ! 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) 154 154 CALL alloc_csmask( mask_csgrpglo ) 155 155 CALL alloc_csmask( mask_csgrprnf ) … … 176 176 !! ** Action : update (p_)mskrnf (set 1 at closed sea outflow) 177 177 !!---------------------------------------------------------------------- 178 !!179 178 !! subroutine parameter 180 179 REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: p_rnfmsk ! river runoff mask (rnfmsk array) … … 192 191 END SUBROUTINE clo_rnf 193 192 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 *** 197 196 !! 198 197 !! ** Purpose : Suppress closed sea from the domain 199 198 !! 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 202 200 !! (As currently coded you can't define a closea_mask field in 203 201 !! usr_def_zgr). … … 205 203 !! ** Action : set k_top=0 and k_bot=0 over closed seas 206 204 !!---------------------------------------------------------------------- 207 !!208 205 !! subroutine parameter 209 206 INTEGER, DIMENSION(:,:), INTENT(inout) :: k_top, k_bot ! ocean first and last level indices … … 216 213 IF ( lwp ) THEN 217 214 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.' 219 216 WRITE(numout,*) '~~~~~~~' 220 217 WRITE(numout,*) … … 224 221 k_bot(:,:) = k_bot(:,:) * k_mask(:,:) 225 222 !! 226 END SUBROUTINE clo_ bat223 END SUBROUTINE clo_msk 227 224 228 225 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 !!---------------------------------------------------------------------- 230 231 ! subroutine parameter 231 CHARACTER(256), INTENT(in ) :: cd_file, cd_var ! netcdf file and variable name232 INTEGER, DIMENSION(:,:), INTENT( inout) :: k_mskout! output mask variable232 CHARACTER(256), INTENT(in ) :: cd_file, cd_var ! netcdf file and variable name 233 INTEGER, DIMENSION(:,:), INTENT( out) :: k_mskout ! output mask variable 233 234 ! 234 235 ! local variables 235 236 INTEGER :: ics ! netcdf id 236 237 REAL(wp), DIMENSION(jpi,jpj) :: zdta ! netcdf data 238 !!---------------------------------------------------------------------- 237 239 ! 238 240 CALL iom_open ( cd_file, ics ) … … 244 246 245 247 SUBROUTINE alloc_csmask( kmask ) 246 ! 248 !!--------------------------------------------------------------------- 249 !! *** ROUTINE alloc_csmask *** 250 !! 251 !! ** Purpose : allocated cs mask 252 !!---------------------------------------------------------------------- 247 253 ! subroutine parameter 248 254 INTEGER, ALLOCATABLE, DIMENSION(:,:), INTENT(inout) :: kmask … … 250 256 ! local variables 251 257 INTEGER :: ierr 258 !!---------------------------------------------------------------------- 252 259 ! 253 260 ALLOCATE( kmask(jpi,jpj) , STAT=ierr )
Note: See TracChangeset
for help on using the changeset viewer.