- Timestamp:
- 2015-01-20T15:26:13+01:00 (9 years ago)
- Location:
- branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC
- Files:
-
- 2 deleted
- 17 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90
r3294 r5038 2 2 !!====================================================================== 3 3 !! *** MODULE cpl_oasis *** 4 !! Coupled O/A : coupled ocean-atmosphere case using OASIS3 V. prism_2_4 5 !! special case: NEMO OPA/LIM coupled to ECHAM5 4 !! Coupled O/A : coupled ocean-atmosphere case using OASIS3-MCT 6 5 !!===================================================================== 7 6 !! History : … … 15 14 !! 3.4 ! 11-11 (C. Harris) Changes to allow mutiple category fields 16 15 !!---------------------------------------------------------------------- 16 !!---------------------------------------------------------------------- 17 !! 'key_oasis3' coupled Ocean/Atmosphere via OASIS3 18 !!---------------------------------------------------------------------- 19 !! cpl_init : initialization of coupled mode communication 20 !! cpl_define : definition of grid and fields 21 !! cpl_snd : snd out fields in coupled mode 22 !! cpl_rcv : receive fields in coupled mode 23 !! cpl_finalize : finalize the coupled mode communication 24 !!---------------------------------------------------------------------- 17 25 #if defined key_oasis3 18 !!---------------------------------------------------------------------- 19 !! 'key_oasis3' coupled Ocean/Atmosphere via OASIS3 20 !!---------------------------------------------------------------------- 21 !! cpl_prism_init : initialization of coupled mode communication 22 !! cpl_prism_define : definition of grid and fields 23 !! cpl_prism_snd : snd out fields in coupled mode 24 !! cpl_prism_rcv : receive fields in coupled mode 25 !! cpl_prism_finalize : finalize the coupled mode communication 26 !!---------------------------------------------------------------------- 27 USE mod_prism_proto ! OASIS3 prism module 28 USE mod_prism_def_partition_proto! OASIS3 prism module for partitioning 29 USE mod_prism_put_proto ! OASIS3 prism module for snding 30 USE mod_prism_get_proto ! OASIS3 prism module for receiving 31 USE mod_comprism_proto ! OASIS3 prism module to get coupling frequency 26 USE mod_oasis ! OASIS3-MCT module 27 #endif 32 28 USE par_oce ! ocean parameters 33 29 USE dom_oce ! ocean space and time domain … … 38 34 PRIVATE 39 35 40 PUBLIC cpl_prism_init 41 PUBLIC cpl_prism_define 42 PUBLIC cpl_prism_snd 43 PUBLIC cpl_prism_rcv 44 PUBLIC cpl_prism_freq 45 PUBLIC cpl_prism_finalize 46 47 LOGICAL, PUBLIC, PARAMETER :: lk_cpl = .TRUE. !: coupled flag 36 PUBLIC cpl_init 37 PUBLIC cpl_define 38 PUBLIC cpl_snd 39 PUBLIC cpl_rcv 40 PUBLIC cpl_freq 41 PUBLIC cpl_finalize 42 48 43 INTEGER, PUBLIC :: OASIS_Rcv = 1 !: return code if received field 49 44 INTEGER, PUBLIC :: OASIS_idle = 0 !: return code if nothing done by oasis 50 INTEGER :: ncomp_id ! id returned by prism_init_comp45 INTEGER :: ncomp_id ! id returned by oasis_init_comp 51 46 INTEGER :: nerror ! return error code 52 53 INTEGER, PARAMETER :: nmaxfld=40 ! Maximum number of coupling fields 47 #if ! defined key_oasis3 48 ! OASIS Variables not used. defined only for compilation purpose 49 INTEGER :: OASIS_Out = -1 50 INTEGER :: OASIS_REAL = -1 51 INTEGER :: OASIS_Ok = -1 52 INTEGER :: OASIS_In = -1 53 INTEGER :: OASIS_Sent = -1 54 INTEGER :: OASIS_SentOut = -1 55 INTEGER :: OASIS_ToRest = -1 56 INTEGER :: OASIS_ToRestOut = -1 57 INTEGER :: OASIS_Recvd = -1 58 INTEGER :: OASIS_RecvOut = -1 59 INTEGER :: OASIS_FromRest = -1 60 INTEGER :: OASIS_FromRestOut = -1 61 #endif 62 63 INTEGER, PUBLIC, PARAMETER :: nmaxfld=40 ! Maximum number of coupling fields 64 INTEGER, PUBLIC, PARAMETER :: nmaxcat=5 ! Maximum number of coupling fields 65 INTEGER, PUBLIC, PARAMETER :: nmaxcpl=5 ! Maximum number of coupling fields 54 66 55 67 TYPE, PUBLIC :: FLD_CPL !: Type for coupling field information … … 58 70 CHARACTER(len = 1) :: clgrid ! Grid type 59 71 REAL(wp) :: nsgn ! Control of the sign change 60 INTEGER, DIMENSION( 9) :: nid ! Id of the field (no more than 9 categories)72 INTEGER, DIMENSION(nmaxcat,nmaxcpl) :: nid ! Id of the field (no more than 9 categories and 9 extrena models) 61 73 INTEGER :: nct ! Number of categories in field 74 INTEGER :: ncplmodel ! Maximum number of models to/from which this variable may be sent/received 62 75 END TYPE FLD_CPL 63 76 … … 73 86 CONTAINS 74 87 75 SUBROUTINE cpl_ prism_init( kl_comm )88 SUBROUTINE cpl_init( kl_comm ) 76 89 !!------------------------------------------------------------------- 77 !! *** ROUTINE cpl_ prism_init ***90 !! *** ROUTINE cpl_init *** 78 91 !! 79 92 !! ** Purpose : Initialize coupled mode communication for ocean … … 89 102 90 103 !------------------------------------------------------------------ 91 ! 1st Initialize the PRISMsystem for the application104 ! 1st Initialize the OASIS system for the application 92 105 !------------------------------------------------------------------ 93 CALL prism_init_comp_proto( ncomp_id, 'oceanx', nerror )94 IF ( nerror /= PRISM_Ok ) &95 CALL prism_abort_proto (ncomp_id, 'cpl_prism_init', 'Failure in prism_init_comp_proto')106 CALL oasis_init_comp ( ncomp_id, 'oceanx', nerror ) 107 IF ( nerror /= OASIS_Ok ) & 108 CALL oasis_abort (ncomp_id, 'cpl_init', 'Failure in oasis_init_comp') 96 109 97 110 !------------------------------------------------------------------ … … 99 112 !------------------------------------------------------------------ 100 113 101 CALL prism_get_localcomm_proto( kl_comm, nerror )102 IF ( nerror /= PRISM_Ok ) &103 CALL prism_abort_proto (ncomp_id, 'cpl_prism_init','Failure in prism_get_localcomm_proto' )104 ! 105 END SUBROUTINE cpl_ prism_init106 107 108 SUBROUTINE cpl_ prism_define( krcv, ksnd)114 CALL oasis_get_localcomm ( kl_comm, nerror ) 115 IF ( nerror /= OASIS_Ok ) & 116 CALL oasis_abort (ncomp_id, 'cpl_init','Failure in oasis_get_localcomm' ) 117 ! 118 END SUBROUTINE cpl_init 119 120 121 SUBROUTINE cpl_define( krcv, ksnd, kcplmodel ) 109 122 !!------------------------------------------------------------------- 110 !! *** ROUTINE cpl_ prism_define ***123 !! *** ROUTINE cpl_define *** 111 124 !! 112 125 !! ** Purpose : Define grid and field information for ocean … … 116 129 !!-------------------------------------------------------------------- 117 130 INTEGER, INTENT(in) :: krcv, ksnd ! Number of received and sent coupling fields 131 INTEGER, INTENT(in) :: kcplmodel ! Maximum number of models to/from which NEMO is potentialy sending/receiving data 118 132 ! 119 133 INTEGER :: id_part 120 134 INTEGER :: paral(5) ! OASIS3 box partition 121 135 INTEGER :: ishape(2,2) ! shape of arrays passed to PSMILe 122 INTEGER :: ji,jc ! local loop indicees 123 CHARACTER(LEN=8) :: zclname 136 INTEGER :: ji,jc,jm ! local loop indicees 137 CHARACTER(LEN=64) :: zclname 138 CHARACTER(LEN=2) :: cli2 124 139 !!-------------------------------------------------------------------- 125 140 126 141 IF(lwp) WRITE(numout,*) 127 IF(lwp) WRITE(numout,*) 'cpl_ prism_define : initialization in coupled ocean/atmosphere case'142 IF(lwp) WRITE(numout,*) 'cpl_define : initialization in coupled ocean/atmosphere case' 128 143 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~' 129 144 IF(lwp) WRITE(numout,*) 130 145 146 IF( kcplmodel > nmaxcpl ) THEN 147 CALL oasis_abort ( ncomp_id, 'cpl_define', 'kcplmodel is larger than nmaxcpl, increase nmaxcpl') ; RETURN 148 ENDIF 131 149 ! 132 150 ! ... Define the shape for the area that excludes the halo … … 141 159 ALLOCATE(exfld(nlei-nldi+1, nlej-nldj+1), stat = nerror) 142 160 IF( nerror > 0 ) THEN 143 CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in allocating exfld') ; RETURN161 CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in allocating exfld') ; RETURN 144 162 ENDIF 145 163 ! … … 161 179 ENDIF 162 180 163 CALL prism_def_partition_proto( id_part, paral, nerror )181 CALL oasis_def_partition ( id_part, paral, nerror ) 164 182 ! 165 183 ! ... Announce send variables. 166 184 ! 185 ssnd(:)%ncplmodel = kcplmodel 186 ! 167 187 DO ji = 1, ksnd 168 IF ( ssnd(ji)%laction ) THEN 188 IF ( ssnd(ji)%laction ) THEN 189 190 IF( ssnd(ji)%nct > nmaxcat ) THEN 191 CALL oasis_abort ( ncomp_id, 'cpl_define', 'Number of categories of '// & 192 & TRIM(ssnd(ji)%clname)//' is larger than nmaxcat, increase nmaxcat' ) 193 RETURN 194 ENDIF 195 169 196 DO jc = 1, ssnd(ji)%nct 170 IF ( ssnd(ji)%nct .gt. 1 ) THEN 171 WRITE(zclname,'( a7, i1)') ssnd(ji)%clname,jc 172 ELSE 173 zclname=ssnd(ji)%clname 174 ENDIF 175 WRITE(numout,*) "Define",ji,jc,zclname," for",PRISM_Out 176 CALL prism_def_var_proto (ssnd(ji)%nid(jc), zclname, id_part, (/ 2, 0/), & 177 PRISM_Out, ishape, PRISM_REAL, nerror) 178 IF ( nerror /= PRISM_Ok ) THEN 179 WRITE(numout,*) 'Failed to define transient ', ji, TRIM(zclname) 180 CALL prism_abort_proto ( ssnd(ji)%nid(jc), 'cpl_prism_define', 'Failure in prism_def_var') 181 ENDIF 197 DO jm = 1, kcplmodel 198 199 IF ( ssnd(ji)%nct .GT. 1 ) THEN 200 WRITE(cli2,'(i2.2)') jc 201 zclname = TRIM(ssnd(ji)%clname)//'_cat'//cli2 202 ELSE 203 zclname = ssnd(ji)%clname 204 ENDIF 205 IF ( kcplmodel > 1 ) THEN 206 WRITE(cli2,'(i2.2)') jm 207 zclname = 'model'//cli2//'_'//TRIM(zclname) 208 ENDIF 209 #if defined key_agrif 210 IF( agrif_fixed() /= 0 ) THEN 211 zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname) 212 END IF 213 #endif 214 IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_Out 215 CALL oasis_def_var (ssnd(ji)%nid(jc,jm), zclname, id_part , (/ 2, 0 /), & 216 & OASIS_Out , ishape , OASIS_REAL, nerror ) 217 IF ( nerror /= OASIS_Ok ) THEN 218 WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname) 219 CALL oasis_abort ( ssnd(ji)%nid(jc,jm), 'cpl_define', 'Failure in oasis_def_var' ) 220 ENDIF 221 IF( ln_ctl .AND. ssnd(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "variable defined in the namcouple" 222 IF( ln_ctl .AND. ssnd(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "variable NOT defined in the namcouple" 223 END DO 182 224 END DO 183 225 ENDIF … … 186 228 ! ... Announce received variables. 187 229 ! 230 srcv(:)%ncplmodel = kcplmodel 231 ! 188 232 DO ji = 1, krcv 189 233 IF ( srcv(ji)%laction ) THEN 234 235 IF( srcv(ji)%nct > nmaxcat ) THEN 236 CALL oasis_abort ( ncomp_id, 'cpl_define', 'Number of categories of '// & 237 & TRIM(srcv(ji)%clname)//' is larger than nmaxcat, increase nmaxcat' ) 238 RETURN 239 ENDIF 240 190 241 DO jc = 1, srcv(ji)%nct 191 IF ( srcv(ji)%nct .gt. 1 ) THEN 192 WRITE(zclname,'( a7, i1)') srcv(ji)%clname,jc 193 ELSE 194 zclname=srcv(ji)%clname 195 ENDIF 196 WRITE(numout,*) "Define",ji,jc,zclname," for",PRISM_In 197 CALL prism_def_var_proto ( srcv(ji)%nid(jc), zclname, id_part, (/ 2, 0/), & 198 & PRISM_In , ishape , PRISM_REAL, nerror) 199 IF ( nerror /= PRISM_Ok ) THEN 200 WRITE(numout,*) 'Failed to define transient ', ji, TRIM(zclname) 201 CALL prism_abort_proto ( srcv(ji)%nid(jc), 'cpl_prism_define', 'Failure in prism_def_var') 202 ENDIF 242 DO jm = 1, kcplmodel 243 244 IF ( srcv(ji)%nct .GT. 1 ) THEN 245 WRITE(cli2,'(i2.2)') jc 246 zclname = TRIM(srcv(ji)%clname)//'_cat'//cli2 247 ELSE 248 zclname = srcv(ji)%clname 249 ENDIF 250 IF ( kcplmodel > 1 ) THEN 251 WRITE(cli2,'(i2.2)') jm 252 zclname = 'model'//cli2//'_'//TRIM(zclname) 253 ENDIF 254 #if defined key_agrif 255 IF( agrif_fixed() /= 0 ) THEN 256 zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname) 257 END IF 258 #endif 259 IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In 260 CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part , (/ 2, 0 /), & 261 & OASIS_In , ishape , OASIS_REAL, nerror ) 262 IF ( nerror /= OASIS_Ok ) THEN 263 WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname) 264 CALL oasis_abort ( srcv(ji)%nid(jc,jm), 'cpl_define', 'Failure in oasis_def_var' ) 265 ENDIF 266 IF( ln_ctl .AND. srcv(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "variable defined in the namcouple" 267 IF( ln_ctl .AND. srcv(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "variable NOT defined in the namcouple" 268 269 END DO 203 270 END DO 204 271 ENDIF … … 209 276 !------------------------------------------------------------------ 210 277 211 CALL prism_enddef_proto(nerror)212 IF( nerror /= PRISM_Ok ) CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in prism_enddef')213 ! 214 END SUBROUTINE cpl_ prism_define278 CALL oasis_enddef(nerror) 279 IF( nerror /= OASIS_Ok ) CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in oasis_enddef') 280 ! 281 END SUBROUTINE cpl_define 215 282 216 283 217 SUBROUTINE cpl_ prism_snd( kid, kstep, pdata, kinfo )284 SUBROUTINE cpl_snd( kid, kstep, pdata, kinfo ) 218 285 !!--------------------------------------------------------------------- 219 !! *** ROUTINE cpl_ prism_snd ***286 !! *** ROUTINE cpl_snd *** 220 287 !! 221 288 !! ** Purpose : - At each coupling time-step,this routine sends fields … … 227 294 REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: pdata 228 295 !! 229 INTEGER :: jc 296 INTEGER :: jc,jm ! local loop index 230 297 !!-------------------------------------------------------------------- 231 298 ! … … 233 300 ! 234 301 DO jc = 1, ssnd(kid)%nct 235 236 CALL prism_put_proto ( ssnd(kid)%nid(jc), kstep, pdata(nldi:nlei, nldj:nlej,jc), kinfo ) 237 238 IF ( ln_ctl ) THEN 239 IF ( kinfo == PRISM_Sent .OR. kinfo == PRISM_ToRest .OR. & 240 & kinfo == PRISM_SentOut .OR. kinfo == PRISM_ToRestOut ) THEN 241 WRITE(numout,*) '****************' 242 WRITE(numout,*) 'prism_put_proto: Outgoing ', ssnd(kid)%clname 243 WRITE(numout,*) 'prism_put_proto: ivarid ', ssnd(kid)%nid(jc) 244 WRITE(numout,*) 'prism_put_proto: kstep ', kstep 245 WRITE(numout,*) 'prism_put_proto: info ', kinfo 246 WRITE(numout,*) ' - Minimum value is ', MINVAL(pdata(:,:,jc)) 247 WRITE(numout,*) ' - Maximum value is ', MAXVAL(pdata(:,:,jc)) 248 WRITE(numout,*) ' - Sum value is ', SUM(pdata(:,:,jc)) 249 WRITE(numout,*) '****************' 302 DO jm = 1, ssnd(kid)%ncplmodel 303 304 IF( ssnd(kid)%nid(jc,jm) /= -1 ) THEN 305 CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(nldi:nlei, nldj:nlej,jc), kinfo ) 306 307 IF ( ln_ctl ) THEN 308 IF ( kinfo == OASIS_Sent .OR. kinfo == OASIS_ToRest .OR. & 309 & kinfo == OASIS_SentOut .OR. kinfo == OASIS_ToRestOut ) THEN 310 WRITE(numout,*) '****************' 311 WRITE(numout,*) 'oasis_put: Outgoing ', ssnd(kid)%clname 312 WRITE(numout,*) 'oasis_put: ivarid ', ssnd(kid)%nid(jc,jm) 313 WRITE(numout,*) 'oasis_put: kstep ', kstep 314 WRITE(numout,*) 'oasis_put: info ', kinfo 315 WRITE(numout,*) ' - Minimum value is ', MINVAL(pdata(:,:,jc)) 316 WRITE(numout,*) ' - Maximum value is ', MAXVAL(pdata(:,:,jc)) 317 WRITE(numout,*) ' - Sum value is ', SUM(pdata(:,:,jc)) 318 WRITE(numout,*) '****************' 319 ENDIF 320 ENDIF 321 250 322 ENDIF 251 ENDIF252 323 324 ENDDO 253 325 ENDDO 254 326 ! 255 END SUBROUTINE cpl_ prism_snd256 257 258 SUBROUTINE cpl_ prism_rcv( kid, kstep, pdata, kinfo )327 END SUBROUTINE cpl_snd 328 329 330 SUBROUTINE cpl_rcv( kid, kstep, pdata, pmask, kinfo ) 259 331 !!--------------------------------------------------------------------- 260 !! *** ROUTINE cpl_ prism_rcv ***332 !! *** ROUTINE cpl_rcv *** 261 333 !! 262 334 !! ** Purpose : - At each coupling time-step,this routine receives fields … … 266 338 INTEGER , INTENT(in ) :: kstep ! ocean time-step in seconds 267 339 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pdata ! IN to keep the value if nothing is done 340 REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: pmask ! coupling mask 268 341 INTEGER , INTENT( out) :: kinfo ! OASIS3 info argument 269 342 !! 270 INTEGER :: jc 271 LOGICAL :: llaction 343 INTEGER :: jc,jm ! local loop index 344 LOGICAL :: llaction, llfisrt 272 345 !!-------------------------------------------------------------------- 273 346 ! 274 347 ! receive local data from OASIS3 on every process 275 348 ! 349 kinfo = OASIS_idle 350 ! 276 351 DO jc = 1, srcv(kid)%nct 277 278 CALL prism_get_proto ( srcv(kid)%nid(jc), kstep, exfld, kinfo ) 279 280 llaction = .false. 281 IF( kinfo == PRISM_Recvd .OR. kinfo == PRISM_FromRest .OR. & 282 kinfo == PRISM_RecvOut .OR. kinfo == PRISM_FromRestOut ) llaction = .TRUE. 283 284 IF ( ln_ctl ) WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc) 285 286 IF ( llaction ) THEN 287 288 kinfo = OASIS_Rcv 289 pdata(nldi:nlei, nldj:nlej,jc) = exfld(:,:) 290 291 !--- Fill the overlap areas and extra hallows (mpp) 292 !--- check periodicity conditions (all cases) 293 CALL lbc_lnk( pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn ) 294 295 IF ( ln_ctl ) THEN 296 WRITE(numout,*) '****************' 297 WRITE(numout,*) 'prism_get_proto: Incoming ', srcv(kid)%clname 298 WRITE(numout,*) 'prism_get_proto: ivarid ' , srcv(kid)%nid(jc) 299 WRITE(numout,*) 'prism_get_proto: kstep', kstep 300 WRITE(numout,*) 'prism_get_proto: info ', kinfo 301 WRITE(numout,*) ' - Minimum value is ', MINVAL(pdata(:,:,jc)) 302 WRITE(numout,*) ' - Maximum value is ', MAXVAL(pdata(:,:,jc)) 303 WRITE(numout,*) ' - Sum value is ', SUM(pdata(:,:,jc)) 304 WRITE(numout,*) '****************' 352 llfisrt = .TRUE. 353 354 DO jm = 1, srcv(kid)%ncplmodel 355 356 IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN 357 358 CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo ) 359 360 llaction = kinfo == OASIS_Recvd .OR. kinfo == OASIS_FromRest .OR. & 361 & kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut 362 363 IF ( ln_ctl ) WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm) 364 365 IF ( llaction ) THEN 366 367 kinfo = OASIS_Rcv 368 IF( llfisrt ) THEN 369 pdata(nldi:nlei,nldj:nlej,jc) = exfld(:,:) * pmask(nldi:nlei,nldj:nlej,jm) 370 llfisrt = .FALSE. 371 ELSE 372 pdata(nldi:nlei,nldj:nlej,jc) = pdata(nldi:nlei,nldj:nlej,jc) + exfld(:,:) * pmask(nldi:nlei,nldj:nlej,jm) 373 ENDIF 374 375 IF ( ln_ctl ) THEN 376 WRITE(numout,*) '****************' 377 WRITE(numout,*) 'oasis_get: Incoming ', srcv(kid)%clname 378 WRITE(numout,*) 'oasis_get: ivarid ' , srcv(kid)%nid(jc,jm) 379 WRITE(numout,*) 'oasis_get: kstep', kstep 380 WRITE(numout,*) 'oasis_get: info ', kinfo 381 WRITE(numout,*) ' - Minimum value is ', MINVAL(pdata(:,:,jc)) 382 WRITE(numout,*) ' - Maximum value is ', MAXVAL(pdata(:,:,jc)) 383 WRITE(numout,*) ' - Sum value is ', SUM(pdata(:,:,jc)) 384 WRITE(numout,*) '****************' 385 ENDIF 386 387 ENDIF 388 305 389 ENDIF 306 390 307 ELSE 308 kinfo = OASIS_idle 309 ENDIF 310 391 ENDDO 392 393 !--- Fill the overlap areas and extra hallows (mpp) 394 !--- check periodicity conditions (all cases) 395 IF( .not. llfisrt ) CALL lbc_lnk( pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn ) 396 311 397 ENDDO 312 398 ! 313 END SUBROUTINE cpl_ prism_rcv314 315 316 INTEGER FUNCTION cpl_ prism_freq( kid )399 END SUBROUTINE cpl_rcv 400 401 402 INTEGER FUNCTION cpl_freq( kid ) 317 403 !!--------------------------------------------------------------------- 318 !! *** ROUTINE cpl_ prism_freq ***404 !! *** ROUTINE cpl_freq *** 319 405 !! 320 406 !! ** Purpose : - send back the coupling frequency for a particular field 321 407 !!---------------------------------------------------------------------- 322 INTEGER,INTENT(in) :: kid ! variable index 408 INTEGER,INTENT(in) :: kid ! variable index 409 !! 410 INTEGER :: info 411 INTEGER, DIMENSION(1) :: itmp 323 412 !!---------------------------------------------------------------------- 324 cpl_prism_freq = ig_def_freq( kid ) 325 ! 326 END FUNCTION cpl_prism_freq 327 328 329 SUBROUTINE cpl_prism_finalize 413 CALL oasis_get_freqs(kid, 1, itmp, info) 414 cpl_freq = itmp(1) 415 ! 416 END FUNCTION cpl_freq 417 418 419 SUBROUTINE cpl_finalize 330 420 !!--------------------------------------------------------------------- 331 !! *** ROUTINE cpl_ prism_finalize ***421 !! *** ROUTINE cpl_finalize *** 332 422 !! 333 423 !! ** Purpose : - Finalizes the coupling. If MPI_init has not been 334 !! called explicitly before cpl_ prism_init it will also close424 !! called explicitly before cpl_init it will also close 335 425 !! MPI communication. 336 426 !!---------------------------------------------------------------------- 337 427 ! 338 428 DEALLOCATE( exfld ) 339 CALL prism_terminate_proto( nerror ) 340 ! 341 END SUBROUTINE cpl_prism_finalize 342 343 #else 344 !!---------------------------------------------------------------------- 345 !! Default case Dummy module Forced Ocean/Atmosphere 346 !!---------------------------------------------------------------------- 347 USE in_out_manager ! I/O manager 348 LOGICAL, PUBLIC, PARAMETER :: lk_cpl = .FALSE. !: coupled flag 349 PUBLIC cpl_prism_init 350 PUBLIC cpl_prism_finalize 351 CONTAINS 352 SUBROUTINE cpl_prism_init (kl_comm) 353 INTEGER, INTENT(out) :: kl_comm ! local communicator of the model 354 kl_comm = -1 355 WRITE(numout,*) 'cpl_prism_init: Error you sould not be there...' 356 END SUBROUTINE cpl_prism_init 357 SUBROUTINE cpl_prism_finalize 358 WRITE(numout,*) 'cpl_prism_finalize: Error you sould not be there...' 359 END SUBROUTINE cpl_prism_finalize 429 IF (nstop == 0) THEN 430 CALL oasis_terminate( nerror ) 431 ELSE 432 CALL oasis_abort( ncomp_id, "cpl_finalize", "NEMO ABORT STOP" ) 433 ENDIF 434 ! 435 END SUBROUTINE cpl_finalize 436 437 #if ! defined key_oasis3 438 439 !!---------------------------------------------------------------------- 440 !! No OASIS Library OASIS3 Dummy module... 441 !!---------------------------------------------------------------------- 442 443 SUBROUTINE oasis_init_comp(k1,cd1,k2) 444 CHARACTER(*), INTENT(in ) :: cd1 445 INTEGER , INTENT( out) :: k1,k2 446 k1 = -1 ; k2 = -1 447 WRITE(numout,*) 'oasis_init_comp: Error you sould not be there...', cd1 448 END SUBROUTINE oasis_init_comp 449 450 SUBROUTINE oasis_abort(k1,cd1,cd2) 451 INTEGER , INTENT(in ) :: k1 452 CHARACTER(*), INTENT(in ) :: cd1,cd2 453 WRITE(numout,*) 'oasis_abort: Error you sould not be there...', cd1, cd2 454 END SUBROUTINE oasis_abort 455 456 SUBROUTINE oasis_get_localcomm(k1,k2) 457 INTEGER , INTENT( out) :: k1,k2 458 k1 = -1 ; k2 = -1 459 WRITE(numout,*) 'oasis_get_localcomm: Error you sould not be there...' 460 END SUBROUTINE oasis_get_localcomm 461 462 SUBROUTINE oasis_def_partition(k1,k2,k3) 463 INTEGER , INTENT( out) :: k1,k3 464 INTEGER , INTENT(in ) :: k2(5) 465 k1 = k2(1) ; k3 = k2(5) 466 WRITE(numout,*) 'oasis_def_partition: Error you sould not be there...' 467 END SUBROUTINE oasis_def_partition 468 469 SUBROUTINE oasis_def_var(k1,cd1,k2,k3,k4,k5,k6,k7) 470 CHARACTER(*), INTENT(in ) :: cd1 471 INTEGER , INTENT(in ) :: k2,k3(2),k4,k5(2,2),k6 472 INTEGER , INTENT( out) :: k1,k7 473 k1 = -1 ; k7 = -1 474 WRITE(numout,*) 'oasis_def_var: Error you sould not be there...', cd1 475 END SUBROUTINE oasis_def_var 476 477 SUBROUTINE oasis_enddef(k1) 478 INTEGER , INTENT( out) :: k1 479 k1 = -1 480 WRITE(numout,*) 'oasis_enddef: Error you sould not be there...' 481 END SUBROUTINE oasis_enddef 482 483 SUBROUTINE oasis_put(k1,k2,p1,k3) 484 REAL(wp), DIMENSION(:,:), INTENT(in ) :: p1 485 INTEGER , INTENT(in ) :: k1,k2 486 INTEGER , INTENT( out) :: k3 487 k3 = -1 488 WRITE(numout,*) 'oasis_put: Error you sould not be there...' 489 END SUBROUTINE oasis_put 490 491 SUBROUTINE oasis_get(k1,k2,p1,k3) 492 REAL(wp), DIMENSION(:,:), INTENT( out) :: p1 493 INTEGER , INTENT(in ) :: k1,k2 494 INTEGER , INTENT( out) :: k3 495 p1(1,1) = -1. ; k3 = -1 496 WRITE(numout,*) 'oasis_get: Error you sould not be there...' 497 END SUBROUTINE oasis_get 498 499 SUBROUTINE oasis_get_freqs(k1,k2,k3,k4) 500 INTEGER , INTENT(in ) :: k1,k2 501 INTEGER, DIMENSION(1), INTENT( out) :: k3 502 INTEGER , INTENT( out) :: k4 503 k3(1) = k1 ; k4 = k2 504 WRITE(numout,*) 'oasis_get_freqs: Error you sould not be there...' 505 END SUBROUTINE oasis_get_freqs 506 507 SUBROUTINE oasis_terminate(k1) 508 INTEGER , INTENT( out) :: k1 509 k1 = -1 510 WRITE(numout,*) 'oasis_terminate: Error you sould not be there...' 511 END SUBROUTINE oasis_terminate 512 360 513 #endif 361 514 -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_ice.F90
r4306 r5038 14 14 !!---------------------------------------------------------------------- 15 15 USE par_oce ! ocean parameters 16 USE sbc_oce ! surface boundary condition: ocean 16 17 # if defined key_lim3 17 18 USE par_ice ! LIM-3 parameters … … 21 22 USE ice_2 22 23 # endif 23 # if defined key_cice 24 # if defined key_cice 24 25 USE ice_domain_size, only: ncat 25 26 #endif … … 55 56 # endif 56 57 57 #if defined key_lim3 || defined key_lim2 58 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qns_ice !: non solar heat flux over ice [W/m2] 59 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qsr_ice !: solar heat flux over ice [W/m2] 60 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qsr_ice_mean !: dauly mean solar heat flux over ice [W/m2] 61 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qla_ice !: latent flux over ice [W/m2] 62 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dqla_ice !: latent sensibility over ice [W/m2/K] 63 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dqns_ice !: non solar heat flux over ice (LW+SEN+LA) [W/m2/K] 64 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tn_ice !: ice surface temperature [K] 65 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: alb_ice !: albedo of ice 58 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qns_ice !: non solar heat flux over ice [W/m2] 59 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qsr_ice !: solar heat flux over ice [W/m2] 60 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qsr_ice_mean !: daily mean solar heat flux over ice [W/m2] 61 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qla_ice !: latent flux over ice [W/m2] 62 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dqla_ice !: latent sensibility over ice [W/m2/K] 63 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dqns_ice !: non solar heat flux over ice (LW+SEN+LA) [W/m2/K] 64 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tn_ice !: ice surface temperature [K] 65 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: alb_ice !: ice albedo [-] 66 66 67 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: utau_ice !: atmos-ice u-stress. VP: I-pt ; EVP: U,V-pts [N/m2]68 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vtau_ice !: atmos-ice v-stress. VP: I-pt ; EVP: U,V-pts [N/m2]69 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fr1_i0 !: 1st Qsr fraction penetrating inside ice cover[-]70 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fr2_i0 !: 2nd Qsr fraction penetrating inside ice cover[-]71 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_ice !: sublimation-snow budget over ice[kg/m2]67 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: utau_ice !: atmos-ice u-stress. VP: I-pt ; EVP: U,V-pts [N/m2] 68 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vtau_ice !: atmos-ice v-stress. VP: I-pt ; EVP: U,V-pts [N/m2] 69 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fr1_i0 !: Solar surface transmission parameter, thick ice [-] 70 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fr2_i0 !: Solar surface transmission parameter, thin ice [-] 71 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_ice !: sublimation - precip over sea ice [kg/m2] 72 72 73 # if defined key_lim3 74 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tatm_ice !: air temperature 75 # endif 73 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: topmelt !: category topmelt 74 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: botmelt !: category botmelt 76 75 77 # elif defined key_cice76 #if defined key_cice 78 77 ! 79 78 ! for consistency with LIM, these are declared with three dimensions 80 79 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qlw_ice !: incoming long-wave 81 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qla_ice !: latent flux over ice [W/m2]82 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qsr_ice !: solar heat flux over ice [W/m2]83 80 ! 84 81 ! other forcing arrays are two dimensional 85 82 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ss_iou !: x ice-ocean surface stress at NEMO U point 86 83 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ss_iov !: y ice-ocean surface stress at NEMO V point 87 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_ice !: sublimation-snow budget over ice [kg/m2]88 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tatm_ice !: air temperature89 84 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qatm_ice !: specific humidity 90 85 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: wndi_ice !: i wind at T point … … 93 88 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fr_iu !: ice fraction at NEMO U point 94 89 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fr_iv !: ice fraction at NEMO V point 95 ! 96 ! finally, arrays corresponding to different ice categories 97 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: a_i !: category ice fraction 98 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: topmelt !: category topmelt 99 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: botmelt !: category botmelt 90 91 ! variables used in the coupled interface 92 INTEGER , PUBLIC, PARAMETER :: jpl = ncat 93 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: u_ice, v_ice ! jpi, jpj 100 94 #endif 95 96 #if defined key_lim2 || defined key_cice 97 ! already defined in ice.F90 for LIM3 98 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: a_i 99 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ht_i, ht_s 100 #endif 101 102 #if defined key_lim3 || defined key_cice 103 ! not used with LIM2 104 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tatm_ice !: air temperature [K] 105 #endif 106 107 REAL(wp), PUBLIC, SAVE :: cldf_ice = 0.81 !: cloud fraction over sea ice, summer CLIO value [-] 101 108 102 109 !!---------------------------------------------------------------------- … … 111 118 !! *** FUNCTION sbc_ice_alloc *** 112 119 !!---------------------------------------------------------------------- 113 INTEGER :: ierr( 2)120 INTEGER :: ierr(5) 114 121 !!---------------------------------------------------------------------- 115 122 ierr(:) = 0 … … 123 130 & fr1_i0 (jpi,jpj) , fr2_i0 (jpi,jpj) , & 124 131 #if defined key_lim3 125 & emp_ice(jpi,jpj) , tatm_ice(jpi,jpj) , STAT= ierr(1) ) 126 #else 127 & emp_ice(jpi,jpj) , STAT= ierr(1) ) 132 & tatm_ice(jpi,jpj) , & 128 133 #endif 129 #elif defined key_cice 134 #if defined key_lim2 135 & a_i(jpi,jpj,jpl) , & 136 #endif 137 & emp_ice(jpi,jpj) , STAT= ierr(1) ) 138 #endif 139 140 #if defined key_cice 130 141 ALLOCATE( qla_ice(jpi,jpj,1) , qlw_ice(jpi,jpj,1) , qsr_ice(jpi,jpj,1) , & 131 142 wndi_ice(jpi,jpj) , tatm_ice(jpi,jpj) , qatm_ice(jpi,jpj) , & 132 143 wndj_ice(jpi,jpj) , nfrzmlt(jpi,jpj) , ss_iou(jpi,jpj) , & 133 144 ss_iov(jpi,jpj) , fr_iu(jpi,jpj) , fr_iv(jpi,jpj) , & 134 a_i(jpi,jpj,ncat) , topmelt(jpi,jpj,ncat) , botmelt(jpi,jpj,ncat), STAT= ierr(1) ) 145 a_i(jpi,jpj,ncat) , topmelt(jpi,jpj,ncat) , botmelt(jpi,jpj,ncat) , & 146 STAT= ierr(1) ) 147 IF( lk_cpl ) ALLOCATE( u_ice(jpi,jpj) , fr1_i0(jpi,jpj) , tn_ice (jpi,jpj,1) , & 148 & v_ice(jpi,jpj) , fr2_i0(jpi,jpj) , alb_ice(jpi,jpj,1) , & 149 & emp_ice(jpi,jpj) , qns_ice(jpi,jpj,1) , dqns_ice(jpi,jpj,1) , & 150 & STAT= ierr(2) ) 151 135 152 #endif 136 153 ! 137 154 #if defined key_lim2 138 IF( ltrcdm2dc_ice )THEN 139 ALLOCATE( qsr_ice_mean (jpi,jpj,jpl), STAT=ierr(2) ) 140 ENDIF 155 IF( ltrcdm2dc_ice ) ALLOCATE( qsr_ice_mean (jpi,jpj,jpl), STAT=ierr(3) ) 141 156 #endif 142 157 ! 158 #if defined key_cice || defined key_lim2 159 IF( lk_cpl ) ALLOCATE( ht_i(jpi,jpj,jpl) , ht_s(jpi,jpj,jpl) , STAT=ierr(5) ) 160 #endif 161 143 162 sbc_ice_alloc = MAXVAL( ierr ) 144 163 IF( lk_mpp ) CALL mpp_sum ( sbc_ice_alloc ) … … 150 169 !! Default option NO LIM 2.0 or 3.0 or CICE sea-ice model 151 170 !!---------------------------------------------------------------------- 171 USE in_out_manager ! I/O manager 152 172 LOGICAL , PUBLIC, PARAMETER :: lk_lim2 = .FALSE. !: no LIM-2 ice model 153 173 LOGICAL , PUBLIC, PARAMETER :: lk_lim3 = .FALSE. !: no LIM-3 ice model 154 174 LOGICAL , PUBLIC, PARAMETER :: lk_cice = .FALSE. !: no CICE ice model 155 175 CHARACTER(len=1), PUBLIC, PARAMETER :: cp_ice_msh = '-' !: no grid ice-velocity 176 REAL , PUBLIC, PARAMETER :: cldf_ice = 0.81 !: cloud fraction over sea ice, summer CLIO value [-] 177 INTEGER , PUBLIC, PARAMETER :: jpl = 1 178 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: u_ice, v_ice,fr1_i0,fr2_i0 ! jpi, jpj 179 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tn_ice, alb_ice, qns_ice, dqns_ice ! (jpi,jpj,jpl) 180 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: a_i 181 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_ice 182 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qsr_ice 183 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ht_i, ht_s 184 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: topmelt, botmelt 156 185 #endif 157 186 -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
r4306 r5038 35 35 LOGICAL , PUBLIC :: ln_blk_core !: CORE bulk formulation 36 36 LOGICAL , PUBLIC :: ln_blk_mfs !: MFS bulk formulation 37 LOGICAL , PUBLIC :: ln_cpl !: coupled formulation (overwritten by key_sbc_coupled ) 37 #if defined key_oasis3 38 LOGICAL , PUBLIC :: lk_cpl = .TRUE. !: coupled formulation 39 #else 40 LOGICAL , PUBLIC :: lk_cpl = .FALSE. !: coupled formulation 41 #endif 38 42 LOGICAL , PUBLIC :: ln_dm2dc !: Daily mean to Diurnal Cycle short wave (qsr) 39 43 LOGICAL , PUBLIC :: ln_rnf !: runoffs / runoff mouths … … 41 45 LOGICAL , PUBLIC :: ln_apr_dyn !: Atmospheric pressure forcing used on dynamics (ocean & ice) 42 46 INTEGER , PUBLIC :: nn_ice !: flag for ice in the surface boundary condition (=0/1/2/3) 47 INTEGER , PUBLIC :: nn_isf !: flag for isf in the surface boundary condition (=0/1/2/3/4) 43 48 INTEGER , PUBLIC :: nn_ice_embd !: flag for levitating/embedding sea-ice in the ocean 44 49 ! !: =0 levitating ice (no mass exchange, concentration/dilution effect) 45 50 ! !: =1 levitating ice with mass and salt exchange but no presure effect 46 51 ! !: =2 embedded sea-ice (full salt and mass exchanges and pressure) 52 INTEGER , PUBLIC :: nn_limflx !: LIM3 Multi-category heat flux formulation 53 ! !: =-1 Use of per-category fluxes 54 ! !: = 0 Average per-category fluxes 55 ! !: = 1 Average then redistribute per-category fluxes 56 ! !: = 2 Redistribute a single flux over categories 47 57 INTEGER , PUBLIC :: nn_fwb !: FreshWater Budget: 48 58 ! !: = 0 unchecked … … 55 65 LOGICAL , PUBLIC :: ln_icebergs !: Icebergs 56 66 ! 57 CHARACTER (len=8), PUBLIC :: cn_iceflx !: Flux handling over ice categories 58 LOGICAL, PUBLIC :: ln_iceflx_ave ! Average heat fluxes over all ice categories 59 LOGICAL, PUBLIC :: ln_iceflx_linear ! Redistribute mean heat fluxes over all ice categories, using ice temperature and albedo 60 ! 61 INTEGER , PUBLIC :: nn_lsm !: Number of iteration if seaoverland is applied 67 INTEGER , PUBLIC :: nn_lsm !: Number of iteration if seaoverland is applied 68 !!---------------------------------------------------------------------- 69 !! switch definition (improve readability) 70 !!---------------------------------------------------------------------- 71 INTEGER , PUBLIC, PARAMETER :: jp_gyre = 0 !: GYRE analytical formulation 72 INTEGER , PUBLIC, PARAMETER :: jp_ana = 1 !: analytical formulation 73 INTEGER , PUBLIC, PARAMETER :: jp_flx = 2 !: flux formulation 74 INTEGER , PUBLIC, PARAMETER :: jp_clio = 3 !: CLIO bulk formulation 75 INTEGER , PUBLIC, PARAMETER :: jp_core = 4 !: CORE bulk formulation 76 INTEGER , PUBLIC, PARAMETER :: jp_cpl = 5 !: Coupled formulation 77 INTEGER , PUBLIC, PARAMETER :: jp_mfs = 6 !: MFS bulk formulation 78 INTEGER , PUBLIC, PARAMETER :: jp_esopa = -1 !: esopa test, ALL formulations 79 62 80 !!---------------------------------------------------------------------- 63 81 !! Ocean Surface Boundary Condition fields … … 102 120 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sss_m !: mean (nn_fsbc time-step) surface sea salinity [psu] 103 121 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ssh_m !: mean (nn_fsbc time-step) sea surface height [m] 104 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: e3t_m !: mean (nn_fsbc time-step) sea surface height[m]122 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: e3t_m !: mean (nn_fsbc time-step) sea surface layer thickness [m] 105 123 106 124 !! * Substitutions -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90
r4792 r5038 114 114 !! - utau, vtau i- and j-component of the wind stress 115 115 !! - taum wind stress module at T-point 116 !! - wndm 10m wind module at T-point 116 !! - wndm 10m wind module at T-point over free ocean or leads in presence of sea-ice 117 117 !! - qns non-solar heat flux including latent heat of solid 118 118 !! precip. melting and emp heat content … … 204 204 !! - utau, vtau i- and j-component of the wind stress 205 205 !! - taum wind stress module at T-point 206 !! - wndm 10m wind module at T-point 206 !! - wndm 10m wind module at T-point over free ocean or leads in presence of sea-ice 207 207 !! - qns non-solar heat flux including latent heat of solid 208 208 !! precip. melting and emp heat content … … 257 257 END DO 258 258 END DO 259 utau(:,:) = utau(:,:) * umask(:,:,1) 260 vtau(:,:) = vtau(:,:) * vmask(:,:,1) 261 taum(:,:) = taum(:,:) * tmask(:,:,1) 259 262 CALL lbc_lnk( taum, 'T', 1. ) 260 263 … … 264 267 !CDIR COLLAPSE 265 268 wndm(:,:) = sf(jp_wndm)%fnow(:,:,1) 269 wndm(:,:) = wndm(:,:) * tmask(:,:,1) 266 270 267 271 !------------------------------------------------! … … 270 274 271 275 CALL blk_clio_qsr_oce( qsr ) 272 276 qsr(:,:) = qsr(:,:) * tmask(:,:,1) ! no shortwave radiation into the ocean beneath ice shelf 273 277 !------------------------! 274 278 ! Other ocean fluxes ! … … 376 380 & - zqla(:,:) * pst(:,:) * zcevap & ! remove evap. heat content at SST in Celcius 377 381 & + sf(jp_prec)%fnow(:,:,1) * sf(jp_tair)%fnow(:,:,1) * zcprec ! add precip. heat content at Tair in Celcius 382 qns(:,:) = qns(:,:) * tmask(:,:,1) 378 383 ! NB: if sea-ice model, the snow precip are computed and the associated heat is added to qns (see blk_ice_clio) 379 384 … … 398 403 399 404 400 SUBROUTINE blk_ice_clio( pst , palb_cs, palb_os ,&405 SUBROUTINE blk_ice_clio( pst , palb_cs, palb_os, palb, & 401 406 & p_taui, p_tauj, p_qns , p_qsr, & 402 407 & p_qla , p_dqns, p_dqla, & … … 427 432 !!---------------------------------------------------------------------- 428 433 REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: pst ! ice surface temperature [Kelvin] 429 REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: palb_cs ! ice albedo (clear sky) (alb_ice_cs) [%] 430 REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: palb_os ! ice albedo (overcast sky) (alb_ice_os) [%] 434 REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: palb_cs ! ice albedo (clear sky) (alb_ice_cs) [-] 435 REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: palb_os ! ice albedo (overcast sky) (alb_ice_os) [-] 436 REAL(wp), INTENT( out), DIMENSION(:,:,:) :: palb ! ice albedo (actual value) [-] 431 437 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_taui ! surface ice stress at I-point (i-component) [N/m2] 432 438 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_tauj ! surface ice stress at I-point (j-component) [N/m2] … … 438 444 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_tpr ! total precipitation (T-point) [Kg/m2/s] 439 445 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_spr ! solid precipitation (T-point) [Kg/m2/s] 440 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_fr1 ! 1sr fraction of qsr penetration in ice [ %]441 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_fr2 ! 2nd fraction of qsr penetration in ice [ %]446 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_fr1 ! 1sr fraction of qsr penetration in ice [-] 447 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: p_fr2 ! 2nd fraction of qsr penetration in ice [-] 442 448 CHARACTER(len=1), INTENT(in ) :: cd_grid ! type of sea-ice grid ("C" or "B" grid) 443 449 INTEGER, INTENT(in ) :: pdim ! number of ice categories … … 542 548 !-----------------------------------------------------------! 543 549 CALL blk_clio_qsr_ice( palb_cs, palb_os, p_qsr ) 550 551 DO jl = 1, ijpl 552 palb(:,:,jl) = ( palb_cs(:,:,jl) * ( 1.e0 - sf(jp_ccov)%fnow(:,:,1) ) & 553 & + palb_os(:,:,jl) * sf(jp_ccov)%fnow(:,:,1) ) 554 END DO 544 555 545 556 ! ! ========================== ! -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
r4792 r5038 5 5 !!===================================================================== 6 6 !! History : 1.0 ! 2004-08 (U. Schweckendiek) Original code 7 !! 2.0 ! 2005-04 (L. Brodeau, A.M. Treguier) additions: 7 !! 2.0 ! 2005-04 (L. Brodeau, A.M. Treguier) additions: 8 8 !! - new bulk routine for efficiency 9 9 !! - WINDS ARE NOW ASSUMED TO BE AT T POINTS in input files !!!! 10 !! - file names and file characteristics in namelist 11 !! - Implement reading of 6-hourly fields 12 !! 3.0 ! 2006-06 (G. Madec) sbc rewritting 13 !! - ! 2006-12 (L. Brodeau) Original code for TURB_CORE_2Z10 !! - file names and file characteristics in namelist 11 !! - Implement reading of 6-hourly fields 12 !! 3.0 ! 2006-06 (G. Madec) sbc rewritting 13 !! - ! 2006-12 (L. Brodeau) Original code for turb_core_2z 14 14 !! 3.2 ! 2009-04 (B. Lemaire) Introduce iom_put 15 15 !! 3.3 ! 2010-10 (S. Masson) add diurnal cycle 16 16 !! 3.4 ! 2011-11 (C. Harris) Fill arrays required by CICE 17 !! 3.7 ! 2014-06 (L. Brodeau) simplification and optimization of CORE bulk 17 18 !!---------------------------------------------------------------------- 18 19 19 20 !!---------------------------------------------------------------------- 20 !! sbc_blk_core : bulk formulation as ocean surface boundary condition 21 !! (forced mode, CORE bulk formulea) 22 !! blk_oce_core : ocean: computes momentum, heat and freshwater fluxes 23 !! blk_ice_core : ice : computes momentum, heat and freshwater fluxes 24 !! turb_core : computes the CORE turbulent transfer coefficients 21 !! sbc_blk_core : bulk formulation as ocean surface boundary condition (forced mode, CORE bulk formulea) 22 !! blk_oce_core : computes momentum, heat and freshwater fluxes over ocean 23 !! blk_ice_core : computes momentum, heat and freshwater fluxes over ice 24 !! blk_bio_meanqsr : compute daily mean short wave radiation over the ocean 25 !! blk_ice_meanqsr : compute daily mean short wave radiation over the ice 26 !! turb_core_2z : Computes turbulent transfert coefficients 27 !! cd_neutral_10m : Estimate of the neutral drag coefficient at 10m 28 !! psi_m : universal profile stability function for momentum 29 !! psi_h : universal profile stability function for temperature and humidity 25 30 !!---------------------------------------------------------------------- 26 31 USE oce ! ocean dynamics and tracers … … 38 43 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 39 44 USE prtctl ! Print control 40 USE sbcwave,ONLY : cdn_wave !wave module 41 #if defined key_lim3 || defined key_cice 45 USE sbcwave, ONLY : cdn_wave ! wave module 42 46 USE sbc_ice ! Surface boundary condition: ice fields 43 #endif44 47 USE lib_fortran ! to use key_nosignedzero 45 48 … … 52 55 PUBLIC turb_core_2z ! routine calles in sbcblk_mfs module 53 56 54 INTEGER , PARAMETER :: jpfld = 9 ! maximum number of files to read 57 INTEGER , PARAMETER :: jpfld = 9 ! maximum number of files to read 55 58 INTEGER , PARAMETER :: jp_wndi = 1 ! index of 10m wind velocity (i-component) (m/s) at T-point 56 59 INTEGER , PARAMETER :: jp_wndj = 2 ! index of 10m wind velocity (j-component) (m/s) at T-point … … 62 65 INTEGER , PARAMETER :: jp_snow = 8 ! index of snow (solid prcipitation) (kg/m2/s) 63 66 INTEGER , PARAMETER :: jp_tdif = 9 ! index of tau diff associated to HF tau (N/m2) at T-point 64 67 65 68 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf ! structure of input fields (file informations, fields read) 66 69 67 70 ! !!! CORE bulk parameters 68 71 REAL(wp), PARAMETER :: rhoa = 1.22 ! air density … … 75 78 76 79 ! !!* Namelist namsbc_core : CORE bulk parameters 77 LOGICAL :: ln_2m ! logical flag for height of air temp. and hum78 80 LOGICAL :: ln_taudif ! logical flag to use the "mean of stress module - module of mean stress" data 79 81 REAL(wp) :: rn_pfac ! multiplication factor for precipitation 80 82 REAL(wp) :: rn_efac ! multiplication factor for evaporation (clem) 81 83 REAL(wp) :: rn_vfac ! multiplication factor for ice/ocean velocity in the calculation of wind stress (clem) 82 LOGICAL :: ln_bulk2z ! logical flag for case where z(q,t) and z(u) are specified in the namelist83 84 REAL(wp) :: rn_zqt ! z(q,t) : height of humidity and temperature measurements 84 85 REAL(wp) :: rn_zu ! z(u) : height of wind measurements … … 88 89 # include "vectopt_loop_substitute.h90" 89 90 !!---------------------------------------------------------------------- 90 !! NEMO/OPA 3. 3 , NEMO-consortium (2010)91 !! NEMO/OPA 3.7 , NEMO-consortium (2014) 91 92 !! $Id$ 92 93 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 97 98 !!--------------------------------------------------------------------- 98 99 !! *** ROUTINE sbc_blk_core *** 99 !! 100 !! 100 101 !! ** Purpose : provide at each time step the surface ocean fluxes 101 !! (momentum, heat, freshwater and runoff) 102 !! (momentum, heat, freshwater and runoff) 102 103 !! 103 104 !! ** Method : (1) READ each fluxes in NetCDF files: … … 118 119 !! ** Action : defined at each time-step at the air-sea interface 119 120 !! - utau, vtau i- and j-component of the wind stress 120 !! - taum, wndm wind stress and 10m wind modules at T-point 121 !! - taum wind stress module at T-point 122 !! - wndm wind speed module at T-point over free ocean or leads in presence of sea-ice 121 123 !! - qns, qsr non-solar and solar heat fluxes 122 124 !! - emp upward mass flux (evapo. - precip.) 123 125 !! - sfx salt flux due to freezing/melting (non-zero only if ice is present) 124 126 !! (set in limsbc(_2).F90) 127 !! 128 !! ** References : Large & Yeager, 2004 / Large & Yeager, 2008 129 !! Brodeau et al. Ocean Modelling 2010 125 130 !!---------------------------------------------------------------------- 126 131 INTEGER, INTENT(in) :: kt ! ocean time step 127 ! !132 ! 128 133 INTEGER :: ierror ! return error code 129 134 INTEGER :: ifpr ! dummy loop indice 130 135 INTEGER :: jfld ! dummy loop arguments 131 136 INTEGER :: ios ! Local integer output status for namelist read 132 ! !137 ! 133 138 CHARACTER(len=100) :: cn_dir ! Root directory for location of core files 134 139 TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist informations on the fields to read … … 136 141 TYPE(FLD_N) :: sn_qlw , sn_tair, sn_prec, sn_snow ! " " 137 142 TYPE(FLD_N) :: sn_tdif ! " " 138 NAMELIST/namsbc_core/ cn_dir , ln_ 2m , ln_taudif, rn_pfac, rn_efac, rn_vfac, &143 NAMELIST/namsbc_core/ cn_dir , ln_taudif, rn_pfac, rn_efac, rn_vfac, & 139 144 & sn_wndi, sn_wndj, sn_humi , sn_qsr , & 140 145 & sn_qlw , sn_tair, sn_prec , sn_snow, & 141 & sn_tdif, rn_zqt , ln_bulk2z,rn_zu142 !!--------------------------------------------------------------------- 143 146 & sn_tdif, rn_zqt, rn_zu 147 !!--------------------------------------------------------------------- 148 ! 144 149 ! ! ====================== ! 145 150 IF( kt == nit000 ) THEN ! First call kt=nit000 ! … … 149 154 READ ( numnam_ref, namsbc_core, IOSTAT = ios, ERR = 901) 150 155 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_core in reference namelist', lwp ) 151 156 ! 152 157 REWIND( numnam_cfg ) ! Namelist namsbc_core in configuration namelist : CORE bulk parameters 153 158 READ ( numnam_cfg, namsbc_core, IOSTAT = ios, ERR = 902 ) 154 159 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_core in configuration namelist', lwp ) 155 160 156 IF(lwm) WRITE 161 IF(lwm) WRITE( numond, namsbc_core ) 157 162 ! ! check: do we plan to use ln_dm2dc with non-daily forcing? 158 IF( ln_dm2dc .AND. sn_qsr%nfreqh /= 24 ) & 159 & CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' ) 163 IF( ln_dm2dc .AND. sn_qsr%nfreqh /= 24 ) & 164 & CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' ) 160 165 IF( ln_dm2dc .AND. sn_qsr%ln_tint ) THEN 161 166 CALL ctl_warn( 'sbc_blk_core: ln_dm2dc is taking care of the temporal interpolation of daily qsr', & 162 167 & ' ==> We force time interpolation = .false. for qsr' ) 163 168 sn_qsr%ln_tint = .false. 164 169 ENDIF … … 169 174 slf_i(jp_prec) = sn_prec ; slf_i(jp_snow) = sn_snow 170 175 slf_i(jp_tdif) = sn_tdif 171 ! 176 ! 172 177 lhftau = ln_taudif ! do we use HF tau information? 173 178 jfld = jpfld - COUNT( (/.NOT. lhftau/) ) … … 191 196 IF( MOD( kt - 1, nn_fsbc ) == 0 ) CALL blk_oce_core( kt, sf, sst_m, ssu_m, ssv_m ) 192 197 193 ! If diurnal cycle is activated, compute a daily mean short waves flux for biogeochemistery 198 ! If diurnal cycle is activated, compute a daily mean short waves flux for biogeochemistery 194 199 IF( ltrcdm2dc ) CALL blk_bio_meanqsr 195 200 … … 226 231 !! - qsr : Solar heat flux over the ocean (W/m2) 227 232 !! - qns : Non Solar heat flux over the ocean (W/m2) 228 !! - evap : Evaporation over the ocean (kg/m2/s)229 233 !! - emp : evaporation minus precipitation (kg/m2/s) 230 234 !! … … 269 273 zwnd_j(:,:) = 0.e0 270 274 #if defined key_cyclone 271 # if defined key_vectopt_loop 272 !CDIR COLLAPSE 273 # endif 274 CALL wnd_cyc( kt, zwnd_i, zwnd_j ) ! add Manu ! 275 CALL wnd_cyc( kt, zwnd_i, zwnd_j ) ! add analytical tropical cyclone (Vincent et al. JGR 2012) 275 276 DO jj = 2, jpjm1 276 277 DO ji = fs_2, fs_jpim1 ! vect. opt. … … 279 280 END DO 280 281 END DO 281 #endif282 #if defined key_vectopt_loop283 !CDIR COLLAPSE284 282 #endif 285 283 DO jj = 2, jpjm1 … … 292 290 CALL lbc_lnk( zwnd_j(:,:) , 'T', -1. ) 293 291 ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked) 294 !CDIR NOVERRCHK295 !CDIR COLLAPSE296 292 wndm(:,:) = SQRT( zwnd_i(:,:) * zwnd_i(:,:) & 297 293 & + zwnd_j(:,:) * zwnd_j(:,:) ) * tmask(:,:,1) … … 300 296 ! I Radiative FLUXES ! 301 297 ! ----------------------------------------------------------------------------- ! 302 298 303 299 ! ocean albedo assumed to be constant + modify now Qsr to include the diurnal cycle ! Short Wave 304 300 zztmp = 1. - albo … … 306 302 ELSE ; qsr(:,:) = zztmp * sf(jp_qsr)%fnow(:,:,1) * tmask(:,:,1) 307 303 ENDIF 308 !CDIR COLLAPSE309 304 zqlw(:,:) = ( sf(jp_qlw)%fnow(:,:,1) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:) ) * tmask(:,:,1) ! Long Wave 310 305 ! ----------------------------------------------------------------------------- ! … … 313 308 314 309 ! ... specific humidity at SST and IST 315 !CDIR NOVERRCHK 316 !CDIR COLLAPSE 317 zqsatw(:,:) = zcoef_qsatw * EXP( -5107.4 / zst(:,:) ) 310 zqsatw(:,:) = zcoef_qsatw * EXP( -5107.4 / zst(:,:) ) 318 311 319 312 ! ... NCAR Bulk formulae, computation of Cd, Ch, Ce at T-point : 320 IF( ln_2m ) THEN 321 !! If air temp. and spec. hum. are given at different height (2m) than wind (10m) : 322 CALL TURB_CORE_2Z(2.,10., zst , sf(jp_tair)%fnow, & 323 & zqsatw, sf(jp_humi)%fnow, wndm, & 324 & Cd , Ch , Ce , & 325 & zt_zu , zq_zu ) 326 ELSE IF( ln_bulk2z ) THEN 327 !! If the height of the air temp./spec. hum. and wind are to be specified by hand : 328 IF( rn_zqt == rn_zu ) THEN 329 !! If air temp. and spec. hum. are at the same height as wind : 330 CALL TURB_CORE_1Z( rn_zu, zst , sf(jp_tair)%fnow(:,:,1), & 331 & zqsatw, sf(jp_humi)%fnow(:,:,1), wndm, & 332 & Cd , Ch , Ce ) 333 ELSE 334 !! If air temp. and spec. hum. are at a different height to wind : 335 CALL TURB_CORE_2Z(rn_zqt, rn_zu , zst , sf(jp_tair)%fnow, & 336 & zqsatw, sf(jp_humi)%fnow, wndm, & 337 & Cd , Ch , Ce , & 338 & zt_zu , zq_zu ) 339 ENDIF 340 ELSE 341 !! If air temp. and spec. hum. are given at same height than wind (10m) : 342 !gm bug? at the compiling phase, add a copy in temporary arrays... ==> check perf 343 ! CALL TURB_CORE_1Z( 10., zst (:,:), sf(jp_tair)%fnow(:,:), & 344 ! & zqsatw(:,:), sf(jp_humi)%fnow(:,:), wndm(:,:), & 345 ! & Cd (:,:), Ch (:,:), Ce (:,:) ) 346 !gm bug 347 ! ARPDBG - this won't compile with gfortran. Fix but check performance 348 ! as per comment above. 349 CALL TURB_CORE_1Z( 10., zst , sf(jp_tair)%fnow(:,:,1), & 350 & zqsatw, sf(jp_humi)%fnow(:,:,1), wndm, & 351 & Cd , Ch , Ce ) 352 ENDIF 353 313 CALL turb_core_2z( rn_zqt, rn_zu, zst, sf(jp_tair)%fnow, zqsatw, sf(jp_humi)%fnow, wndm, & 314 & Cd, Ch, Ce, zt_zu, zq_zu ) 315 354 316 ! ... tau module, i and j component 355 317 DO jj = 1, jpj … … 363 325 364 326 ! ... add the HF tau contribution to the wind stress module? 365 IF( lhftau ) THEN 366 !CDIR COLLAPSE 327 IF( lhftau ) THEN 367 328 taum(:,:) = taum(:,:) + sf(jp_tdif)%fnow(:,:,1) 368 329 ENDIF … … 371 332 ! ... utau, vtau at U- and V_points, resp. 372 333 ! Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines 334 ! Note the use of MAX(tmask(i,j),tmask(i+1,j) is to mask tau over ice shelves 373 335 DO jj = 1, jpjm1 374 336 DO ji = 1, fs_jpim1 375 utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj ) ) 376 vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( zwnd_j(ji,jj) + zwnd_j(ji ,jj+1) ) 337 utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj ) ) & 338 & * MAX(tmask(ji,jj,1),tmask(ji+1,jj,1)) 339 vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( zwnd_j(ji,jj) + zwnd_j(ji ,jj+1) ) & 340 & * MAX(tmask(ji,jj,1),tmask(ji,jj+1,1)) 377 341 END DO 378 342 END DO … … 380 344 CALL lbc_lnk( vtau(:,:), 'V', -1. ) 381 345 346 382 347 ! Turbulent fluxes over ocean 383 348 ! ----------------------------- 384 IF( ln_2m .OR. ( ln_bulk2z .AND. rn_zqt /= rn_zu )) THEN385 ! Values of temp. and hum. adjusted to height of wind must be used386 zevap(:,:) = rn_efac * MAX( 0.e0, rhoa *Ce(:,:)*( zqsatw(:,:) - zq_zu(:,:) ) * wndm(:,:) )! Evaporation387 zqsb (:,:) = rhoa*cpa*Ch(:,:)*( zst (:,:) - zt_zu(:,:) ) * wndm(:,:)! Sensible Heat349 IF( ABS( rn_zu - rn_zqt) < 0.01_wp ) THEN 350 !! q_air and t_air are (or "are almost") given at 10m (wind reference height) 351 zevap(:,:) = rn_efac*MAX( 0._wp, rhoa*Ce(:,:)*( zqsatw(:,:) - sf(jp_humi)%fnow(:,:,1) )*wndm(:,:) ) ! Evaporation 352 zqsb (:,:) = cpa*rhoa*Ch(:,:)*( zst (:,:) - sf(jp_tair)%fnow(:,:,1) )*wndm(:,:) ! Sensible Heat 388 353 ELSE 389 !CDIR COLLAPSE 390 zevap(:,:) = rn_efac * MAX( 0.e0, rhoa *Ce(:,:)*( zqsatw(:,:) - sf(jp_humi)%fnow(:,:,1) ) * wndm(:,:) ) ! Evaporation391 !CDIR COLLAPSE 392 zqsb (:,:) = rhoa*cpa*Ch(:,:)*( zst (:,:) - sf(jp_tair)%fnow(:,:,1) ) *wndm(:,:) ! Sensible Heat354 !! q_air and t_air are not given at 10m (wind reference height) 355 ! Values of temp. and hum. adjusted to height of wind during bulk algorithm iteration must be used!!! 356 zevap(:,:) = rn_efac*MAX( 0._wp, rhoa*Ce(:,:)*( zqsatw(:,:) - zq_zu(:,:) )*wndm(:,:) ) ! Evaporation 357 zqsb (:,:) = cpa*rhoa*Ch(:,:)*( zst (:,:) - zt_zu(:,:) )*wndm(:,:) ! Sensible Heat 393 358 ENDIF 394 !CDIR COLLAPSE395 359 zqla (:,:) = Lv * zevap(:,:) ! Latent Heat 396 360 … … 409 373 ! III Total FLUXES ! 410 374 ! ----------------------------------------------------------------------------- ! 411 412 !CDIR COLLAPSE 375 ! 413 376 emp (:,:) = ( zevap(:,:) & ! mass flux (evap. - precip.) 414 377 & - sf(jp_prec)%fnow(:,:,1) * rn_pfac ) * tmask(:,:,1) 415 !CDIR COLLAPSE416 378 qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:) & ! Downward Non Solar flux 417 379 & - sf(jp_snow)%fnow(:,:,1) * rn_pfac * lfus & ! remove latent melting heat for solid precip 418 380 & - zevap(:,:) * pst(:,:) * rcp & ! remove evap heat content at SST 419 381 & + ( sf(jp_prec)%fnow(:,:,1) - sf(jp_snow)%fnow(:,:,1) ) * rn_pfac & ! add liquid precip heat content at Tair 420 & * ( sf(jp_tair)%fnow(:,:,1) - rt0 ) * rcp & 382 & * ( sf(jp_tair)%fnow(:,:,1) - rt0 ) * rcp & 421 383 & + sf(jp_snow)%fnow(:,:,1) * rn_pfac & ! add solid precip heat content at min(Tair,Tsnow) 422 & * ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic 384 & * ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) 423 385 ! 424 386 CALL iom_put( "qlw_oce", zqlw ) ! output downward longwave heat over the ocean … … 442 404 ! 443 405 END SUBROUTINE blk_oce_core 444 445 SUBROUTINE blk_bio_meanqsr446 !!---------------------------------------------------------------------447 !! *** ROUTINE blk_bio_meanqsr448 !!449 !! ** Purpose : provide daily qsr_mean for PISCES when450 !! analytic diurnal cycle is applied in physic451 !!452 !! ** Method : add part where there is no ice453 !!454 !!---------------------------------------------------------------------455 IF( nn_timing == 1 ) CALL timing_start('blk_bio_meanqsr')456 457 qsr_mean(:,:) = (1. - albo ) * sf(jp_qsr)%fnow(:,:,1)458 459 IF( nn_timing == 1 ) CALL timing_stop('blk_bio_meanqsr')460 461 END SUBROUTINE blk_bio_meanqsr462 463 464 SUBROUTINE blk_ice_meanqsr(palb,p_qsr_mean,pdim)465 !!---------------------------------------------------------------------466 !!467 !! ** Purpose : provide the daily qsr_mean over sea_ice for PISCES when468 !! analytic diurnal cycle is applied in physic469 !!470 !! ** Method : compute qsr471 !!472 !!---------------------------------------------------------------------473 REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: palb ! ice albedo (clear sky) (alb_ice_cs) [%]474 REAL(wp), DIMENSION(:,:,:), INTENT( out) :: p_qsr_mean ! solar heat flux over ice (T-point) [W/m2]475 INTEGER , INTENT(in ) :: pdim ! number of ice categories476 !!477 INTEGER :: ijpl ! number of ice categories (size of 3rd dim of input arrays)478 INTEGER :: ji, jj, jl ! dummy loop indices479 REAL(wp) :: zztmp ! temporary variable480 !!---------------------------------------------------------------------481 IF( nn_timing == 1 ) CALL timing_start('blk_ice_meanqsr')482 !483 ijpl = pdim ! number of ice categories484 zztmp = 1. / ( 1. - albo )485 ! ! ========================== !486 DO jl = 1, ijpl ! Loop over ice categories !487 ! ! ========================== !488 DO jj = 1 , jpj489 DO ji = 1, jpi490 p_qsr_mean(ji,jj,jl) = zztmp * ( 1. - palb(ji,jj,jl) ) * qsr_mean(ji,jj)491 END DO492 END DO493 END DO494 !495 IF( nn_timing == 1 ) CALL timing_stop('blk_ice_meanqsr')496 !497 END SUBROUTINE blk_ice_meanqsr498 406 499 407 … … 518 426 REAL(wp), DIMENSION(:,:) , INTENT(in ) :: pui ! ice surface velocity (i- and i- components [m/s] 519 427 REAL(wp), DIMENSION(:,:) , INTENT(in ) :: pvi ! at I-point (B-grid) or U & V-point (C-grid) 520 REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: palb ! ice albedo ( clear sky) (alb_ice_cs)[%]428 REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: palb ! ice albedo (all skies) [%] 521 429 REAL(wp), DIMENSION(:,:) , INTENT( out) :: p_taui ! i- & j-components of surface ice stress [N/m2] 522 430 REAL(wp), DIMENSION(:,:) , INTENT( out) :: p_tauj ! at I-point (B-grid) or U & V-point (C-grid) … … 538 446 REAL(wp) :: zcoef_wnorm, zcoef_wnorm2, zcoef_dqlw, zcoef_dqla, zcoef_dqsb 539 447 REAL(wp) :: zztmp ! temporary variable 540 REAL(wp) :: zcoef_frca ! fractional cloud amount541 448 REAL(wp) :: zwnorm_f, zwndi_f , zwndj_f ! relative wind module and components at F-point 542 449 REAL(wp) :: zwndi_t , zwndj_t ! relative wind components at T-point … … 562 469 zcoef_dqla = -Ls * Cice * 11637800. * (-5897.8) 563 470 zcoef_dqsb = rhoa * cpa * Cice 564 zcoef_frca = 1.0 - 0.3565 ! MV 2014 the proper cloud fraction (mean summer months from the CLIO climato, NH+SH) is 0.19566 zcoef_frca = 1.0 - 0.19567 471 568 472 !!gm brutal.... … … 581 485 CASE( 'I' ) ! B-grid ice dynamics : I-point (i.e. F-point with sea-ice indexation) 582 486 ! and scalar wind at T-point ( = | U10m - U_ice | ) (masked) 583 !CDIR NOVERRCHK584 487 DO jj = 2, jpjm1 585 488 DO ji = 2, jpim1 ! B grid : NO vector opt … … 606 509 ! 607 510 CASE( 'C' ) ! C-grid ice dynamics : U & V-points (same as ocean) 608 #if defined key_vectopt_loop609 !CDIR COLLAPSE610 #endif611 511 DO jj = 2, jpj 612 512 DO ji = fs_2, jpi ! vect. opt. … … 616 516 END DO 617 517 END DO 618 #if defined key_vectopt_loop619 !CDIR COLLAPSE620 #endif621 518 DO jj = 2, jpjm1 622 519 DO ji = fs_2, fs_jpim1 ! vect. opt. … … 637 534 DO jl = 1, ijpl ! Loop over ice categories ! 638 535 ! ! ========================== ! 639 !CDIR NOVERRCHK640 !CDIR COLLAPSE641 536 DO jj = 1 , jpj 642 !CDIR NOVERRCHK643 537 DO ji = 1, jpi 644 538 ! ----------------------------! … … 665 559 & * ( 11637800. * EXP( -5897.8 / pst(ji,jj,jl) ) / rhoa - sf(jp_humi)%fnow(ji,jj,1) ) ) 666 560 ! Latent heat sensitivity for ice (Dqla/Dt) 667 ! MV we also have to cap the sensitivity if the flux is zero 668 IF ( p_qla(ji,jj,jl) .GT. 0.0 ) THEN 561 IF( p_qla(ji,jj,jl) > 0._wp ) THEN 669 562 p_dqla(ji,jj,jl) = rn_efac * zcoef_dqla * z_wnds_t(ji,jj) / ( zst2 ) * EXP( -5897.8 / pst(ji,jj,jl) ) 670 563 ELSE 671 p_dqla(ji,jj,jl) = 0. 0564 p_dqla(ji,jj,jl) = 0._wp 672 565 ENDIF 673 566 674 567 ! Sensible heat sensitivity (Dqsb_ice/Dtn_ice) 675 568 z_dqsb(ji,jj,jl) = zcoef_dqsb * z_wnds_t(ji,jj) … … 679 572 ! ----------------------------! 680 573 ! Downward Non Solar flux 681 p_qns (ji,jj,jl) = z_qlw (ji,jj,jl) - z_qsb (ji,jj,jl) - p_qla (ji,jj,jl) 574 p_qns (ji,jj,jl) = z_qlw (ji,jj,jl) - z_qsb (ji,jj,jl) - p_qla (ji,jj,jl) 682 575 ! Total non solar heat flux sensitivity for ice 683 p_dqns(ji,jj,jl) = - ( z_dqlw(ji,jj,jl) + z_dqsb(ji,jj,jl) + p_dqla(ji,jj,jl) ) 576 p_dqns(ji,jj,jl) = - ( z_dqlw(ji,jj,jl) + z_dqsb(ji,jj,jl) + p_dqla(ji,jj,jl) ) 684 577 END DO 685 578 ! … … 692 585 ! thin surface layer and penetrates inside the ice cover 693 586 ! ( Maykut and Untersteiner, 1971 ; Ebert and Curry, 1993 ) 694 695 !CDIR COLLAPSE 696 p_fr1(:,:) = ( 0.18 * ( 1.0 - zcoef_frca ) + 0.35 * zcoef_frca ) 697 !CDIR COLLAPSE 698 p_fr2(:,:) = ( 0.82 * ( 1.0 - zcoef_frca ) + 0.65 * zcoef_frca ) 699 700 !CDIR COLLAPSE 587 ! 588 p_fr1(:,:) = ( 0.18 * ( 1.0 - cldf_ice ) + 0.35 * cldf_ice ) 589 p_fr2(:,:) = ( 0.82 * ( 1.0 - cldf_ice ) + 0.65 * cldf_ice ) 590 ! 701 591 p_tpr(:,:) = sf(jp_prec)%fnow(:,:,1) * rn_pfac ! total precipitation [kg/m2/s] 702 !CDIR COLLAPSE703 592 p_spr(:,:) = sf(jp_snow)%fnow(:,:,1) * rn_pfac ! solid precipitation [kg/m2/s] 704 CALL iom_put( 'snowpre', p_spr * 86400. ) ! Snow precipitation 705 CALL iom_put( 'precip' , p_tpr * 86400. ) ! Total precipitation593 CALL iom_put( 'snowpre', p_spr * 86400. ) ! Snow precipitation 594 CALL iom_put( 'precip' , p_tpr * 86400. ) ! Total precipitation 706 595 ! 707 596 IF(ln_ctl) THEN … … 716 605 ENDIF 717 606 718 CALL wrk_dealloc( jpi,jpj, z_wnds_t )719 CALL wrk_dealloc( jpi,jpj, pdim, z_qlw, z_qsb, z_dqlw, z_dqsb )607 CALL wrk_dealloc( jpi,jpj, z_wnds_t ) 608 CALL wrk_dealloc( jpi,jpj, pdim, z_qlw, z_qsb, z_dqlw, z_dqsb ) 720 609 ! 721 610 IF( nn_timing == 1 ) CALL timing_stop('blk_ice_core') 722 611 ! 723 612 END SUBROUTINE blk_ice_core 724 725 726 SUBROUTINE TURB_CORE_1Z(zu, sst, T_a, q_sat, q_a, & 727 & dU , Cd , Ch , Ce ) 613 614 615 SUBROUTINE blk_bio_meanqsr 616 !!--------------------------------------------------------------------- 617 !! *** ROUTINE blk_bio_meanqsr 618 !! 619 !! ** Purpose : provide daily qsr_mean for PISCES when 620 !! analytic diurnal cycle is applied in physic 621 !! 622 !! ** Method : add part where there is no ice 623 !! 624 !!--------------------------------------------------------------------- 625 IF( nn_timing == 1 ) CALL timing_start('blk_bio_meanqsr') 626 ! 627 qsr_mean(:,:) = (1. - albo ) * sf(jp_qsr)%fnow(:,:,1) 628 ! 629 IF( nn_timing == 1 ) CALL timing_stop('blk_bio_meanqsr') 630 ! 631 END SUBROUTINE blk_bio_meanqsr 632 633 634 SUBROUTINE blk_ice_meanqsr( palb, p_qsr_mean, pdim ) 635 !!--------------------------------------------------------------------- 636 !! 637 !! ** Purpose : provide the daily qsr_mean over sea_ice for PISCES when 638 !! analytic diurnal cycle is applied in physic 639 !! 640 !! ** Method : compute qsr 641 !! 642 !!--------------------------------------------------------------------- 643 REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: palb ! ice albedo (clear sky) (alb_ice_cs) [%] 644 REAL(wp), DIMENSION(:,:,:), INTENT( out) :: p_qsr_mean ! solar heat flux over ice (T-point) [W/m2] 645 INTEGER , INTENT(in ) :: pdim ! number of ice categories 646 ! 647 INTEGER :: ijpl ! number of ice categories (size of 3rd dim of input arrays) 648 INTEGER :: ji, jj, jl ! dummy loop indices 649 REAL(wp) :: zztmp ! temporary variable 650 !!--------------------------------------------------------------------- 651 IF( nn_timing == 1 ) CALL timing_start('blk_ice_meanqsr') 652 ! 653 ijpl = pdim ! number of ice categories 654 zztmp = 1. / ( 1. - albo ) 655 ! ! ========================== ! 656 DO jl = 1, ijpl ! Loop over ice categories ! 657 ! ! ========================== ! 658 DO jj = 1 , jpj 659 DO ji = 1, jpi 660 p_qsr_mean(ji,jj,jl) = zztmp * ( 1. - palb(ji,jj,jl) ) * qsr_mean(ji,jj) 661 END DO 662 END DO 663 END DO 664 ! 665 IF( nn_timing == 1 ) CALL timing_stop('blk_ice_meanqsr') 666 ! 667 END SUBROUTINE blk_ice_meanqsr 668 669 670 SUBROUTINE turb_core_2z( zt, zu, sst, T_zt, q_sat, q_zt, dU, & 671 & Cd, Ch, Ce , T_zu, q_zu ) 728 672 !!---------------------------------------------------------------------- 729 673 !! *** ROUTINE turb_core *** 730 674 !! 731 675 !! ** Purpose : Computes turbulent transfert coefficients of surface 732 !! fluxes according to Large & Yeager (2004) 733 !! 734 !! ** Method : I N E R T I A L D I S S I P A T I O N M E T H O D 735 !! Momentum, Latent and sensible heat exchange coefficients 736 !! Caution: this procedure should only be used in cases when air 737 !! temperature (T_air), air specific humidity (q_air) and wind (dU) 738 !! are provided at the same height 'zzu'! 739 !! 740 !! References : Large & Yeager, 2004 : ??? 741 !!---------------------------------------------------------------------- 742 REAL(wp) , INTENT(in ) :: zu ! altitude of wind measurement [m] 743 REAL(wp), DIMENSION(:,:), INTENT(in ) :: sst ! sea surface temperature [Kelvin] 744 REAL(wp), DIMENSION(:,:), INTENT(in ) :: T_a ! potential air temperature [Kelvin] 745 REAL(wp), DIMENSION(:,:), INTENT(in ) :: q_sat ! sea surface specific humidity [kg/kg] 746 REAL(wp), DIMENSION(:,:), INTENT(in ) :: q_a ! specific air humidity [kg/kg] 747 REAL(wp), DIMENSION(:,:), INTENT(in ) :: dU ! wind module |U(zu)-U(0)| [m/s] 748 REAL(wp), DIMENSION(:,:), INTENT( out) :: Cd ! transfert coefficient for momentum (tau) 749 REAL(wp), DIMENSION(:,:), INTENT( out) :: Ch ! transfert coefficient for temperature (Q_sens) 750 REAL(wp), DIMENSION(:,:), INTENT( out) :: Ce ! transfert coefficient for evaporation (Q_lat) 751 !! 752 INTEGER :: j_itt 753 INTEGER , PARAMETER :: nb_itt = 3 754 REAL(wp), PARAMETER :: grav = 9.8 ! gravity 755 REAL(wp), PARAMETER :: kappa = 0.4 ! von Karman s constant 756 757 REAL(wp), DIMENSION(:,:), POINTER :: dU10 ! dU [m/s] 758 REAL(wp), DIMENSION(:,:), POINTER :: dT ! air/sea temperature differeence [K] 759 REAL(wp), DIMENSION(:,:), POINTER :: dq ! air/sea humidity difference [K] 760 REAL(wp), DIMENSION(:,:), POINTER :: Cd_n10 ! 10m neutral drag coefficient 761 REAL(wp), DIMENSION(:,:), POINTER :: Ce_n10 ! 10m neutral latent coefficient 762 REAL(wp), DIMENSION(:,:), POINTER :: Ch_n10 ! 10m neutral sensible coefficient 763 REAL(wp), DIMENSION(:,:), POINTER :: sqrt_Cd_n10 ! root square of Cd_n10 764 REAL(wp), DIMENSION(:,:), POINTER :: sqrt_Cd ! root square of Cd 765 REAL(wp), DIMENSION(:,:), POINTER :: T_vpot ! virtual potential temperature [K] 766 REAL(wp), DIMENSION(:,:), POINTER :: T_star ! turbulent scale of tem. fluct. 767 REAL(wp), DIMENSION(:,:), POINTER :: q_star ! turbulent humidity of temp. fluct. 768 REAL(wp), DIMENSION(:,:), POINTER :: U_star ! turb. scale of velocity fluct. 769 REAL(wp), DIMENSION(:,:), POINTER :: L ! Monin-Obukov length [m] 770 REAL(wp), DIMENSION(:,:), POINTER :: zeta ! stability parameter at height zu 771 REAL(wp), DIMENSION(:,:), POINTER :: U_n10 ! neutral wind velocity at 10m [m] 772 REAL(wp), DIMENSION(:,:), POINTER :: xlogt, xct, zpsi_h, zpsi_m 773 774 INTEGER , DIMENSION(:,:), POINTER :: stab ! 1st guess stability test integer 775 !!---------------------------------------------------------------------- 776 ! 777 IF( nn_timing == 1 ) CALL timing_start('TURB_CORE_1Z') 778 ! 779 CALL wrk_alloc( jpi,jpj, stab ) ! integer 780 CALL wrk_alloc( jpi,jpj, dU10, dT, dq, Cd_n10, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd, L ) 781 CALL wrk_alloc( jpi,jpj, T_vpot, T_star, q_star, U_star, zeta, U_n10, xlogt, xct, zpsi_h, zpsi_m ) 782 783 !! * Start 784 !! Air/sea differences 785 dU10 = max(0.5, dU) ! we don't want to fall under 0.5 m/s 786 dT = T_a - sst ! assuming that T_a is allready the potential temp. at zzu 787 dq = q_a - q_sat 788 !! 789 !! Virtual potential temperature 790 T_vpot = T_a*(1. + 0.608*q_a) 791 !! 792 !! Neutral Drag Coefficient 793 stab = 0.5 + sign(0.5,dT) ! stable : stab = 1 ; unstable : stab = 0 794 IF ( ln_cdgw ) THEN 795 cdn_wave = cdn_wave - rsmall*(tmask(:,:,1)-1) 796 Cd_n10(:,:) = cdn_wave 797 ELSE 798 Cd_n10 = 1.e-3 * ( 2.7/dU10 + 0.142 + dU10/13.09 ) ! L & Y eq. (6a) 799 ENDIF 800 sqrt_Cd_n10 = sqrt(Cd_n10) 801 Ce_n10 = 1.e-3 * ( 34.6 * sqrt_Cd_n10 ) ! L & Y eq. (6b) 802 Ch_n10 = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1.-stab)) ! L & Y eq. (6c), (6d) 803 !! 804 !! Initializing transfert coefficients with their first guess neutral equivalents : 805 Cd = Cd_n10 ; Ce = Ce_n10 ; Ch = Ch_n10 ; sqrt_Cd = sqrt(Cd) 806 807 !! * Now starting iteration loop 808 DO j_itt=1, nb_itt 809 !! Turbulent scales : 810 U_star = sqrt_Cd*dU10 ! L & Y eq. (7a) 811 T_star = Ch/sqrt_Cd*dT ! L & Y eq. (7b) 812 q_star = Ce/sqrt_Cd*dq ! L & Y eq. (7c) 813 814 !! Estimate the Monin-Obukov length : 815 L = (U_star**2)/( kappa*grav*(T_star/T_vpot + q_star/(q_a + 1./0.608)) ) 816 817 !! Stability parameters : 818 zeta = zu/L ; zeta = sign( min(abs(zeta),10.0), zeta ) 819 zpsi_h = psi_h(zeta) 820 zpsi_m = psi_m(zeta) 821 822 IF ( ln_cdgw ) THEN 823 sqrt_Cd=kappa/((kappa/sqrt_Cd_n10) - zpsi_m) ; Cd=sqrt_Cd*sqrt_Cd; 824 ELSE 825 !! Shifting the wind speed to 10m and neutral stability : L & Y eq. (9a) 826 ! In very rare low-wind conditions, the old way of estimating the 827 ! neutral wind speed at 10m leads to a negative value that causes the code 828 ! to crash. To prevent this a threshold of 0.25m/s is now imposed. 829 U_n10 = MAX( 0.25 , dU10/(1. + sqrt_Cd_n10/kappa*(log(zu/10.) - zpsi_m)) ) 830 831 !! Updating the neutral 10m transfer coefficients : 832 Cd_n10 = 1.e-3 * (2.7/U_n10 + 0.142 + U_n10/13.09) ! L & Y eq. (6a) 833 sqrt_Cd_n10 = sqrt(Cd_n10) 834 Ce_n10 = 1.e-3 * (34.6 * sqrt_Cd_n10) ! L & Y eq. (6b) 835 stab = 0.5 + sign(0.5,zeta) 836 Ch_n10 = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1.-stab)) ! L & Y eq. (6c), (6d) 837 838 !! Shifting the neutral 10m transfer coefficients to ( zu , zeta ) : 839 !! 840 xct = 1. + sqrt_Cd_n10/kappa*(log(zu/10) - zpsi_m) 841 Cd = Cd_n10/(xct*xct) ; sqrt_Cd = sqrt(Cd) 842 ENDIF 843 !! 844 xlogt = log(zu/10.) - zpsi_h 845 !! 846 xct = 1. + Ch_n10*xlogt/kappa/sqrt_Cd_n10 847 Ch = Ch_n10*sqrt_Cd/sqrt_Cd_n10/xct 848 !! 849 xct = 1. + Ce_n10*xlogt/kappa/sqrt_Cd_n10 850 Ce = Ce_n10*sqrt_Cd/sqrt_Cd_n10/xct 851 !! 852 END DO 853 !! 854 CALL wrk_dealloc( jpi,jpj, stab ) ! integer 855 CALL wrk_dealloc( jpi,jpj, dU10, dT, dq, Cd_n10, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd, L ) 856 CALL wrk_dealloc( jpi,jpj, T_vpot, T_star, q_star, U_star, zeta, U_n10, xlogt, xct, zpsi_h, zpsi_m ) 857 ! 858 IF( nn_timing == 1 ) CALL timing_stop('TURB_CORE_1Z') 859 ! 860 END SUBROUTINE TURB_CORE_1Z 861 862 863 SUBROUTINE TURB_CORE_2Z(zt, zu, sst, T_zt, q_sat, q_zt, dU, Cd, Ch, Ce, T_zu, q_zu) 864 !!---------------------------------------------------------------------- 865 !! *** ROUTINE turb_core *** 866 !! 867 !! ** Purpose : Computes turbulent transfert coefficients of surface 868 !! fluxes according to Large & Yeager (2004). 869 !! 870 !! ** Method : I N E R T I A L D I S S I P A T I O N M E T H O D 871 !! Momentum, Latent and sensible heat exchange coefficients 872 !! Caution: this procedure should only be used in cases when air 873 !! temperature (T_air) and air specific humidity (q_air) are at a 874 !! different height to wind (dU). 875 !! 876 !! References : Large & Yeager, 2004 : ??? 676 !! fluxes according to Large & Yeager (2004) and Large & Yeager (2008) 677 !! If relevant (zt /= zu), adjust temperature and humidity from height zt to zu 678 !! 679 !! ** Method : Monin Obukhov Similarity Theory 680 !! + Large & Yeager (2004,2008) closure: CD_n10 = f(U_n10) 681 !! 682 !! ** References : Large & Yeager, 2004 / Large & Yeager, 2008 683 !! 684 !! ** Last update: Laurent Brodeau, June 2014: 685 !! - handles both cases zt=zu and zt/=zu 686 !! - optimized: less 2D arrays allocated and less operations 687 !! - better first guess of stability by checking air-sea difference of virtual temperature 688 !! rather than temperature difference only... 689 !! - added function "cd_neutral_10m" that uses the improved parametrization of 690 !! Large & Yeager 2008. Drag-coefficient reduction for Cyclone conditions! 691 !! - using code-wide physical constants defined into "phycst.mod" rather than redifining them 692 !! => 'vkarmn' and 'grav' 877 693 !!---------------------------------------------------------------------- 878 694 REAL(wp), INTENT(in ) :: zt ! height for T_zt and q_zt [m] … … 882 698 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: q_sat ! sea surface specific humidity [kg/kg] 883 699 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: q_zt ! specific air humidity [kg/kg] 884 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: dU ! relative wind module |U(zu)-U(0)|[m/s]700 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: dU ! relative wind module at zu [m/s] 885 701 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Cd ! transfer coefficient for momentum (tau) 886 702 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: Ch ! transfer coefficient for sensible heat (Q_sens) … … 888 704 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: T_zu ! air temp. shifted at zu [K] 889 705 REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: q_zu ! spec. hum. shifted at zu [kg/kg] 890 891 INTEGER :: j_itt 892 INTEGER , PARAMETER :: nb_itt = 5 ! number of itterations 893 REAL(wp), PARAMETER :: grav = 9.8 ! gravity 894 REAL(wp), PARAMETER :: kappa = 0.4 ! von Karman's constant 895 896 REAL(wp), DIMENSION(:,:), POINTER :: dU10 ! dU [m/s] 897 REAL(wp), DIMENSION(:,:), POINTER :: dT ! air/sea temperature differeence [K] 898 REAL(wp), DIMENSION(:,:), POINTER :: dq ! air/sea humidity difference [K] 899 REAL(wp), DIMENSION(:,:), POINTER :: Cd_n10 ! 10m neutral drag coefficient 706 ! 707 INTEGER :: j_itt 708 INTEGER , PARAMETER :: nb_itt = 5 ! number of itterations 709 LOGICAL :: l_zt_equal_zu = .FALSE. ! if q and t are given at different height than U 710 ! 711 REAL(wp), DIMENSION(:,:), POINTER :: U_zu ! relative wind at zu [m/s] 900 712 REAL(wp), DIMENSION(:,:), POINTER :: Ce_n10 ! 10m neutral latent coefficient 901 713 REAL(wp), DIMENSION(:,:), POINTER :: Ch_n10 ! 10m neutral sensible coefficient 902 714 REAL(wp), DIMENSION(:,:), POINTER :: sqrt_Cd_n10 ! root square of Cd_n10 903 715 REAL(wp), DIMENSION(:,:), POINTER :: sqrt_Cd ! root square of Cd 904 REAL(wp), DIMENSION(:,:), POINTER :: T_vpot ! virtual potential temperature [K]905 REAL(wp), DIMENSION(:,:), POINTER :: T_star ! turbulent scale of tem. fluct.906 REAL(wp), DIMENSION(:,:), POINTER :: q_star ! turbulent humidity of temp. fluct.907 REAL(wp), DIMENSION(:,:), POINTER :: U_star ! turb. scale of velocity fluct.908 REAL(wp), DIMENSION(:,:), POINTER :: L ! Monin-Obukov length [m]909 716 REAL(wp), DIMENSION(:,:), POINTER :: zeta_u ! stability parameter at height zu 910 717 REAL(wp), DIMENSION(:,:), POINTER :: zeta_t ! stability parameter at height zt 911 REAL(wp), DIMENSION(:,:), POINTER :: U_n10 ! neutral wind velocity at 10m [m] 912 REAL(wp), DIMENSION(:,:), POINTER :: xlogt, xct, zpsi_hu, zpsi_ht, zpsi_m 913 914 INTEGER , DIMENSION(:,:), POINTER :: stab ! 1st stability test integer 718 REAL(wp), DIMENSION(:,:), POINTER :: zpsi_h_u, zpsi_m_u 719 REAL(wp), DIMENSION(:,:), POINTER :: ztmp0, ztmp1, ztmp2 720 REAL(wp), DIMENSION(:,:), POINTER :: stab ! 1st stability test integer 915 721 !!---------------------------------------------------------------------- 916 ! 917 IF( nn_timing == 1 ) CALL timing_start('TURB_CORE_2Z') 918 ! 919 CALL wrk_alloc( jpi,jpj, dU10, dT, dq, Cd_n10, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd, L ) 920 CALL wrk_alloc( jpi,jpj, T_vpot, T_star, q_star, U_star, zeta_u, zeta_t, U_n10 ) 921 CALL wrk_alloc( jpi,jpj, xlogt, xct, zpsi_hu, zpsi_ht, zpsi_m ) 922 CALL wrk_alloc( jpi,jpj, stab ) ! interger 923 924 !! Initial air/sea differences 925 dU10 = max(0.5, dU) ! we don't want to fall under 0.5 m/s 926 dT = T_zt - sst 927 dq = q_zt - q_sat 928 929 !! Neutral Drag Coefficient : 930 stab = 0.5 + sign(0.5,dT) ! stab = 1 if dT > 0 -> STABLE 931 IF( ln_cdgw ) THEN 932 cdn_wave = cdn_wave - rsmall*(tmask(:,:,1)-1) 933 Cd_n10(:,:) = cdn_wave 722 723 IF( nn_timing == 1 ) CALL timing_start('turb_core_2z') 724 725 CALL wrk_alloc( jpi,jpj, U_zu, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd ) 726 CALL wrk_alloc( jpi,jpj, zeta_u, stab ) 727 CALL wrk_alloc( jpi,jpj, zpsi_h_u, zpsi_m_u, ztmp0, ztmp1, ztmp2 ) 728 729 l_zt_equal_zu = .FALSE. 730 IF( ABS(zu - zt) < 0.01 ) l_zt_equal_zu = .TRUE. ! testing "zu == zt" is risky with double precision 731 732 IF( .NOT. l_zt_equal_zu ) CALL wrk_alloc( jpi,jpj, zeta_t ) 733 734 U_zu = MAX( 0.5 , dU ) ! relative wind speed at zu (normally 10m), we don't want to fall under 0.5 m/s 735 736 !! First guess of stability: 737 ztmp0 = T_zt*(1. + 0.608*q_zt) - sst*(1. + 0.608*q_sat) ! air-sea difference of virtual pot. temp. at zt 738 stab = 0.5 + sign(0.5,ztmp0) ! stab = 1 if dTv > 0 => STABLE, 0 if unstable 739 740 !! Neutral coefficients at 10m: 741 IF( ln_cdgw ) THEN ! wave drag case 742 cdn_wave(:,:) = cdn_wave(:,:) + rsmall * ( 1._wp - tmask(:,:,1) ) 743 ztmp0 (:,:) = cdn_wave(:,:) 934 744 ELSE 935 Cd_n10 = 1.e-3*( 2.7/dU10 + 0.142 + dU10/13.09 )745 ztmp0 = cd_neutral_10m( U_zu ) 936 746 ENDIF 937 sqrt_Cd_n10 = sqrt(Cd_n10)747 sqrt_Cd_n10 = SQRT( ztmp0 ) 938 748 Ce_n10 = 1.e-3*( 34.6 * sqrt_Cd_n10 ) 939 749 Ch_n10 = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1. - stab)) 940 750 941 751 !! Initializing transf. coeff. with their first guess neutral equivalents : 942 Cd = Cd_n10 ; Ce = Ce_n10 ; Ch = Ch_n10 ; sqrt_Cd = sqrt(Cd)943 944 !! Initializing z_u values with z_t values:945 T_zu = T_zt ;q_zu = q_zt752 Cd = ztmp0 ; Ce = Ce_n10 ; Ch = Ch_n10 ; sqrt_Cd = sqrt_Cd_n10 753 754 !! Initializing values at z_u with z_t values: 755 T_zu = T_zt ; q_zu = q_zt 946 756 947 757 !! * Now starting iteration loop 948 758 DO j_itt=1, nb_itt 949 dT = T_zu - sst ; dq = q_zu - q_sat ! Updating air/sea differences 950 T_vpot = T_zu*(1. + 0.608*q_zu) ! Updating virtual potential temperature at zu 951 U_star = sqrt_Cd*dU10 ! Updating turbulent scales : (L & Y eq. (7)) 952 T_star = Ch/sqrt_Cd*dT ! 953 q_star = Ce/sqrt_Cd*dq ! 954 !! 955 L = (U_star*U_star) & ! Estimate the Monin-Obukov length at height zu 956 & / (kappa*grav/T_vpot*(T_star*(1.+0.608*q_zu) + 0.608*T_zu*q_star)) 759 ! 760 ztmp1 = T_zu - sst ! Updating air/sea differences 761 ztmp2 = q_zu - q_sat 762 763 ! Updating turbulent scales : (L&Y 2004 eq. (7)) 764 ztmp1 = Ch/sqrt_Cd*ztmp1 ! theta* 765 ztmp2 = Ce/sqrt_Cd*ztmp2 ! q* 766 767 ztmp0 = T_zu*(1. + 0.608*q_zu) ! virtual potential temperature at zu 768 769 ! Estimate the inverse of Monin-Obukov length (1/L) at height zu: 770 ztmp0 = (vkarmn*grav/ztmp0*(ztmp1*(1.+0.608*q_zu) + 0.608*T_zu*ztmp2)) / (Cd*U_zu*U_zu) 771 ! ( Cd*U_zu*U_zu is U*^2 at zu) 772 957 773 !! Stability parameters : 958 zeta_u = zu/L ; zeta_u = sign( min(abs(zeta_u),10.0), zeta_u ) 959 zeta_t = zt/L ; zeta_t = sign( min(abs(zeta_t),10.0), zeta_t ) 960 zpsi_hu = psi_h(zeta_u) 961 zpsi_ht = psi_h(zeta_t) 962 zpsi_m = psi_m(zeta_u) 963 !! 964 !! Shifting the wind speed to 10m and neutral stability : L & Y eq.(9a) 965 ! In very rare low-wind conditions, the old way of estimating the 966 ! neutral wind speed at 10m leads to a negative value that causes the code 967 ! to crash. To prevent this a threshold of 0.25m/s is now imposed. 968 U_n10 = MAX( 0.25 , dU10/(1. + sqrt_Cd_n10/kappa*(log(zu/10.) - zpsi_m)) ) 969 !! 970 !! Shifting temperature and humidity at zu : (L & Y eq. (9b-9c)) 971 ! T_zu = T_zt - T_star/kappa*(log(zt/zu) + psi_h(zeta_u) - psi_h(zeta_t)) 972 T_zu = T_zt - T_star/kappa*(log(zt/zu) + zpsi_hu - zpsi_ht) 973 ! q_zu = q_zt - q_star/kappa*(log(zt/zu) + psi_h(zeta_u) - psi_h(zeta_t)) 974 q_zu = q_zt - q_star/kappa*(log(zt/zu) + zpsi_hu - zpsi_ht) 975 !! 976 !! q_zu cannot have a negative value : forcing 0 977 stab = 0.5 + sign(0.5,q_zu) ; q_zu = stab*q_zu 978 !! 979 IF( ln_cdgw ) THEN 980 sqrt_Cd=kappa/((kappa/sqrt_Cd_n10) - zpsi_m) ; Cd=sqrt_Cd*sqrt_Cd; 774 zeta_u = zu*ztmp0 ; zeta_u = sign( min(abs(zeta_u),10.0), zeta_u ) 775 zpsi_h_u = psi_h( zeta_u ) 776 zpsi_m_u = psi_m( zeta_u ) 777 778 !! Shifting temperature and humidity at zu (L&Y 2004 eq. (9b-9c)) 779 IF ( .NOT. l_zt_equal_zu ) THEN 780 zeta_t = zt*ztmp0 ; zeta_t = sign( min(abs(zeta_t),10.0), zeta_t ) 781 stab = LOG(zu/zt) - zpsi_h_u + psi_h(zeta_t) ! stab just used as temp array!!! 782 T_zu = T_zt + ztmp1/vkarmn*stab ! ztmp1 is still theta* 783 q_zu = q_zt + ztmp2/vkarmn*stab ! ztmp2 is still q* 784 q_zu = max(0., q_zu) 785 END IF 786 787 IF( ln_cdgw ) THEN ! surface wave case 788 sqrt_Cd = vkarmn / ( vkarmn / sqrt_Cd_n10 - zpsi_m_u ) 789 Cd = sqrt_Cd * sqrt_Cd 981 790 ELSE 982 !! Updating the neutral 10m transfer coefficients : 983 Cd_n10 = 1.e-3 * (2.7/U_n10 + 0.142 + U_n10/13.09) ! L & Y eq. (6a) 984 sqrt_Cd_n10 = sqrt(Cd_n10) 985 Ce_n10 = 1.e-3 * (34.6 * sqrt_Cd_n10) ! L & Y eq. (6b) 986 stab = 0.5 + sign(0.5,zeta_u) 987 Ch_n10 = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1.-stab)) ! L & Y eq. (6c-6d) 988 !! 989 !! 990 !! Shifting the neutral 10m transfer coefficients to (zu,zeta_u) : 991 xct = 1. + sqrt_Cd_n10/kappa*(log(zu/10.) - zpsi_m) ! L & Y eq. (10a) 992 Cd = Cd_n10/(xct*xct) ; sqrt_Cd = sqrt(Cd) 791 ! Update neutral wind speed at 10m and neutral Cd at 10m (L&Y 2004 eq. 9a)... 792 ! In very rare low-wind conditions, the old way of estimating the 793 ! neutral wind speed at 10m leads to a negative value that causes the code 794 ! to crash. To prevent this a threshold of 0.25m/s is imposed. 795 ztmp0 = MAX( 0.25 , U_zu/(1. + sqrt_Cd_n10/vkarmn*(LOG(zu/10.) - zpsi_m_u)) ) ! U_n10 796 ztmp0 = cd_neutral_10m(ztmp0) ! Cd_n10 797 sqrt_Cd_n10 = sqrt(ztmp0) 798 799 Ce_n10 = 1.e-3 * (34.6 * sqrt_Cd_n10) ! L&Y 2004 eq. (6b) 800 stab = 0.5 + sign(0.5,zeta_u) ! update stability 801 Ch_n10 = 1.e-3*sqrt_Cd_n10*(18.*stab + 32.7*(1. - stab)) ! L&Y 2004 eq. (6c-6d) 802 803 !! Update of transfer coefficients: 804 ztmp1 = 1. + sqrt_Cd_n10/vkarmn*(LOG(zu/10.) - zpsi_m_u) ! L&Y 2004 eq. (10a) 805 Cd = ztmp0 / ( ztmp1*ztmp1 ) 806 sqrt_Cd = SQRT( Cd ) 993 807 ENDIF 994 !! 995 xlogt = log(zu/10.) - zpsi_hu 996 !! 997 xct = 1. + Ch_n10*xlogt/kappa/sqrt_Cd_n10 ! L & Y eq. (10b) 998 Ch = Ch_n10*sqrt_Cd/sqrt_Cd_n10/xct 999 !! 1000 xct = 1. + Ce_n10*xlogt/kappa/sqrt_Cd_n10 ! L & Y eq. (10c) 1001 Ce = Ce_n10*sqrt_Cd/sqrt_Cd_n10/xct 1002 !! 1003 !! 808 ! 809 ztmp0 = (LOG(zu/10.) - zpsi_h_u) / vkarmn / sqrt_Cd_n10 810 ztmp2 = sqrt_Cd / sqrt_Cd_n10 811 ztmp1 = 1. + Ch_n10*ztmp0 812 Ch = Ch_n10*ztmp2 / ztmp1 ! L&Y 2004 eq. (10b) 813 ! 814 ztmp1 = 1. + Ce_n10*ztmp0 815 Ce = Ce_n10*ztmp2 / ztmp1 ! L&Y 2004 eq. (10c) 816 ! 1004 817 END DO 1005 !! 1006 CALL wrk_dealloc( jpi,jpj, dU10, dT, dq, Cd_n10, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd, L ) 1007 CALL wrk_dealloc( jpi,jpj, T_vpot, T_star, q_star, U_star, zeta_u, zeta_t, U_n10 ) 1008 CALL wrk_dealloc( jpi,jpj, xlogt, xct, zpsi_hu, zpsi_ht, zpsi_m ) 1009 CALL wrk_dealloc( jpi,jpj, stab ) ! interger 1010 ! 1011 IF( nn_timing == 1 ) CALL timing_stop('TURB_CORE_2Z') 1012 ! 1013 END SUBROUTINE TURB_CORE_2Z 1014 1015 1016 FUNCTION psi_m(zta) !! Psis, L & Y eq. (8c), (8d), (8e) 818 819 CALL wrk_dealloc( jpi,jpj, U_zu, Ce_n10, Ch_n10, sqrt_Cd_n10, sqrt_Cd ) 820 CALL wrk_dealloc( jpi,jpj, zeta_u, stab ) 821 CALL wrk_dealloc( jpi,jpj, zpsi_h_u, zpsi_m_u, ztmp0, ztmp1, ztmp2 ) 822 823 IF( .NOT. l_zt_equal_zu ) CALL wrk_dealloc( jpi,jpj, zeta_t ) 824 825 IF( nn_timing == 1 ) CALL timing_stop('turb_core_2z') 826 ! 827 END SUBROUTINE turb_core_2z 828 829 830 FUNCTION cd_neutral_10m( zw10 ) 831 !!---------------------------------------------------------------------- 832 !! Estimate of the neutral drag coefficient at 10m as a function 833 !! of neutral wind speed at 10m 834 !! 835 !! Origin: Large & Yeager 2008 eq.(11a) and eq.(11b) 836 !! 837 !! Author: L. Brodeau, june 2014 838 !!---------------------------------------------------------------------- 839 REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: zw10 ! scalar wind speed at 10m (m/s) 840 REAL(wp), DIMENSION(jpi,jpj) :: cd_neutral_10m 841 ! 842 REAL(wp), DIMENSION(:,:), POINTER :: rgt33 843 !!---------------------------------------------------------------------- 844 ! 845 CALL wrk_alloc( jpi,jpj, rgt33 ) 846 ! 847 !! When wind speed > 33 m/s => Cyclone conditions => special treatment 848 rgt33 = 0.5_wp + SIGN( 0.5_wp, (zw10 - 33._wp) ) ! If zw10 < 33. => 0, else => 1 849 cd_neutral_10m = 1.e-3 * ( & 850 & (rgt33 + 1._wp)*( 2.7_wp/zw10 + 0.142_wp + zw10/13.09_wp - 3.14807E-10*zw10**6) & ! zw10< 33. 851 & + rgt33 * 2.34 ) ! zw10 >= 33. 852 ! 853 CALL wrk_dealloc( jpi,jpj, rgt33) 854 ! 855 END FUNCTION cd_neutral_10m 856 857 858 FUNCTION psi_m(pta) !! Psis, L&Y 2004 eq. (8c), (8d), (8e) 1017 859 !------------------------------------------------------------------------------- 1018 REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: zta 1019 1020 REAL(wp), PARAMETER :: pi = 3.141592653589793_wp 860 ! universal profile stability function for momentum 861 !------------------------------------------------------------------------------- 862 REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pta 863 ! 1021 864 REAL(wp), DIMENSION(jpi,jpj) :: psi_m 1022 865 REAL(wp), DIMENSION(:,:), POINTER :: X2, X, stabit 1023 866 !------------------------------------------------------------------------------- 1024 867 ! 1025 868 CALL wrk_alloc( jpi,jpj, X2, X, stabit ) 1026 1027 X2 = sqrt(abs(1. - 16.*zta)) ; X2 = max(X2 , 1.0) ; X = sqrt(X2)1028 stabit = 0.5 + sign(0.5,zta)1029 psi_m = -5.* zta*stabit & ! Stable1030 & + (1. - stabit)*(2 *log((1. + X)/2) + log((1. + X2)/2) - 2*atan(X) + pi/2) ! Unstable1031 869 ! 870 X2 = SQRT( ABS( 1. - 16.*pta ) ) ; X2 = MAX( X2 , 1. ) ; X = SQRT( X2 ) 871 stabit = 0.5 + SIGN( 0.5 , pta ) 872 psi_m = -5.*pta*stabit & ! Stable 873 & + (1. - stabit)*(2.*LOG((1. + X)*0.5) + LOG((1. + X2)*0.5) - 2.*ATAN(X) + rpi*0.5) ! Unstable 874 ! 1032 875 CALL wrk_dealloc( jpi,jpj, X2, X, stabit ) 1033 876 ! 1034 1035 1036 1037 FUNCTION psi_h( zta ) !! Psis, L & Yeq. (8c), (8d), (8e)877 END FUNCTION psi_m 878 879 880 FUNCTION psi_h( pta ) !! Psis, L&Y 2004 eq. (8c), (8d), (8e) 1038 881 !------------------------------------------------------------------------------- 1039 REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: zta 882 ! universal profile stability function for temperature and humidity 883 !------------------------------------------------------------------------------- 884 REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pta 1040 885 ! 1041 886 REAL(wp), DIMENSION(jpi,jpj) :: psi_h 1042 REAL(wp), DIMENSION(:,:), POINTER :: X2, X, stabit887 REAL(wp), DIMENSION(:,:), POINTER :: X2, X, stabit 1043 888 !------------------------------------------------------------------------------- 1044 889 ! 1045 890 CALL wrk_alloc( jpi,jpj, X2, X, stabit ) 1046 1047 X2 = sqrt(abs(1. - 16.*zta)) ; X2 = max(X2 , 1.) ; X = sqrt(X2)1048 stabit = 0.5 + sign(0.5,zta)1049 psi_h = -5.* zta*stabit& ! Stable1050 & + (1. - stabit)*(2.* log( (1. + X2)/2. ))! Unstable1051 891 ! 892 X2 = SQRT( ABS( 1. - 16.*pta ) ) ; X2 = MAX( X2 , 1. ) ; X = SQRT( X2 ) 893 stabit = 0.5 + SIGN( 0.5 , pta ) 894 psi_h = -5.*pta*stabit & ! Stable 895 & + (1. - stabit)*(2.*LOG( (1. + X2)*0.5 )) ! Unstable 896 ! 1052 897 CALL wrk_dealloc( jpi,jpj, X2, X, stabit ) 1053 898 ! 1054 1055 899 END FUNCTION psi_h 900 1056 901 !!====================================================================== 1057 902 END MODULE sbcblk_core -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_mfs.F90
r4792 r5038 82 82 !! - utau, vtau i- and j-component of the wind stress 83 83 !! - taum wind stress module at T-point 84 !! - wndm 10m wind module at T-point 84 !! - wndm 10m wind module at T-point over free ocean or leads in presence of sea-ice 85 85 !! - qns, qsr non-slor and solar heat flux 86 86 !! - emp evaporation minus precipitation … … 233 233 ! Interpolate utau, vtau into the grid_V and grid_V 234 234 !------------------------------------------------- 235 235 ! Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines 236 ! Note the use of MAX(tmask(i,j),tmask(i+1,j) is to mask tau over ice shelves 236 237 DO jj = 1, jpjm1 237 238 DO ji = 1, fs_jpim1 238 239 utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( utau(ji,jj) * tmask(ji,jj,1) & 239 & + utau(ji+1,jj) * tmask(ji+1,jj,1) ) 240 & + utau(ji+1,jj) * tmask(ji+1,jj,1) ) & 241 & * MAX(tmask(ji,jj,1),tmask(ji+1,jj ,1)) 240 242 vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( vtau(ji,jj) * tmask(ji,jj,1) & 241 & + vtau(ji,jj+1) * tmask(ji,jj+1,1) ) 243 & + vtau(ji,jj+1) * tmask(ji,jj+1,1) ) & 244 & * MAX(tmask(ji,jj,1),tmask(ji ,jj+1,1)) 242 245 END DO 243 246 END DO -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
r4792 r5038 9 9 !! 3.4 ! 2011_11 (C. Harris) more flexibility + multi-category fields 10 10 !!---------------------------------------------------------------------- 11 #if defined key_oasis3 || defined key_oasis412 !!----------------------------------------------------------------------13 !! 'key_oasis3' or 'key_oasis4' Coupled Ocean/Atmosphere formulation14 11 !!---------------------------------------------------------------------- 15 12 !! namsbc_cpl : coupled formulation namlist … … 34 31 USE ice_2 ! ice variables 35 32 #endif 36 #if defined key_oasis337 33 USE cpl_oasis3 ! OASIS3 coupling 38 #endif39 #if defined key_oasis440 USE cpl_oasis4 ! OASIS4 coupling41 #endif42 34 USE geo2ocean ! 43 35 USE oce , ONLY : tsn, un, vn … … 52 44 USE p4zflx, ONLY : oce_co2 53 45 #endif 54 USE diaar5, ONLY : lk_diaar555 46 #if defined key_cice 56 47 USE ice_domain_size, only: ncat … … 58 49 IMPLICIT NONE 59 50 PRIVATE 60 51 !EM XIOS-OASIS-MCT compliance 52 PUBLIC sbc_cpl_init ! routine called by sbcmod.F90 61 53 PUBLIC sbc_cpl_rcv ! routine called by sbc_ice_lim(_2).F90 62 54 PUBLIC sbc_cpl_snd ! routine called by step.F90 63 55 PUBLIC sbc_cpl_ice_tau ! routine called by sbc_ice_lim(_2).F90 64 56 PUBLIC sbc_cpl_ice_flx ! routine called by sbc_ice_lim(_2).F90 57 PUBLIC sbc_cpl_alloc ! routine called in sbcice_cice.F90 65 58 66 59 INTEGER, PARAMETER :: jpr_otx1 = 1 ! 3 atmosphere-ocean stress components on grid 1 … … 129 122 TYPE(FLD_C) :: sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau, sn_rcv_dqnsdt, sn_rcv_qsr, sn_rcv_qns, sn_rcv_emp, sn_rcv_rnf 130 123 TYPE(FLD_C) :: sn_rcv_cal, sn_rcv_iceflx, sn_rcv_co2 124 ! Other namelist parameters ! 125 INTEGER :: nn_cplmodel ! Maximum number of models to/from which NEMO is potentialy sending/receiving data 126 LOGICAL :: ln_usecplmask ! use a coupling mask file to merge data received from several models 127 ! -> file cplmask.nc with the float variable called cplmask (jpi,jpj,nn_cplmodel) 128 129 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: xcplmask 131 130 132 131 TYPE :: DYNARR … … 139 138 140 139 INTEGER , ALLOCATABLE, SAVE, DIMENSION( :) :: nrcvinfo ! OASIS info argument 141 142 #if ! defined key_lim2 && ! defined key_lim3143 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: u_ice, v_ice,fr1_i0,fr2_i0 ! jpi, jpj144 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tn_ice, alb_ice, qns_ice, dqns_ice ! (jpi,jpj,jpl)145 #endif146 147 #if defined key_cice148 INTEGER, PARAMETER :: jpl = ncat149 #elif ! defined key_lim2 && ! defined key_lim3150 INTEGER, PARAMETER :: jpl = 1151 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_ice152 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qsr_ice153 #endif154 155 #if ! defined key_lim3 && ! defined key_cice156 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: a_i157 #endif158 159 #if ! defined key_lim3160 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ht_i, ht_s161 #endif162 163 #if ! defined key_cice164 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: topmelt, botmelt165 #endif166 140 167 141 !! Substitution … … 179 153 !! *** FUNCTION sbc_cpl_alloc *** 180 154 !!---------------------------------------------------------------------- 181 INTEGER :: ierr( 4),jn155 INTEGER :: ierr(3) 182 156 !!---------------------------------------------------------------------- 183 157 ierr(:) = 0 184 158 ! 185 159 ALLOCATE( albedo_oce_mix(jpi,jpj), nrcvinfo(jprcv), STAT=ierr(1) ) 186 ! 187 #if ! defined key_lim2 && ! defined key_lim3 188 ! quick patch to be able to run the coupled model without sea-ice... 189 ALLOCATE( u_ice(jpi,jpj) , fr1_i0(jpi,jpj) , tn_ice (jpi,jpj,1) , & 190 v_ice(jpi,jpj) , fr2_i0(jpi,jpj) , alb_ice(jpi,jpj,1), & 191 emp_ice(jpi,jpj) , qns_ice(jpi,jpj,1) , dqns_ice(jpi,jpj,1) , STAT=ierr(2) ) 160 161 #if ! defined key_lim3 && ! defined key_lim2 && ! defined key_cice 162 ALLOCATE( a_i(jpi,jpj,1) , STAT=ierr(2) ) ! used in sbcice_if.F90 (done here as there is no sbc_ice_if_init) 192 163 #endif 193 194 #if ! defined key_lim3 && ! defined key_cice 195 ALLOCATE( a_i(jpi,jpj,jpl) , STAT=ierr(3) ) 196 #endif 197 198 #if defined key_cice || defined key_lim2 199 ALLOCATE( ht_i(jpi,jpj,jpl) , ht_s(jpi,jpj,jpl) , STAT=ierr(4) ) 200 #endif 164 ALLOCATE( xcplmask(jpi,jpj,nn_cplmodel) , STAT=ierr(3) ) 165 ! 201 166 sbc_cpl_alloc = MAXVAL( ierr ) 202 167 IF( lk_mpp ) CALL mpp_sum ( sbc_cpl_alloc ) … … 210 175 !! *** ROUTINE sbc_cpl_init *** 211 176 !! 212 !! ** Purpose : Initialisation of send and rec ieved information from177 !! ** Purpose : Initialisation of send and received information from 213 178 !! the atmospheric component 214 179 !! … … 222 187 INTEGER :: jn ! dummy loop index 223 188 INTEGER :: ios ! Local integer output status for namelist read 189 INTEGER :: inum 224 190 REAL(wp), POINTER, DIMENSION(:,:) :: zacs, zaos 225 191 !! 226 NAMELIST/namsbc_cpl/ sn_snd_temp, sn_snd_alb , sn_snd_thick, sn_snd_crt , sn_snd_co2, & 227 & sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau , sn_rcv_dqnsdt, sn_rcv_qsr, & 228 & sn_rcv_qns , sn_rcv_emp , sn_rcv_rnf , sn_rcv_cal , sn_rcv_iceflx , sn_rcv_co2 192 NAMELIST/namsbc_cpl/ sn_snd_temp, sn_snd_alb , sn_snd_thick, sn_snd_crt , sn_snd_co2, & 193 & sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau , sn_rcv_dqnsdt, sn_rcv_qsr, & 194 & sn_rcv_qns , sn_rcv_emp , sn_rcv_rnf , sn_rcv_cal , sn_rcv_iceflx, & 195 & sn_rcv_co2 , nn_cplmodel , ln_usecplmask 229 196 !!--------------------------------------------------------------------- 230 197 ! … … 274 241 WRITE(numout,*)' - mesh = ', sn_snd_crt%clvgrd 275 242 WRITE(numout,*)' oce co2 flux = ', TRIM(sn_snd_co2%cldes ), ' (', TRIM(sn_snd_co2%clcat ), ')' 243 WRITE(numout,*)' nn_cplmodel = ', nn_cplmodel 244 WRITE(numout,*)' ln_usecplmask = ', ln_usecplmask 276 245 ENDIF 277 246 … … 485 454 END DO 486 455 ! Allocate taum part of frcv which is used even when not received as coupling field 487 IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(j n)%nct) )456 IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jpr_taum)%nct) ) 488 457 ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE. 489 458 IF( k_ice /= 0 ) THEN 490 IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(j n)%nct) )491 IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(j n)%nct) )459 IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jpr_itx1)%nct) ) 460 IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jpr_ity1)%nct) ) 492 461 END IF 493 462 … … 604 573 ! ================================ ! 605 574 606 CALL cpl_prism_define(jprcv, jpsnd) 607 ! 608 IF( ln_dm2dc .AND. ( cpl_prism_freq( jpr_qsroce ) + cpl_prism_freq( jpr_qsrmix ) /= 86400 ) ) & 575 CALL cpl_define(jprcv, jpsnd,nn_cplmodel) 576 IF (ln_usecplmask) THEN 577 xcplmask(:,:,:) = 0. 578 CALL iom_open( 'cplmask', inum ) 579 CALL iom_get( inum, jpdom_unknown, 'cplmask', xcplmask(1:nlci,1:nlcj,1:nn_cplmodel), & 580 & kstart = (/ mig(1),mjg(1),1 /), kcount = (/ nlci,nlcj,nn_cplmodel /) ) 581 CALL iom_close( inum ) 582 ELSE 583 xcplmask(:,:,:) = 1. 584 ENDIF 585 ! 586 IF( ln_dm2dc .AND. ( cpl_freq( jpr_qsroce ) + cpl_freq( jpr_qsrmix ) /= 86400 ) ) & 609 587 & CALL ctl_stop( 'sbc_cpl_init: diurnal cycle reconstruction (ln_dm2dc) needs daily couping for solar radiation' ) 610 588 … … 654 632 !! 655 633 !! ** Action : update utau, vtau ocean stress at U,V grid 656 !! taum, wndm wind stres and wind speed module at T-point 634 !! taum wind stress module at T-point 635 !! wndm wind speed module at T-point over free ocean or leads in presence of sea-ice 657 636 !! qns non solar heat fluxes including emp heat content (ocean only case) 658 637 !! and the latent heat flux of solid precip. melting … … 678 657 ! 679 658 CALL wrk_alloc( jpi,jpj, ztx, zty ) 680 681 IF( kt == nit000 ) CALL sbc_cpl_init( k_ice ) ! initialisation682 683 659 ! ! Receive all the atmos. fields (including ice information) 684 660 isec = ( kt - nit000 ) * NINT( rdttra(1) ) ! date of exchanges 685 661 DO jn = 1, jprcv ! received fields sent by the atmosphere 686 IF( srcv(jn)%laction ) CALL cpl_ prism_rcv( jn, isec, frcv(jn)%z3, nrcvinfo(jn) )662 IF( srcv(jn)%laction ) CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask, nrcvinfo(jn) ) 687 663 END DO 688 664 … … 848 824 IF( srcv(jpr_qnsoce)%laction ) qns(:,:) = frcv(jpr_qnsoce)%z3(:,:,1) 849 825 IF( srcv(jpr_qnsmix)%laction ) qns(:,:) = frcv(jpr_qnsmix)%z3(:,:,1) 850 ! add the latent heat of solid precip. melting851 IF( srcv(jpr_snow )%laction ) THEN ! update qns over the free ocean with:852 qns(:,:) = qns(:,:) - frcv(jpr_snow)%z3(:,:,1) * lfus & ! energy for melting solid precipitation over the free ocean853 & - emp(:,:) * sst_m(:,:) * rcp ! remove heat content due to mass flux (assumed to be at SST)826 ! update qns over the free ocean with: 827 qns(:,:) = qns(:,:) - emp(:,:) * sst_m(:,:) * rcp ! remove heat content due to mass flux (assumed to be at SST) 828 IF( srcv(jpr_snow )%laction ) THEN 829 qns(:,:) = qns(:,:) - frcv(jpr_snow)%z3(:,:,1) * lfus ! energy for melting solid precipitation over the free ocean 854 830 ENDIF 855 831 … … 914 890 CALL wrk_alloc( jpi,jpj, ztx, zty ) 915 891 916 !AC Pour eviter un stress nul sur la glace dans le cas mixed oce-ice 917 IF( srcv(jpr_itx1)%laction .AND. TRIM( sn_rcv_tau%cldes ) == 'oce and ice') THEN ; itx = jpr_itx1 892 IF( srcv(jpr_itx1)%laction ) THEN ; itx = jpr_itx1 918 893 ELSE ; itx = jpr_otx1 919 894 ENDIF … … 922 897 IF( nrcvinfo(itx) == OASIS_Rcv ) THEN 923 898 924 ! ! ======================= ! 925 !AC Pour eviter un stress nul sur la glace dans le cas mixes oce-ice 926 IF( srcv(jpr_itx1)%laction .AND. TRIM( sn_rcv_tau%cldes ) == 'oce and ice') THEN ! ice stress received ! 927 ! ! ======================= ! 899 ! ! ======================= ! 900 IF( srcv(jpr_itx1)%laction ) THEN ! ice stress received ! 901 ! ! ======================= ! 928 902 ! 929 903 IF( TRIM( sn_rcv_tau%clvref ) == 'cartesian' ) THEN ! 2 components on the sphere … … 1125 1099 REAL(wp), INTENT(in ), DIMENSION(:,:) :: p_frld ! lead fraction [0 to 1] 1126 1100 ! optional arguments, used only in 'mixed oce-ice' case 1127 REAL(wp), INTENT(in ), DIMENSION(:,:,:), OPTIONAL :: palbi ! ice albedo1128 REAL(wp), INTENT(in ), DIMENSION(:,: ), OPTIONAL :: psst ! sea surface temperature [Cel cius]1101 REAL(wp), INTENT(in ), DIMENSION(:,:,:), OPTIONAL :: palbi ! all skies ice albedo 1102 REAL(wp), INTENT(in ), DIMENSION(:,: ), OPTIONAL :: psst ! sea surface temperature [Celsius] 1129 1103 REAL(wp), INTENT(in ), DIMENSION(:,:,:), OPTIONAL :: pist ! ice surface temperature [Kelvin] 1130 1104 ! … … 1153 1127 emp_tot(:,:) = frcv(jpr_tevp)%z3(:,:,1) - tprecip(:,:) 1154 1128 emp_ice(:,:) = frcv(jpr_ievp)%z3(:,:,1) - frcv(jpr_snow)%z3(:,:,1) 1155 CALL iom_put( 'rain' , frcv(jpr_rain)%z3(:,:,1) ) ! liquid precipitation 1156 IF( lk_diaar5 ) CALL iom_put( 'hflx_rain_cea', frcv(jpr_rain)%z3(:,:,1) * zcptn(:,:) ) ! heat flux from liq. precip. 1157 ztmp(:,:) = frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) 1158 CALL iom_put( 'evap_ao_cea' , ztmp ) ! ice-free oce evap (cell average) 1159 IF( lk_diaar5 ) CALL iom_put( 'hflx_evap_cea', ztmp(:,: ) * zcptn(:,:) ) ! heat flux from from evap (cell ave) 1129 CALL iom_put( 'rain' , frcv(jpr_rain)%z3(:,:,1) ) ! liquid precipitation 1130 IF( iom_use('hflx_rain_cea') ) & 1131 CALL iom_put( 'hflx_rain_cea', frcv(jpr_rain)%z3(:,:,1) * zcptn(:,:) ) ! heat flux from liq. precip. 1132 IF( iom_use('evap_ao_cea') .OR. iom_use('hflx_evap_cea') ) & 1133 ztmp(:,:) = frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) 1134 IF( iom_use('evap_ao_cea' ) ) & 1135 CALL iom_put( 'evap_ao_cea' , ztmp ) ! ice-free oce evap (cell average) 1136 IF( iom_use('hflx_evap_cea') ) & 1137 CALL iom_put( 'hflx_evap_cea', ztmp(:,:) * zcptn(:,:) ) ! heat flux from from evap (cell average) 1160 1138 CASE( 'oce and ice' ) ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp 1161 1139 emp_tot(:,:) = p_frld(:,:) * frcv(jpr_oemp)%z3(:,:,1) + zicefr(:,:) * frcv(jpr_sbpr)%z3(:,:,1) … … 1164 1142 END SELECT 1165 1143 1166 CALL iom_put( 'snowpre' , sprecip ) ! Snow 1167 CALL iom_put( 'snow_ao_cea', sprecip(:,: ) * p_frld(:,:) ) ! Snow over ice-free ocean (cell average) 1168 CALL iom_put( 'snow_ai_cea', sprecip(:,: ) * zicefr(:,:) ) ! Snow over sea-ice (cell average) 1169 CALL iom_put( 'subl_ai_cea', frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) ) ! Sublimation over sea-ice (cell average) 1144 CALL iom_put( 'snowpre' , sprecip ) ! Snow 1145 IF( iom_use('snow_ao_cea') ) & 1146 CALL iom_put( 'snow_ao_cea', sprecip(:,:) * p_frld(:,:) ) ! Snow over ice-free ocean (cell average) 1147 IF( iom_use('snow_ai_cea') ) & 1148 CALL iom_put( 'snow_ai_cea', sprecip(:,:) * zicefr(:,:) ) ! Snow over sea-ice (cell average) 1149 IF( iom_use('subl_ai_cea') ) & 1150 CALL iom_put( 'subl_ai_cea', frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) ) ! Sublimation over sea-ice (cell average) 1170 1151 ! 1171 1152 ! ! runoffs and calving (put in emp_tot) 1172 1153 IF( srcv(jpr_rnf)%laction ) THEN 1173 1154 emp_tot(:,:) = emp_tot(:,:) - frcv(jpr_rnf)%z3(:,:,1) 1174 CALL iom_put( 'runoffs' , frcv(jpr_rnf)%z3(:,:,1) ) ! rivers 1175 IF( lk_diaar5 ) CALL iom_put( 'hflx_rnf_cea' , frcv(jpr_rnf)%z3(:,:,1) * zcptn(:,:) ) ! heat flux from rivers 1155 CALL iom_put( 'runoffs' , frcv(jpr_rnf)%z3(:,:,1) ) ! rivers 1156 IF( iom_use('hflx_rnf_cea') ) & 1157 CALL iom_put( 'hflx_rnf_cea' , frcv(jpr_rnf)%z3(:,:,1) * zcptn(:,:) ) ! heat flux from rivers 1176 1158 ENDIF 1177 1159 IF( srcv(jpr_cal)%laction ) THEN … … 1235 1217 & - ( emp_tot(:,:) & ! remove the heat content of mass flux (assumed to be at SST) 1236 1218 & - emp_ice(:,:) * zicefr(:,:) ) * zcptn(:,:) 1237 IF( lk_diaar5 ) CALL iom_put( 'hflx_snow_cea', ztmp + sprecip(:,:) * zcptn(:,:) ) ! heat flux from snow (cell average) 1219 IF( iom_use('hflx_snow_cea') ) & 1220 CALL iom_put( 'hflx_snow_cea', ztmp + sprecip(:,:) * zcptn(:,:) ) ! heat flux from snow (cell average) 1238 1221 !!gm 1239 1222 !! currently it is taken into account in leads budget but not in the qns_tot, and thus not in … … 1247 1230 ztmp(:,:) = frcv(jpr_cal)%z3(:,:,1) * lfus ! add the latent heat of iceberg melting 1248 1231 qns_tot(:,:) = qns_tot(:,:) - ztmp(:,:) 1249 IF( lk_diaar5 ) CALL iom_put( 'hflx_cal_cea', ztmp + frcv(jpr_cal)%z3(:,:,1) * zcptn(:,:) ) ! heat flux from calving 1232 IF( iom_use('hflx_cal_cea') ) & 1233 CALL iom_put( 'hflx_cal_cea', ztmp + frcv(jpr_cal)%z3(:,:,1) * zcptn(:,:) ) ! heat flux from calving 1250 1234 ENDIF 1251 1235 … … 1296 1280 ENDIF 1297 1281 1298 SELECT CASE( TRIM( sn_rcv_dqnsdt%cldes ) ) 1282 ! ! ========================= ! 1283 SELECT CASE( TRIM( sn_rcv_dqnsdt%cldes ) ) ! d(qns)/dt ! 1284 ! ! ========================= ! 1299 1285 CASE ('coupled') 1300 1286 IF ( TRIM(sn_rcv_dqnsdt%clcat) == 'yes' ) THEN … … 1308 1294 END SELECT 1309 1295 1310 SELECT CASE( TRIM( sn_rcv_iceflx%cldes ) ) 1296 ! ! ========================= ! 1297 SELECT CASE( TRIM( sn_rcv_iceflx%cldes ) ) ! topmelt and botmelt ! 1298 ! ! ========================= ! 1311 1299 CASE ('coupled') 1312 1300 topmelt(:,:,:)=frcv(jpr_topm)%z3(:,:,:) … … 1314 1302 END SELECT 1315 1303 1316 ! Ice Qsr penetration used (only?)in lim2 or lim3 1317 ! fraction of net shortwave radiation which is not absorbed in the thin surface layer 1318 ! and penetrates inside the ice cover ( Maykut and Untersteiner, 1971 ; Elbert anbd Curry, 1993 ) 1304 ! Surface transimission parameter io (Maykut Untersteiner , 1971 ; Ebert and Curry, 1993 ) 1305 ! Used for LIM2 and LIM3 1319 1306 ! Coupled case: since cloud cover is not received from atmosphere 1320 ! ===> defined as constant value -> definition done in sbc_cpl_init 1321 fr1_i0(:,:) = 0.18 1322 fr2_i0(:,:) = 0.82 1323 1307 ! ===> used prescribed cloud fraction representative for polar oceans in summer (0.81) 1308 fr1_i0(:,:) = ( 0.18 * ( 1.0 - cldf_ice ) + 0.35 * cldf_ice ) 1309 fr2_i0(:,:) = ( 0.82 * ( 1.0 - cldf_ice ) + 0.65 * cldf_ice ) 1324 1310 1325 1311 CALL wrk_dealloc( jpi,jpj, zcptn, ztmp, zicefr ) … … 1336 1322 !! ** Purpose : provide the ocean-ice informations to the atmosphere 1337 1323 !! 1338 !! ** Method : send to the atmosphere through a call to cpl_ prism_snd1324 !! ** Method : send to the atmosphere through a call to cpl_snd 1339 1325 !! all the needed fields (as defined in sbc_cpl_init) 1340 1326 !!---------------------------------------------------------------------- … … 1355 1341 1356 1342 zfr_l(:,:) = 1.- fr_i(:,:) 1357 1358 1343 ! ! ------------------------- ! 1359 1344 ! ! Surface temperature ! in Kelvin … … 1380 1365 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%cldes' ) 1381 1366 END SELECT 1382 IF( ssnd(jps_toce)%laction ) CALL cpl_prism_snd( jps_toce, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 1383 IF( ssnd(jps_tice)%laction ) CALL cpl_prism_snd( jps_tice, isec, ztmp3, info ) 1384 IF( ssnd(jps_tmix)%laction ) CALL cpl_prism_snd( jps_tmix, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 1385 ENDIF 1386 ! 1367 IF( ssnd(jps_toce)%laction ) CALL cpl_snd( jps_toce, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 1368 IF( ssnd(jps_tice)%laction ) CALL cpl_snd( jps_tice, isec, ztmp3, info ) 1369 IF( ssnd(jps_tmix)%laction ) CALL cpl_snd( jps_tmix, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 1370 ENDIF 1387 1371 ! ! ------------------------- ! 1388 1372 ! ! Albedo ! … … 1390 1374 IF( ssnd(jps_albice)%laction ) THEN ! ice 1391 1375 ztmp3(:,:,1:jpl) = alb_ice(:,:,1:jpl) * a_i(:,:,1:jpl) 1392 CALL cpl_ prism_snd( jps_albice, isec, ztmp3, info )1376 CALL cpl_snd( jps_albice, isec, ztmp3, info ) 1393 1377 ENDIF 1394 1378 IF( ssnd(jps_albmix)%laction ) THEN ! mixed ice-ocean … … 1397 1381 ztmp1(:,:) = ztmp1(:,:) + alb_ice(:,:,jl) * a_i(:,:,jl) 1398 1382 ENDDO 1399 CALL cpl_ prism_snd( jps_albmix, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info )1383 CALL cpl_snd( jps_albmix, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 1400 1384 ENDIF 1401 1385 ! ! ------------------------- ! … … 1409 1393 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%clcat' ) 1410 1394 END SELECT 1411 CALL cpl_ prism_snd( jps_fice, isec, ztmp3, info )1395 CALL cpl_snd( jps_fice, isec, ztmp3, info ) 1412 1396 ENDIF 1413 1397 … … 1434 1418 CASE default ; CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_thick%cldes' ) 1435 1419 END SELECT 1436 IF( ssnd(jps_hice)%laction ) CALL cpl_ prism_snd( jps_hice, isec, ztmp3, info )1437 IF( ssnd(jps_hsnw)%laction ) CALL cpl_ prism_snd( jps_hsnw, isec, ztmp4, info )1420 IF( ssnd(jps_hice)%laction ) CALL cpl_snd( jps_hice, isec, ztmp3, info ) 1421 IF( ssnd(jps_hsnw)%laction ) CALL cpl_snd( jps_hsnw, isec, ztmp4, info ) 1438 1422 ENDIF 1439 1423 ! … … 1442 1426 ! ! CO2 flux from PISCES ! 1443 1427 ! ! ------------------------- ! 1444 IF( ssnd(jps_co2)%laction ) CALL cpl_ prism_snd( jps_co2, isec, RESHAPE ( oce_co2, (/jpi,jpj,1/) ) , info )1428 IF( ssnd(jps_co2)%laction ) CALL cpl_snd( jps_co2, isec, RESHAPE ( oce_co2, (/jpi,jpj,1/) ) , info ) 1445 1429 ! 1446 1430 #endif … … 1565 1549 ENDIF 1566 1550 ! 1567 IF( ssnd(jps_ocx1)%laction ) CALL cpl_ prism_snd( jps_ocx1, isec, RESHAPE ( zotx1, (/jpi,jpj,1/) ), info ) ! ocean x current 1st grid1568 IF( ssnd(jps_ocy1)%laction ) CALL cpl_ prism_snd( jps_ocy1, isec, RESHAPE ( zoty1, (/jpi,jpj,1/) ), info ) ! ocean y current 1st grid1569 IF( ssnd(jps_ocz1)%laction ) CALL cpl_ prism_snd( jps_ocz1, isec, RESHAPE ( zotz1, (/jpi,jpj,1/) ), info ) ! ocean z current 1st grid1551 IF( ssnd(jps_ocx1)%laction ) CALL cpl_snd( jps_ocx1, isec, RESHAPE ( zotx1, (/jpi,jpj,1/) ), info ) ! ocean x current 1st grid 1552 IF( ssnd(jps_ocy1)%laction ) CALL cpl_snd( jps_ocy1, isec, RESHAPE ( zoty1, (/jpi,jpj,1/) ), info ) ! ocean y current 1st grid 1553 IF( ssnd(jps_ocz1)%laction ) CALL cpl_snd( jps_ocz1, isec, RESHAPE ( zotz1, (/jpi,jpj,1/) ), info ) ! ocean z current 1st grid 1570 1554 ! 1571 IF( ssnd(jps_ivx1)%laction ) CALL cpl_ prism_snd( jps_ivx1, isec, RESHAPE ( zitx1, (/jpi,jpj,1/) ), info ) ! ice x current 1st grid1572 IF( ssnd(jps_ivy1)%laction ) CALL cpl_ prism_snd( jps_ivy1, isec, RESHAPE ( zity1, (/jpi,jpj,1/) ), info ) ! ice y current 1st grid1573 IF( ssnd(jps_ivz1)%laction ) CALL cpl_ prism_snd( jps_ivz1, isec, RESHAPE ( zitz1, (/jpi,jpj,1/) ), info ) ! ice z current 1st grid1555 IF( ssnd(jps_ivx1)%laction ) CALL cpl_snd( jps_ivx1, isec, RESHAPE ( zitx1, (/jpi,jpj,1/) ), info ) ! ice x current 1st grid 1556 IF( ssnd(jps_ivy1)%laction ) CALL cpl_snd( jps_ivy1, isec, RESHAPE ( zity1, (/jpi,jpj,1/) ), info ) ! ice y current 1st grid 1557 IF( ssnd(jps_ivz1)%laction ) CALL cpl_snd( jps_ivz1, isec, RESHAPE ( zitz1, (/jpi,jpj,1/) ), info ) ! ice z current 1st grid 1574 1558 ! 1575 1559 ENDIF … … 1582 1566 END SUBROUTINE sbc_cpl_snd 1583 1567 1584 #else1585 !!----------------------------------------------------------------------1586 !! Dummy module NO coupling1587 !!----------------------------------------------------------------------1588 USE par_kind ! kind definition1589 CONTAINS1590 SUBROUTINE sbc_cpl_snd( kt )1591 WRITE(*,*) 'sbc_cpl_snd: You should not have seen this print! error?', kt1592 END SUBROUTINE sbc_cpl_snd1593 !1594 SUBROUTINE sbc_cpl_rcv( kt, k_fsbc, k_ice )1595 WRITE(*,*) 'sbc_cpl_snd: You should not have seen this print! error?', kt, k_fsbc, k_ice1596 END SUBROUTINE sbc_cpl_rcv1597 !1598 SUBROUTINE sbc_cpl_ice_tau( p_taui, p_tauj )1599 REAL(wp), INTENT(out), DIMENSION(:,:) :: p_taui ! i- & j-components of atmos-ice stress [N/m2]1600 REAL(wp), INTENT(out), DIMENSION(:,:) :: p_tauj ! at I-point (B-grid) or U & V-point (C-grid)1601 p_taui(:,:) = 0. ; p_tauj(:,:) = 0. ! stupid definition to avoid warning message when compiling...1602 WRITE(*,*) 'sbc_cpl_snd: You should not have seen this print! error?'1603 END SUBROUTINE sbc_cpl_ice_tau1604 !1605 SUBROUTINE sbc_cpl_ice_flx( p_frld , palbi , psst , pist )1606 REAL(wp), INTENT(in ), DIMENSION(:,: ) :: p_frld ! lead fraction [0 to 1]1607 REAL(wp), INTENT(in ), DIMENSION(:,:,:), OPTIONAL :: palbi ! ice albedo1608 REAL(wp), INTENT(in ), DIMENSION(:,: ), OPTIONAL :: psst ! sea surface temperature [Celcius]1609 REAL(wp), INTENT(in ), DIMENSION(:,:,:), OPTIONAL :: pist ! ice surface temperature [Kelvin]1610 WRITE(*,*) 'sbc_cpl_snd: You should not have seen this print! error?', p_frld(1,1), palbi(1,1,1), psst(1,1), pist(1,1,1)1611 END SUBROUTINE sbc_cpl_ice_flx1612 1613 #endif1614 1615 1568 !!====================================================================== 1616 1569 END MODULE sbccpl -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90
r4792 r5038 156 156 END DO 157 157 END DO 158 taum(:,:) = taum(:,:) * tmask(:,:,1) ; wndm(:,:) = wndm(:,:) * tmask(:,:,1) 158 159 CALL lbc_lnk( taum(:,:), 'T', 1. ) ; CALL lbc_lnk( wndm(:,:), 'T', 1. ) 159 160 -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90
r4792 r5038 19 19 USE phycst ! physical constants 20 20 USE sbcrnf ! ocean runoffs 21 USE sbcisf ! ice shelf melting contribution 21 22 USE sbcssr ! SS damping terms 22 23 USE in_out_manager ! I/O manager … … 90 91 area = glob_sum( e1e2t(:,:) ) ! interior global domain surface 91 92 ! 92 #if ! defined key_lim2 && ! defined key_lim3 && ! defined key_cice 93 #if ! defined key_lim2 && ! defined key_lim3 && ! defined key_cice 93 94 snwice_mass_b(:,:) = 0.e0 ! no sea-ice model is being used : no snow+ice mass 94 95 snwice_mass (:,:) = 0.e0 … … 103 104 ! 104 105 IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 105 z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) - snwice_fmass(:,:) ) ) / area ! sum over the global domain106 z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) + rdivisf * fwfisf(:,:) - snwice_fmass(:,:) ) ) / area ! sum over the global domain 106 107 zcoef = z_fwf * rcp 107 108 emp(:,:) = emp(:,:) - z_fwf -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
r4792 r5038 17 17 USE phycst, only : rcp, rau0, r1_rau0, rhosn, rhoic 18 18 USE in_out_manager ! I/O manager 19 USE iom, ONLY : iom_put,iom_use ! I/O manager library !!Joakim edit 19 20 USE lib_mpp ! distributed memory computing library 20 21 USE lbclnk ! ocean lateral boundary conditions (or mpp link) … … 23 24 USE daymod ! calendar 24 25 USE fldread ! read input fields 25 26 26 USE sbc_oce ! Surface boundary condition: ocean fields 27 27 USE sbc_ice ! Surface boundary condition: ice fields … … 38 38 USE ice_calendar, only: dt 39 39 USE ice_state, only: aice,aicen,uvel,vvel,vsno,vsnon,vice,vicen 40 # if defined key_cice4 40 41 USE ice_flux, only: strax,stray,strocnx,strocny,frain,fsnow, & 41 42 sst,sss,uocn,vocn,ss_tltx,ss_tlty,fsalt_gbm, & … … 44 45 uatm,vatm,wind,fsw,flw,Tair,potT,Qa,rhoa,zlvl, & 45 46 swvdr,swvdf,swidr,swidf 47 USE ice_therm_vertical, only: calc_Tsfc 48 #else 49 USE ice_flux, only: strax,stray,strocnx,strocny,frain,fsnow, & 50 sst,sss,uocn,vocn,ss_tltx,ss_tlty,fsalt_ai, & 51 fresh_ai,fhocn_ai,fswthru_ai,frzmlt, & 52 flatn_f,fsurfn_f,fcondtopn_f, & 53 uatm,vatm,wind,fsw,flw,Tair,potT,Qa,rhoa,zlvl, & 54 swvdr,swvdf,swidr,swidf 55 USE ice_therm_shared, only: calc_Tsfc 56 #endif 46 57 USE ice_forcing, only: frcvdr,frcvdf,frcidr,frcidf 47 58 USE ice_atmo, only: calc_strair 48 USE ice_therm_vertical, only: calc_Tsfc49 59 50 60 USE CICE_InitMod … … 95 105 END FUNCTION sbc_ice_cice_alloc 96 106 97 SUBROUTINE sbc_ice_cice( kt, nsbc )107 SUBROUTINE sbc_ice_cice( kt, ksbc ) 98 108 !!--------------------------------------------------------------------- 99 109 !! *** ROUTINE sbc_ice_cice *** … … 113 123 !!--------------------------------------------------------------------- 114 124 INTEGER, INTENT(in) :: kt ! ocean time step 115 INTEGER, INTENT(in) :: nsbc ! surface forcing type125 INTEGER, INTENT(in) :: ksbc ! surface forcing type 116 126 !!---------------------------------------------------------------------- 117 127 ! … … 123 133 124 134 ! Make sure any fluxes required for CICE are set 125 IF ( nsbc == 2 )THEN135 IF ( ksbc == jp_flx ) THEN 126 136 CALL cice_sbc_force(kt) 127 ELSE IF ( nsbc == 5) THEN137 ELSE IF ( ksbc == jp_cpl ) THEN 128 138 CALL sbc_cpl_ice_flx( 1.0-fr_i ) 129 139 ENDIF 130 140 131 CALL cice_sbc_in ( kt, nsbc )141 CALL cice_sbc_in ( kt, ksbc ) 132 142 CALL CICE_Run 133 CALL cice_sbc_out ( kt, nsbc )134 135 IF ( nsbc == 5) CALL cice_sbc_hadgam(kt+1)143 CALL cice_sbc_out ( kt, ksbc ) 144 145 IF ( ksbc == jp_cpl ) CALL cice_sbc_hadgam(kt+1) 136 146 137 147 ENDIF ! End sea-ice time step only … … 141 151 END SUBROUTINE sbc_ice_cice 142 152 143 SUBROUTINE cice_sbc_init ( nsbc)153 SUBROUTINE cice_sbc_init (ksbc) 144 154 !!--------------------------------------------------------------------- 145 155 !! *** ROUTINE cice_sbc_init *** 146 156 !! ** Purpose: Initialise ice related fields for NEMO and coupling 147 157 !! 148 INTEGER, INTENT( in ) :: nsbc ! surface forcing type158 INTEGER, INTENT( in ) :: ksbc ! surface forcing type 149 159 REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2 150 160 REAL(wp) :: zcoefu, zcoefv, zcoeff ! local scalar 151 INTEGER :: ji, jj, jl 161 INTEGER :: ji, jj, jl, jk ! dummy loop indices 152 162 !!--------------------------------------------------------------------- 153 163 … … 161 171 jj_off = INT ( (jpjglo - ny_global) / 2 ) 162 172 173 #if defined key_nemocice_decomp 174 ! Pass initial SST from NEMO to CICE so ice is initialised correctly if 175 ! there is no restart file. 176 ! Values from a CICE restart file would overwrite this 177 IF ( .NOT. ln_rstart ) THEN 178 CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1.) 179 ENDIF 180 #endif 181 163 182 ! Initialize CICE 164 183 CALL CICE_Initialize 165 184 166 185 ! Do some CICE consistency checks 167 IF ( ( nsbc == 2) .OR. (nsbc == 5) ) THEN186 IF ( (ksbc == jp_flx) .OR. (ksbc == jp_cpl) ) THEN 168 187 IF ( calc_strair .OR. calc_Tsfc ) THEN 169 188 CALL ctl_stop( 'STOP', 'cice_sbc_init : Forcing option requires calc_strair=F and calc_Tsfc=F in ice_in' ) 170 189 ENDIF 171 ELSEIF ( nsbc == 4) THEN190 ELSEIF (ksbc == jp_core) THEN 172 191 IF ( .NOT. (calc_strair .AND. calc_Tsfc) ) THEN 173 192 CALL ctl_stop( 'STOP', 'cice_sbc_init : Forcing option requires calc_strair=T and calc_Tsfc=T in ice_in' ) … … 190 209 191 210 CALL cice2nemo(aice,fr_i, 'T', 1. ) 192 IF ( ( nsbc == 2).OR.(nsbc == 5) ) THEN211 IF ( (ksbc == jp_flx) .OR. (ksbc == jp_cpl) ) THEN 193 212 DO jl=1,ncat 194 213 CALL cice2nemo(aicen(:,:,jl,:),a_i(:,:,jl), 'T', 1. ) … … 218 237 snwice_mass_b(:,:) = 0.0_wp ! no mass exchanges 219 238 ENDIF 220 IF( nn_ice_embd == 2 .AND. & ! full embedment (case 2) & no restart : 221 & .NOT.ln_rstart ) THEN ! deplete the initial ssh belew sea-ice area 222 sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0 223 sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0 224 ! 239 IF( .NOT. ln_rstart ) THEN 240 IF( nn_ice_embd == 2 ) THEN ! full embedment (case 2) deplete the initial ssh below sea-ice area 241 sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0 242 sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0 243 #if defined key_vvl 244 ! key_vvl necessary? clem: yes for compilation purpose 245 DO jk = 1,jpkm1 ! adjust initial vertical scale factors 246 fse3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) ) 247 fse3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) ) 248 ENDDO 249 fse3t_a(:,:,:) = fse3t_b(:,:,:) 250 ! Reconstruction of all vertical scale factors at now and before time 251 ! steps 252 ! ============================================================================= 253 ! Horizontal scale factor interpolations 254 ! -------------------------------------- 255 CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3u_b(:,:,:), 'U' ) 256 CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3v_b(:,:,:), 'V' ) 257 CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3u_n(:,:,:), 'U' ) 258 CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3v_n(:,:,:), 'V' ) 259 CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3f_n(:,:,:), 'F' ) 260 ! Vertical scale factor interpolations 261 ! ------------------------------------ 262 CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3w_n (:,:,:), 'W' ) 263 CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3uw_n(:,:,:), 'UW' ) 264 CALL dom_vvl_interpol( fse3v_n(:,:,:), fse3vw_n(:,:,:), 'VW' ) 265 CALL dom_vvl_interpol( fse3u_b(:,:,:), fse3uw_b(:,:,:), 'UW' ) 266 CALL dom_vvl_interpol( fse3v_b(:,:,:), fse3vw_b(:,:,:), 'VW' ) 267 ! t- and w- points depth 268 ! ---------------------- 269 fsdept_n(:,:,1) = 0.5_wp * fse3w_n(:,:,1) 270 fsdepw_n(:,:,1) = 0.0_wp 271 fsde3w_n(:,:,1) = fsdept_n(:,:,1) - sshn(:,:) 272 DO jk = 2, jpk 273 fsdept_n(:,:,jk) = fsdept_n(:,:,jk-1) + fse3w_n(:,:,jk) 274 fsdepw_n(:,:,jk) = fsdepw_n(:,:,jk-1) + fse3t_n(:,:,jk-1) 275 fsde3w_n(:,:,jk) = fsdept_n(:,:,jk ) - sshn (:,:) 276 END DO 277 #endif 278 ENDIF 225 279 ENDIF 226 280 … … 232 286 233 287 234 SUBROUTINE cice_sbc_in (kt, nsbc)288 SUBROUTINE cice_sbc_in (kt, ksbc) 235 289 !!--------------------------------------------------------------------- 236 290 !! *** ROUTINE cice_sbc_in *** … … 238 292 !!--------------------------------------------------------------------- 239 293 INTEGER, INTENT(in ) :: kt ! ocean time step 240 INTEGER, INTENT(in ) :: nsbc ! surface forcing type294 INTEGER, INTENT(in ) :: ksbc ! surface forcing type 241 295 242 296 INTEGER :: ji, jj, jl ! dummy loop indices … … 262 316 ! forced and coupled case 263 317 264 IF ( ( nsbc == 2).OR.(nsbc == 5) ) THEN318 IF ( (ksbc == jp_flx).OR.(ksbc == jp_cpl) ) THEN 265 319 266 320 ztmpn(:,:,:)=0.0 … … 287 341 288 342 ! Surface downward latent heat flux (CI_5) 289 IF ( nsbc == 2) THEN343 IF (ksbc == jp_flx) THEN 290 344 DO jl=1,ncat 291 345 ztmpn(:,:,jl)=qla_ice(:,:,1)*a_i(:,:,jl) … … 316 370 ! GBM conductive flux through ice (CI_6) 317 371 ! Convert to GBM 318 IF ( nsbc == 2) THEN372 IF (ksbc == jp_flx) THEN 319 373 ztmp(:,:) = botmelt(:,:,jl)*a_i(:,:,jl) 320 374 ELSE … … 325 379 ! GBM surface heat flux (CI_7) 326 380 ! Convert to GBM 327 IF ( nsbc == 2) THEN381 IF (ksbc == jp_flx) THEN 328 382 ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl))*a_i(:,:,jl) 329 383 ELSE … … 333 387 ENDDO 334 388 335 ELSE IF ( nsbc == 4) THEN389 ELSE IF (ksbc == jp_core) THEN 336 390 337 391 ! Pass CORE forcing fields to CICE (which will calculate heat fluxes etc itself) … … 375 429 376 430 ! Snowfall 377 ! Ensure fsnow is positive (as in CICE routine prepare_forcing) 431 ! Ensure fsnow is positive (as in CICE routine prepare_forcing) 432 IF( iom_use('snowpre') ) CALL iom_put('snowpre',MAX( (1.0-fr_i(:,:))*sprecip(:,:) ,0.0)) !!Joakim edit 378 433 ztmp(:,:)=MAX(fr_i(:,:)*sprecip(:,:),0.0) 379 434 CALL nemo2cice(ztmp,fsnow,'T', 1. ) 380 435 381 436 ! Rainfall 437 IF( iom_use('precip') ) CALL iom_put('precip', (1.0-fr_i(:,:))*(tprecip(:,:)-sprecip(:,:)) ) !!Joakim edit 382 438 ztmp(:,:)=fr_i(:,:)*(tprecip(:,:)-sprecip(:,:)) 383 439 CALL nemo2cice(ztmp,frain,'T', 1. ) … … 458 514 459 515 460 SUBROUTINE cice_sbc_out (kt, nsbc)516 SUBROUTINE cice_sbc_out (kt,ksbc) 461 517 !!--------------------------------------------------------------------- 462 518 !! *** ROUTINE cice_sbc_out *** … … 464 520 !!--------------------------------------------------------------------- 465 521 INTEGER, INTENT( in ) :: kt ! ocean time step 466 INTEGER, INTENT( in ) :: nsbc ! surface forcing type522 INTEGER, INTENT( in ) :: ksbc ! surface forcing type 467 523 468 524 INTEGER :: ji, jj, jl ! dummy loop indices … … 510 566 ! Freshwater fluxes 511 567 512 IF ( nsbc == 2) THEN568 IF (ksbc == jp_flx) THEN 513 569 ! Note that emp from the forcing files is evap*(1-aice)-(tprecip-aice*sprecip) 514 570 ! What we want here is evap*(1-aice)-tprecip*(1-aice) hence manipulation below … … 516 572 ! Better to use evap and tprecip? (but for now don't read in evap in this case) 517 573 emp(:,:) = emp(:,:)+fr_i(:,:)*(tprecip(:,:)-sprecip(:,:)) 518 ELSE IF ( nsbc == 4) THEN574 ELSE IF (ksbc == jp_core) THEN 519 575 emp(:,:) = (1.0-fr_i(:,:))*emp(:,:) 520 ELSE IF ( nsbc ==5) THEN576 ELSE IF (ksbc == jp_cpl) THEN 521 577 ! emp_tot is set in sbc_cpl_ice_flx (called from cice_sbc_in above) 522 578 ! This is currently as required with the coupling fields from the UM atmosphere … … 524 580 ENDIF 525 581 582 #if defined key_cice4 526 583 CALL cice2nemo(fresh_gbm,ztmp1,'T', 1. ) 527 584 CALL cice2nemo(fsalt_gbm,ztmp2,'T', 1. ) 585 #else 586 CALL cice2nemo(fresh_ai,ztmp1,'T', 1. ) 587 CALL cice2nemo(fsalt_ai,ztmp2,'T', 1. ) 588 #endif 528 589 529 590 ! Check to avoid unphysical expression when ice is forming (ztmp1 negative) … … 535 596 sfx(:,:)=ztmp2(:,:)*1000.0 536 597 emp(:,:)=emp(:,:)-ztmp1(:,:) 537 598 fmmflx(:,:) = ztmp1(:,:) !!Joakim edit 599 538 600 CALL lbc_lnk( emp , 'T', 1. ) 539 601 CALL lbc_lnk( sfx , 'T', 1. ) … … 543 605 ! Scale qsr and qns according to ice fraction (bulk formulae only) 544 606 545 IF ( nsbc == 4) THEN607 IF (ksbc == jp_core) THEN 546 608 qsr(:,:)=qsr(:,:)*(1.0-fr_i(:,:)) 547 609 qns(:,:)=qns(:,:)*(1.0-fr_i(:,:)) 548 610 ENDIF 549 611 ! Take into account snow melting except for fully coupled when already in qns_tot 550 IF ( nsbc == 5) THEN612 IF (ksbc == jp_cpl) THEN 551 613 qsr(:,:)= qsr_tot(:,:) 552 614 qns(:,:)= qns_tot(:,:) … … 557 619 ! Now add in ice / snow related terms 558 620 ! [fswthru will be zero unless running with calc_Tsfc=T in CICE] 621 #if defined key_cice4 559 622 CALL cice2nemo(fswthru_gbm,ztmp1,'T', 1. ) 623 #else 624 CALL cice2nemo(fswthru_ai,ztmp1,'T', 1. ) 625 #endif 560 626 qsr(:,:)=qsr(:,:)+ztmp1(:,:) 561 627 CALL lbc_lnk( qsr , 'T', 1. ) … … 567 633 ENDDO 568 634 635 #if defined key_cice4 569 636 CALL cice2nemo(fhocn_gbm,ztmp1,'T', 1. ) 637 #else 638 CALL cice2nemo(fhocn_ai,ztmp1,'T', 1. ) 639 #endif 570 640 qns(:,:)=qns(:,:)+nfrzmlt(:,:)+ztmp1(:,:) 571 641 … … 575 645 576 646 CALL cice2nemo(aice,fr_i,'T', 1. ) 577 IF ( ( nsbc == 2).OR.(nsbc == 5) ) THEN647 IF ( (ksbc == jp_flx).OR.(ksbc == jp_cpl) ) THEN 578 648 DO jl=1,ncat 579 649 CALL cice2nemo(aicen(:,:,jl,:),a_i(:,:,jl), 'T', 1. ) … … 611 681 612 682 613 #if defined key_oasis3 || defined key_oasis4614 683 SUBROUTINE cice_sbc_hadgam( kt ) 615 684 !!--------------------------------------------------------------------- … … 653 722 END SUBROUTINE cice_sbc_hadgam 654 723 655 #else656 SUBROUTINE cice_sbc_hadgam( kt ) ! Dummy routine657 INTEGER, INTENT( in ) :: kt ! ocean time step658 WRITE(*,*) 'cice_sbc_hadgam: You should not have seen this print! error?'659 END SUBROUTINE cice_sbc_hadgam660 #endif661 724 662 725 SUBROUTINE cice_sbc_final … … 713 776 IF( kt == nit000 ) THEN ! First call kt=nit000 ! 714 777 ! ! ====================== ! 778 ! namsbc_cice is not yet in the reference namelist 779 ! set file information (default values) 780 cn_dir = './' ! directory in which the model is executed 781 782 ! (NB: frequency positive => hours, negative => months) 783 ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! weights ! rotation ! landmask 784 ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs ! file 785 sn_snow = FLD_N( 'snowfall_1m' , -1. , 'snowfall' , .true. , .true. , ' yearly' , '' , '' , '' ) 786 sn_rain = FLD_N( 'rainfall_1m' , -1. , 'rainfall' , .true. , .true. , ' yearly' , '' , '' , '' ) 787 sn_sblm = FLD_N( 'sublim_1m' , -1. , 'sublim' , .true. , .true. , ' yearly' , '' , '' , '' ) 788 sn_top1 = FLD_N( 'topmeltn1_1m' , -1. , 'topmeltn1' , .true. , .true. , ' yearly' , '' , '' , '' ) 789 sn_top2 = FLD_N( 'topmeltn2_1m' , -1. , 'topmeltn2' , .true. , .true. , ' yearly' , '' , '' , '' ) 790 sn_top3 = FLD_N( 'topmeltn3_1m' , -1. , 'topmeltn3' , .true. , .true. , ' yearly' , '' , '' , '' ) 791 sn_top4 = FLD_N( 'topmeltn4_1m' , -1. , 'topmeltn4' , .true. , .true. , ' yearly' , '' , '' , '' ) 792 sn_top5 = FLD_N( 'topmeltn5_1m' , -1. , 'topmeltn5' , .true. , .true. , ' yearly' , '' , '' , '' ) 793 sn_bot1 = FLD_N( 'botmeltn1_1m' , -1. , 'botmeltn1' , .true. , .true. , ' yearly' , '' , '' , '' ) 794 sn_bot2 = FLD_N( 'botmeltn2_1m' , -1. , 'botmeltn2' , .true. , .true. , ' yearly' , '' , '' , '' ) 795 sn_bot3 = FLD_N( 'botmeltn3_1m' , -1. , 'botmeltn3' , .true. , .true. , ' yearly' , '' , '' , '' ) 796 sn_bot4 = FLD_N( 'botmeltn4_1m' , -1. , 'botmeltn4' , .true. , .true. , ' yearly' , '' , '' , '' ) 797 sn_bot5 = FLD_N( 'botmeltn5_1m' , -1. , 'botmeltn5' , .true. , .true. , ' yearly' , '' , '' , '' ) 798 715 799 REWIND( numnam_ref ) ! Namelist namsbc_cice in reference namelist : 716 800 READ ( numnam_ref, namsbc_cice, IOSTAT = ios, ERR = 901) … … 1001 1085 CONTAINS 1002 1086 1003 SUBROUTINE sbc_ice_cice ( kt, nsbc ) ! Dummy routine1087 SUBROUTINE sbc_ice_cice ( kt, ksbc ) ! Dummy routine 1004 1088 WRITE(*,*) 'sbc_ice_cice: You should not have seen this print! error?', kt 1005 1089 END SUBROUTINE sbc_ice_cice 1006 1090 1007 SUBROUTINE cice_sbc_init ( nsbc) ! Dummy routine1091 SUBROUTINE cice_sbc_init (ksbc) ! Dummy routine 1008 1092 WRITE(*,*) 'cice_sbc_init: You should not have seen this print! error?' 1009 1093 END SUBROUTINE cice_sbc_init -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_if.F90
r4792 r5038 16 16 USE eosbn2 ! equation of state 17 17 USE sbc_oce ! surface boundary condition: ocean fields 18 USE sbccpl 18 #if defined key_lim3 19 USE ice , ONLY : a_i 20 #else 21 USE sbc_ice, ONLY : a_i 22 #endif 19 23 USE fldread ! read input field 20 24 USE iom ! I/O manager library … … 99 103 ! ( d rho / dt ) / ( d rho / ds ) ( s = 34, t = -1.8 ) 100 104 101 fr_i(:,:) = tfreez( sss_m ) * tmask(:,:,1) ! sea surface freezing temperature [Celcius]105 fr_i(:,:) = eos_fzp( sss_m ) * tmask(:,:,1) ! sea surface freezing temperature [Celcius] 102 106 103 ! OM : probleme. a_i pas defini dans les cas lim3 et cice 104 #if defined key_coupled && defined key_lim2 105 a_i(:,:,1) = fr_i(:,:) 106 #endif 107 IF( lk_cpl ) a_i(:,:,1) = fr_i(:,:) 107 108 108 109 ! Flux and ice fraction computation 109 !CDIR COLLAPSE110 110 DO jj = 1, jpj 111 111 DO ji = 1, jpi -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90
r4792 r5038 12 12 !! 3.4 ! 2011-01 (A Porter) dynamical allocation 13 13 !! - ! 2012-10 (C. Rousset) add lim_diahsb 14 !! 3.6 ! 2014-07 (M. Vancoppenolle, G. Madec, O. Marti) revise coupled interface 14 15 !!---------------------------------------------------------------------- 15 16 #if defined key_lim3 … … 80 81 !!---------------------------------------------------------------------- 81 82 CONTAINS 82 83 FUNCTION fice_cell_ave ( ptab)84 !!--------------------------------------------------------------------------85 !! * Compute average over categories, for grid cell (ice covered and free ocean)86 !!--------------------------------------------------------------------------87 REAL (wp), DIMENSION (jpi,jpj) :: fice_cell_ave88 REAL (wp), DIMENSION (jpi,jpj,jpl), INTENT (in) :: ptab89 INTEGER :: jl ! Dummy loop index90 91 fice_cell_ave (:,:) = 0.0_wp92 93 DO jl = 1, jpl94 fice_cell_ave (:,:) = fice_cell_ave (:,:) &95 & + a_i (:,:,jl) * ptab (:,:,jl)96 END DO97 98 END FUNCTION fice_cell_ave99 100 FUNCTION fice_ice_ave ( ptab)101 !!--------------------------------------------------------------------------102 !! * Compute average over categories, for ice covered part of grid cell103 !!--------------------------------------------------------------------------104 REAL (kind=wp), DIMENSION (jpi,jpj) :: fice_ice_ave105 REAL (kind=wp), DIMENSION (jpi,jpj,jpl), INTENT(in) :: ptab106 107 fice_ice_ave (:,:) = 0.0_wp108 WHERE ( at_i (:,:) .GT. 0.0_wp ) fice_ice_ave (:,:) = fice_cell_ave ( ptab (:,:,:)) / at_i (:,:)109 110 END FUNCTION fice_ice_ave111 83 112 84 !!====================================================================== … … 133 105 !!--------------------------------------------------------------------- 134 106 INTEGER, INTENT(in) :: kt ! ocean time step 135 INTEGER, INTENT(in) :: kblk ! type of bulk (=3 CLIO, =4 CORE )107 INTEGER, INTENT(in) :: kblk ! type of bulk (=3 CLIO, =4 CORE, =5 COUPLED) 136 108 !! 137 109 INTEGER :: ji, jj, jl, jk ! dummy loop index 138 110 REAL(wp) :: zcoef ! local scalar 139 REAL(wp), POINTER, DIMENSION(:,:,:) :: zalb_ice_os, zalb_ice_cs ! albedo of the ice under overcast/clear sky 140 REAL(wp), POINTER, DIMENSION(:,:,:) :: zalb_ice ! mean albedo of ice (for coupled) 141 142 REAL(wp), POINTER, DIMENSION(:,:) :: zalb_ice_all ! Mean albedo over all categories 143 REAL(wp), POINTER, DIMENSION(:,:) :: ztem_ice_all ! Mean temperature over all categories 144 145 REAL(wp), POINTER, DIMENSION(:,:) :: z_qsr_ice_all ! Mean solar heat flux over all categories 146 REAL(wp), POINTER, DIMENSION(:,:) :: z_qns_ice_all ! Mean non solar heat flux over all categories 147 REAL(wp), POINTER, DIMENSION(:,:) :: z_qla_ice_all ! Mean latent heat flux over all categories 148 REAL(wp), POINTER, DIMENSION(:,:) :: z_dqns_ice_all ! Mean d(qns)/dT over all categories 149 REAL(wp), POINTER, DIMENSION(:,:) :: z_dqla_ice_all ! Mean d(qla)/dT over all categories 150 REAL(wp) :: ztmelts ! clem 2014: for HC diags 151 REAL(wp) :: epsi20 = 1.e-20 ! 111 REAL(wp), POINTER, DIMENSION(:,:,:) :: zalb_os, zalb_cs ! ice albedo under overcast/clear sky 112 REAL(wp), POINTER, DIMENSION(:,:,:) :: zalb_ice ! mean ice albedo (for coupled) 152 113 !!---------------------------------------------------------------------- 153 114 154 !- O.M. : why do we allocate all these arrays even when MOD( kt-1, nn_fsbc ) /= 0 ?????155 156 115 IF( nn_timing == 1 ) CALL timing_start('sbc_ice_lim') 157 158 CALL wrk_alloc( jpi,jpj,jpl, zalb_ice_os, zalb_ice_cs, zalb_ice )159 160 IF( lk_cpl ) THEN161 IF ( ln_iceflx_ave .OR. ln_iceflx_linear ) &162 & CALL wrk_alloc( jpi, jpj, ztem_ice_all , zalb_ice_all , z_qsr_ice_all, z_qns_ice_all, &163 & z_qla_ice_all, z_dqns_ice_all, z_dqla_ice_all)164 ENDIF165 116 166 117 IF( kt == nit000 ) THEN … … 183 134 ! !----------------! 184 135 ! 185 u_oce(:,:) = ssu_m(:,:) ! mean surface ocean current at ice velocity point 186 v_oce(:,:) = ssv_m(:,:) ! (C-grid dynamics : U- & V-points as the ocean) 187 188 ! masked sea surface freezing temperature [Kelvin] 189 t_bo(:,:) = ( tfreez( sss_m ) + rt0 ) * tmask(:,:,1) + rt0 * ( 1. - tmask(:,:,1) ) 190 191 CALL albedo_ice( t_su, ht_i, ht_s, zalb_ice_cs, zalb_ice_os ) ! ... ice albedo 192 136 u_oce(:,:) = ssu_m(:,:) * umask(:,:,1) ! mean surface ocean current at ice velocity point 137 v_oce(:,:) = ssv_m(:,:) * vmask(:,:,1) ! (C-grid dynamics : U- & V-points as the ocean) 138 ! 139 t_bo(:,:) = ( eos_fzp( sss_m ) + rt0 ) * tmask(:,:,1) + rt0 * ( 1. - tmask(:,:,1) ) ! masked sea surface freezing temperature [Kelvin] 140 ! ! (set to rt0 over land) 141 ! ! Ice albedo 142 CALL wrk_alloc( jpi,jpj,jpl, zalb_os, zalb_cs, zalb_ice ) 143 144 CALL albedo_ice( t_su, ht_i, ht_s, zalb_cs, zalb_os ) ! cloud-sky and overcast-sky ice albedos 145 146 SELECT CASE( kblk ) 147 CASE( jp_core , jp_cpl ) ! CORE and COUPLED bulk formulations 148 149 ! albedo depends on cloud fraction because of non-linear spectral effects 150 zalb_ice(:,:,:) = ( 1. - cldf_ice ) * zalb_cs(:,:,:) + cldf_ice * zalb_os(:,:,:) 151 ! In CLIO the cloud fraction is read in the climatology and the all-sky albedo 152 ! (zalb_ice) is computed within the bulk routine 153 154 END SELECT 155 156 ! ! Mask sea ice surface temperature 193 157 DO jl = 1, jpl 194 158 t_su(:,:,jl) = t_su(:,:,jl) + rt0 * ( 1. - tmask(:,:,1) ) 195 159 END DO 196 197 IF ( ln_cpl ) zalb_ice (:,:,:) = 0.5 * ( zalb_ice_cs (:,:,:) + zalb_ice_os (:,:,:) ) 198 199 IF( lk_cpl ) THEN 200 IF ( ln_iceflx_ave .OR. ln_iceflx_linear ) THEN 201 ! 202 ! Compute mean albedo and temperature 203 zalb_ice_all (:,:) = fice_ice_ave ( zalb_ice (:,:,:) ) 204 ztem_ice_all (:,:) = fice_ice_ave ( tn_ice (:,:,:) ) 205 ! 206 ENDIF 207 ENDIF 208 ! Bulk formulea - provides the following fields: 160 161 ! Bulk formulae - provides the following fields: 209 162 ! utau_ice, vtau_ice : surface ice stress (U- & V-points) [N/m2] 210 163 ! qsr_ice , qns_ice : solar & non solar heat flux over ice (T-point) [W/m2] … … 215 168 ! 216 169 SELECT CASE( kblk ) 217 CASE( 3) ! CLIO bulk formulation218 CALL blk_ice_clio( t_su , zalb_ ice_cs, zalb_ice_os,&170 CASE( jp_clio ) ! CLIO bulk formulation 171 CALL blk_ice_clio( t_su , zalb_cs , zalb_os , zalb_ice , & 219 172 & utau_ice , vtau_ice , qns_ice , qsr_ice , & 220 173 & qla_ice , dqns_ice , dqla_ice , & … … 222 175 & fr1_i0 , fr2_i0 , cp_ice_msh, jpl ) 223 176 ! 224 CASE( 4 ) ! CORE bulk formulation 225 ! MV 2014 226 ! We must account for cloud fraction in the computation of the albedo 227 ! The present ref just uses the clear sky value 228 ! The overcast sky value is 0.06 higher, and polar skies are mostly overcast 229 ! CORE has no cloud fraction, hence we must prescribe it 230 ! Mean summer cloud fraction computed from CLIO = 0.81 231 zalb_ice(:,:,:) = 0.19 * zalb_ice_cs(:,:,:) + 0.81 * zalb_ice_os(:,:,:) 232 ! Following line, we replace zalb_ice_cs by simply zalb_ice 177 IF( nn_limflx /= 2 ) CALL ice_lim_flx( t_su, zalb_ice, qns_ice, qsr_ice , & 178 & dqns_ice, qla_ice, dqla_ice, nn_limflx ) 179 180 CASE( jp_core ) ! CORE bulk formulation 233 181 CALL blk_ice_core( t_su , u_ice , v_ice , zalb_ice , & 234 182 & utau_ice , vtau_ice , qns_ice , qsr_ice , & … … 236 184 & tprecip , sprecip , & 237 185 & fr1_i0 , fr2_i0 , cp_ice_msh, jpl ) 186 ! 187 IF( nn_limflx /= 2 ) CALL ice_lim_flx( t_su, zalb_ice, qns_ice, qsr_ice , & 188 & dqns_ice, qla_ice, dqla_ice, nn_limflx ) 238 189 ! 239 CASE ( 5 ) 240 zalb_ice (:,:,:) = 0.5 * ( zalb_ice_cs (:,:,:) + zalb_ice_os (:,:,:) ) 190 CASE ( jp_cpl ) 241 191 242 192 CALL sbc_cpl_ice_tau( utau_ice , vtau_ice ) 243 193 244 CALL sbc_cpl_ice_flx( p_frld=ato_i, palbi=zalb_ice, psst=sst_m, pist=tn_ice ) 245 246 ! Latent heat flux is forced to 0 in coupled : 247 ! it is included in qns (non-solar heat flux) 248 qla_ice (:,:,:) = 0.0e0_wp 249 dqla_ice (:,:,:) = 0.0e0_wp 194 ! MV -> seb 195 ! CALL sbc_cpl_ice_flx( p_frld=ato_i, palbi=zalb_ice, psst=sst_m, pist=t_su ) 196 197 ! IF( nn_limflx == 2 ) CALL ice_lim_flx( t_su, zalb_ice, qns_ice, qsr_ice , & 198 ! & dqns_ice, qla_ice, dqla_ice, nn_limflx ) 199 ! ! Latent heat flux is forced to 0 in coupled : 200 ! ! it is included in qns (non-solar heat flux) 201 ! qla_ice (:,:,:) = 0._wp 202 ! dqla_ice (:,:,:) = 0._wp 203 ! END MV -> seb 250 204 ! 251 205 END SELECT 252 253 ! Average over all categories 254 IF( lk_cpl ) THEN 255 IF ( ln_iceflx_ave .OR. ln_iceflx_linear ) THEN 256 257 z_qns_ice_all (:,:) = fice_ice_ave ( qns_ice (:,:,:) ) 258 z_qsr_ice_all (:,:) = fice_ice_ave ( qsr_ice (:,:,:) ) 259 z_dqns_ice_all (:,:) = fice_ice_ave ( dqns_ice (:,:,:) ) 260 z_qla_ice_all (:,:) = fice_ice_ave ( qla_ice (:,:,:) ) 261 z_dqla_ice_all (:,:) = fice_ice_ave ( dqla_ice (:,:,:) ) 262 263 DO jl = 1, jpl 264 dqns_ice (:,:,jl) = z_dqns_ice_all (:,:) 265 dqla_ice (:,:,jl) = z_dqla_ice_all (:,:) 266 END DO 267 ! 268 IF ( ln_iceflx_ave ) THEN 269 DO jl = 1, jpl 270 qns_ice (:,:,jl) = z_qns_ice_all (:,:) 271 qsr_ice (:,:,jl) = z_qsr_ice_all (:,:) 272 qla_ice (:,:,jl) = z_qla_ice_all (:,:) 273 END DO 274 END IF 275 ! 276 IF ( ln_iceflx_linear ) THEN 277 DO jl = 1, jpl 278 qns_ice (:,:,jl) = z_qns_ice_all(:,:) + z_dqns_ice_all(:,:) * (tn_ice(:,:,jl) - ztem_ice_all(:,:)) 279 qla_ice (:,:,jl) = z_qla_ice_all(:,:) + z_dqla_ice_all(:,:) * (tn_ice(:,:,jl) - ztem_ice_all(:,:)) 280 qsr_ice (:,:,jl) = (1.0e0_wp-zalb_ice(:,:,jl)) / (1.0e0_wp-zalb_ice_all(:,:)) * z_qsr_ice_all(:,:) 281 END DO 282 END IF 283 END IF 284 ENDIF 206 285 207 ! !----------------------! 286 208 ! ! LIM-3 time-stepping ! … … 290 212 ! 291 213 ! ! Store previous ice values 292 !!gm : remark old_... should becomes ...b as tn versus tb 293 old_a_i (:,:,:) = a_i (:,:,:) ! ice area 294 old_e_i (:,:,:,:) = e_i (:,:,:,:) ! ice thermal energy 295 old_v_i (:,:,:) = v_i (:,:,:) ! ice volume 296 old_v_s (:,:,:) = v_s (:,:,:) ! snow volume 297 old_e_s (:,:,:,:) = e_s (:,:,:,:) ! snow thermal energy 298 old_smv_i(:,:,:) = smv_i(:,:,:) ! salt content 299 old_oa_i (:,:,:) = oa_i (:,:,:) ! areal age content 300 old_u_ice(:,:) = u_ice(:,:) 301 old_v_ice(:,:) = v_ice(:,:) 302 303 ! trends !!gm is it truly necessary ??? 304 d_a_i_thd (:,:,:) = 0._wp ; d_a_i_trp (:,:,:) = 0._wp 305 d_v_i_thd (:,:,:) = 0._wp ; d_v_i_trp (:,:,:) = 0._wp 306 d_e_i_thd (:,:,:,:) = 0._wp ; d_e_i_trp (:,:,:,:) = 0._wp 307 d_v_s_thd (:,:,:) = 0._wp ; d_v_s_trp (:,:,:) = 0._wp 308 d_e_s_thd (:,:,:,:) = 0._wp ; d_e_s_trp (:,:,:,:) = 0._wp 309 d_smv_i_thd(:,:,:) = 0._wp ; d_smv_i_trp(:,:,:) = 0._wp 310 d_oa_i_thd (:,:,:) = 0._wp ; d_oa_i_trp (:,:,:) = 0._wp 311 d_u_ice_dyn(:,:) = 0._wp ; d_v_ice_dyn(:,:) = 0._wp 214 a_i_b (:,:,:) = a_i (:,:,:) ! ice area 215 e_i_b (:,:,:,:) = e_i (:,:,:,:) ! ice thermal energy 216 v_i_b (:,:,:) = v_i (:,:,:) ! ice volume 217 v_s_b (:,:,:) = v_s (:,:,:) ! snow volume 218 e_s_b (:,:,:,:) = e_s (:,:,:,:) ! snow thermal energy 219 smv_i_b(:,:,:) = smv_i(:,:,:) ! salt content 220 oa_i_b (:,:,:) = oa_i (:,:,:) ! areal age content 221 u_ice_b(:,:) = u_ice(:,:) 222 v_ice_b(:,:) = v_ice(:,:) 312 223 313 224 ! salt, heat and mass fluxes 314 225 sfx (:,:) = 0._wp ; 315 sfx_bri(:,:) = 0._wp ; sfx_dyn(:,:) = 0._wp226 sfx_bri(:,:) = 0._wp ; 316 227 sfx_sni(:,:) = 0._wp ; sfx_opw(:,:) = 0._wp 317 228 sfx_bog(:,:) = 0._wp ; sfx_dyn(:,:) = 0._wp … … 334 245 hfx_spr(:,:) = 0._wp ; hfx_dif(:,:) = 0._wp 335 246 hfx_err(:,:) = 0._wp ; hfx_err_rem(:,:) = 0._wp 336 337 !338 fhld (:,:) = 0._wp339 fmmflx(:,:) = 0._wp340 ! part of solar radiation transmitted through the ice341 ftr_ice(:,:,:) = 0._wp342 343 ! diags344 diag_trp_vi (:,:) = 0._wp ; diag_trp_vs(:,:) = 0._wp ; diag_trp_ei(:,:) = 0._wp ; diag_trp_es(:,:) = 0._wp345 diag_heat_dhc(:,:) = 0._wp346 347 ! dynamical invariants348 delta_i(:,:) = 0._wp ; divu_i(:,:) = 0._wp ; shear_i(:,:) = 0._wp349 247 350 248 CALL lim_rst_opn( kt ) ! Open Ice restart file … … 372 270 ENDIF 373 271 ! !- Change old values for new values 374 old_u_ice(:,:) = u_ice(:,:)375 old_v_ice(:,:) = v_ice(:,:)376 old_a_i(:,:,:) = a_i(:,:,:)377 old_v_s(:,:,:) = v_s(:,:,:)378 old_v_i(:,:,:) = v_i(:,:,:)379 old_e_s(:,:,:,:) = e_s(:,:,:,:)380 old_e_i(:,:,:,:) = e_i(:,:,:,:)381 o ld_oa_i(:,:,:) = oa_i(:,:,:)382 old_smv_i(:,:,:) = smv_i(:,:,:)272 u_ice_b(:,:) = u_ice(:,:) 273 v_ice_b(:,:) = v_ice(:,:) 274 a_i_b (:,:,:) = a_i (:,:,:) 275 v_s_b (:,:,:) = v_s (:,:,:) 276 v_i_b (:,:,:) = v_i (:,:,:) 277 e_s_b (:,:,:,:) = e_s (:,:,:,:) 278 e_i_b (:,:,:,:) = e_i (:,:,:,:) 279 oa_i_b (:,:,:) = oa_i (:,:,:) 280 smv_i_b(:,:,:) = smv_i(:,:,:) 383 281 384 282 ! ---------------------------------------------- … … 390 288 pfrld(:,:) = 1._wp - at_i(:,:) 391 289 phicif(:,:) = vt_i(:,:) 290 291 ! MV -> seb 292 SELECT CASE( kblk ) 293 CASE ( jp_cpl ) 294 CALL sbc_cpl_ice_flx( p_frld=pfrld, palbi=zalb_ice, psst=sst_m, pist=t_su ) 295 IF( nn_limflx == 2 ) CALL ice_lim_flx( t_su, zalb_ice, qns_ice, qsr_ice , & 296 & dqns_ice, qla_ice, dqla_ice, nn_limflx ) 297 ! Latent heat flux is forced to 0 in coupled : 298 ! it is included in qns (non-solar heat flux) 299 qla_ice (:,:,:) = 0._wp 300 dqla_ice (:,:,:) = 0._wp 301 END SELECT 302 ! END MV -> seb 392 303 ! 393 304 CALL lim_var_bv ! bulk brine volume (diag) … … 421 332 IF( ln_nicep ) CALL lim_ctl( kt ) ! alerts in case of model crash 422 333 ! 334 CALL wrk_dealloc( jpi,jpj,jpl, zalb_os, zalb_cs, zalb_ice ) 335 ! 423 336 ENDIF ! End sea-ice time step only 424 337 … … 430 343 ! ! otherwise the atm.-ocean stresses are used everywhere 431 344 IF( ln_limdyn ) CALL lim_sbc_tau( kt, ub(:,:,1), vb(:,:,1) ) ! using before instantaneous surf. currents 432 433 345 !!gm remark, the ocean-ice stress is not saved in ice diag call above ..... find a solution!!! 434 CALL wrk_dealloc( jpi,jpj,jpl, zalb_ice_os, zalb_ice_cs, zalb_ice ) 435 436 IF( lk_cpl ) THEN 437 IF ( ln_iceflx_ave .OR. ln_iceflx_linear ) & 438 & CALL wrk_dealloc( jpi, jpj, ztem_ice_all , zalb_ice_all , z_qsr_ice_all, z_qns_ice_all, & 439 & z_qla_ice_all, z_dqns_ice_all, z_dqla_ice_all) 440 ENDIF 346 441 347 ! 442 348 IF( nn_timing == 1 ) CALL timing_stop('sbc_ice_lim') 443 349 ! 444 350 END SUBROUTINE sbc_ice_lim 445 446 351 352 353 SUBROUTINE ice_lim_flx( ptn_ice, palb_ice, pqns_ice, pqsr_ice, & 354 & pdqn_ice, pqla_ice, pdql_ice, k_limflx ) 355 !!--------------------------------------------------------------------- 356 !! *** ROUTINE sbc_ice_lim *** 357 !! 358 !! ** Purpose : update the ice surface boundary condition by averaging and / or 359 !! redistributing fluxes on ice categories 360 !! 361 !! ** Method : average then redistribute 362 !! 363 !! ** Action : 364 !!--------------------------------------------------------------------- 365 INTEGER , INTENT(in ) :: k_limflx ! =-1 do nothing; =0 average ; 366 ! =1 average and redistribute ; =2 redistribute 367 REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: ptn_ice ! ice surface temperature 368 REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: palb_ice ! ice albedo 369 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pqns_ice ! non solar flux 370 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pqsr_ice ! net solar flux 371 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pdqn_ice ! non solar flux sensitivity 372 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pqla_ice ! latent heat flux 373 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pdql_ice ! latent heat flux sensitivity 374 ! 375 INTEGER :: jl ! dummy loop index 376 ! 377 REAL(wp), POINTER, DIMENSION(:,:) :: zalb_m ! Mean albedo over all categories 378 REAL(wp), POINTER, DIMENSION(:,:) :: ztem_m ! Mean temperature over all categories 379 ! 380 REAL(wp), POINTER, DIMENSION(:,:) :: z_qsr_m ! Mean solar heat flux over all categories 381 REAL(wp), POINTER, DIMENSION(:,:) :: z_qns_m ! Mean non solar heat flux over all categories 382 REAL(wp), POINTER, DIMENSION(:,:) :: z_qla_m ! Mean latent heat flux over all categories 383 REAL(wp), POINTER, DIMENSION(:,:) :: z_dqn_m ! Mean d(qns)/dT over all categories 384 REAL(wp), POINTER, DIMENSION(:,:) :: z_dql_m ! Mean d(qla)/dT over all categories 385 !!---------------------------------------------------------------------- 386 387 IF( nn_timing == 1 ) CALL timing_start('ice_lim_flx') 388 ! 389 ! 390 SELECT CASE( k_limflx ) !== averaged on all ice categories ==! 391 CASE( 0 , 1 ) 392 CALL wrk_alloc( jpi,jpj, z_qsr_m, z_qns_m, z_qla_m, z_dqn_m, z_dql_m) 393 ! 394 z_qns_m(:,:) = fice_ice_ave ( pqns_ice (:,:,:) ) 395 z_qsr_m(:,:) = fice_ice_ave ( pqsr_ice (:,:,:) ) 396 z_dqn_m(:,:) = fice_ice_ave ( pdqn_ice (:,:,:) ) 397 z_qla_m(:,:) = fice_ice_ave ( pqla_ice (:,:,:) ) 398 z_dql_m(:,:) = fice_ice_ave ( pdql_ice (:,:,:) ) 399 DO jl = 1, jpl 400 pdqn_ice(:,:,jl) = z_dqn_m(:,:) 401 pdql_ice(:,:,jl) = z_dql_m(:,:) 402 END DO 403 ! 404 DO jl = 1, jpl 405 pqns_ice(:,:,jl) = z_qns_m(:,:) 406 pqsr_ice(:,:,jl) = z_qsr_m(:,:) 407 pqla_ice(:,:,jl) = z_qla_m(:,:) 408 END DO 409 ! 410 CALL wrk_dealloc( jpi,jpj, z_qsr_m, z_qns_m, z_qla_m, z_dqn_m, z_dql_m) 411 END SELECT 412 413 SELECT CASE( k_limflx ) !== redistribution on all ice categories ==! 414 CASE( 1 , 2 ) 415 CALL wrk_alloc( jpi,jpj, zalb_m, ztem_m ) 416 ! 417 zalb_m(:,:) = fice_ice_ave ( palb_ice (:,:,:) ) 418 ztem_m(:,:) = fice_ice_ave ( ptn_ice (:,:,:) ) 419 DO jl = 1, jpl 420 pqns_ice(:,:,jl) = pqns_ice(:,:,jl) + pdqn_ice(:,:,jl) * (ptn_ice(:,:,jl) - ztem_m(:,:)) 421 pqla_ice(:,:,jl) = pqla_ice(:,:,jl) + pdql_ice(:,:,jl) * (ptn_ice(:,:,jl) - ztem_m(:,:)) 422 pqsr_ice(:,:,jl) = pqsr_ice(:,:,jl) * ( 1._wp - palb_ice(:,:,jl) ) / ( 1._wp - zalb_m(:,:) ) 423 END DO 424 ! 425 CALL wrk_dealloc( jpi,jpj, zalb_m, ztem_m ) 426 END SELECT 427 ! 428 IF( nn_timing == 1 ) CALL timing_stop('ice_lim_flx') 429 ! 430 END SUBROUTINE ice_lim_flx 431 432 447 433 SUBROUTINE lim_ctl( kt ) 448 434 !!----------------------------------------------------------------------- … … 474 460 !WRITE(numout,*) ' at_i ', at_i(ji,jj) 475 461 !WRITE(numout,*) ' Point - category', ji, jj, jl 476 !WRITE(numout,*) ' a_i *** a_i_ old ', a_i (ji,jj,jl), old_a_i(ji,jj,jl)477 !WRITE(numout,*) ' v_i *** v_i_ old ', v_i (ji,jj,jl), old_v_i(ji,jj,jl)462 !WRITE(numout,*) ' a_i *** a_i_b ', a_i (ji,jj,jl), a_i_b (ji,jj,jl) 463 !WRITE(numout,*) ' v_i *** v_i_b ', v_i (ji,jj,jl), v_i_b (ji,jj,jl) 478 464 !WRITE(numout,*) ' d_a_i_thd/trp ', d_a_i_thd(ji,jj,jl), d_a_i_trp(ji,jj,jl) 479 465 !WRITE(numout,*) ' d_v_i_thd/trp ', d_v_i_thd(ji,jj,jl), d_v_i_trp(ji,jj,jl) … … 585 571 !DO jl = 1, jpl 586 572 !WRITE(numout,*) ' Category no: ', jl 587 !WRITE(numout,*) ' a_i : ', a_i (ji,jj,jl) , ' old_a_i : ', old_a_i(ji,jj,jl)573 !WRITE(numout,*) ' a_i : ', a_i (ji,jj,jl) , ' a_i_b : ', a_i_b (ji,jj,jl) 588 574 !WRITE(numout,*) ' d_a_i_trp : ', d_a_i_trp(ji,jj,jl) , ' d_a_i_thd : ', d_a_i_thd(ji,jj,jl) 589 !WRITE(numout,*) ' v_i : ', v_i (ji,jj,jl) , ' old_v_i : ', old_v_i(ji,jj,jl)575 !WRITE(numout,*) ' v_i : ', v_i (ji,jj,jl) , ' v_i_b : ', v_i_b (ji,jj,jl) 590 576 !WRITE(numout,*) ' d_v_i_trp : ', d_v_i_trp(ji,jj,jl) , ' d_v_i_thd : ', d_v_i_thd(ji,jj,jl) 591 577 !WRITE(numout,*) ' ' … … 676 662 !! n : number of the option 677 663 !!------------------------------------------------------------------- 678 INTEGER , INTENT(in) :: kt ! ocean time step664 INTEGER , INTENT(in) :: kt ! ocean time step 679 665 INTEGER , INTENT(in) :: ki, kj, kn ! ocean gridpoint indices 680 666 CHARACTER(len=*), INTENT(in) :: cd1 ! … … 763 749 WRITE(numout,*) ' strength : ', strength(ji,jj) 764 750 WRITE(numout,*) ' d_u_ice_dyn : ', d_u_ice_dyn(ji,jj), ' d_v_ice_dyn : ', d_v_ice_dyn(ji,jj) 765 WRITE(numout,*) ' old_u_ice : ', old_u_ice(ji,jj) , ' old_v_ice : ', old_v_ice(ji,jj)751 WRITE(numout,*) ' u_ice_b : ', u_ice_b(ji,jj) , ' v_ice_b : ', v_ice_b(ji,jj) 766 752 WRITE(numout,*) 767 753 … … 773 759 WRITE(numout,*) ' t_su : ', t_su(ji,jj,jl) , ' t_s : ', t_s(ji,jj,1,jl) 774 760 WRITE(numout,*) ' sm_i : ', sm_i(ji,jj,jl) , ' o_i : ', o_i(ji,jj,jl) 775 WRITE(numout,*) ' a_i : ', a_i(ji,jj,jl) , ' old_a_i : ', old_a_i(ji,jj,jl)761 WRITE(numout,*) ' a_i : ', a_i(ji,jj,jl) , ' a_i_b : ', a_i_b(ji,jj,jl) 776 762 WRITE(numout,*) ' d_a_i_trp : ', d_a_i_trp(ji,jj,jl) , ' d_a_i_thd : ', d_a_i_thd(ji,jj,jl) 777 WRITE(numout,*) ' v_i : ', v_i(ji,jj,jl) , ' old_v_i : ', old_v_i(ji,jj,jl)763 WRITE(numout,*) ' v_i : ', v_i(ji,jj,jl) , ' v_i_b : ', v_i_b(ji,jj,jl) 778 764 WRITE(numout,*) ' d_v_i_trp : ', d_v_i_trp(ji,jj,jl) , ' d_v_i_thd : ', d_v_i_thd(ji,jj,jl) 779 WRITE(numout,*) ' v_s : ', v_s(ji,jj,jl) , ' old_v_s : ', old_v_s(ji,jj,jl)765 WRITE(numout,*) ' v_s : ', v_s(ji,jj,jl) , ' v_s_b : ', v_s_b(ji,jj,jl) 780 766 WRITE(numout,*) ' d_v_s_trp : ', d_v_s_trp(ji,jj,jl) , ' d_v_s_thd : ', d_v_s_thd(ji,jj,jl) 781 WRITE(numout,*) ' e_i1 : ', e_i(ji,jj,1,jl)/1.0e9 , ' old_ei1 : ', old_e_i(ji,jj,1,jl)/1.0e9767 WRITE(numout,*) ' e_i1 : ', e_i(ji,jj,1,jl)/1.0e9 , ' ei1 : ', e_i_b(ji,jj,1,jl)/1.0e9 782 768 WRITE(numout,*) ' de_i1_trp : ', d_e_i_trp(ji,jj,1,jl)/1.0e9, ' de_i1_thd : ', d_e_i_thd(ji,jj,1,jl)/1.0e9 783 WRITE(numout,*) ' e_i2 : ', e_i(ji,jj,2,jl)/1.0e9 , ' old_ei2 : ', old_e_i(ji,jj,2,jl)/1.0e9769 WRITE(numout,*) ' e_i2 : ', e_i(ji,jj,2,jl)/1.0e9 , ' ei2_b : ', e_i_b(ji,jj,2,jl)/1.0e9 784 770 WRITE(numout,*) ' de_i2_trp : ', d_e_i_trp(ji,jj,2,jl)/1.0e9, ' de_i2_thd : ', d_e_i_thd(ji,jj,2,jl)/1.0e9 785 WRITE(numout,*) ' e_snow : ', e_s(ji,jj,1,jl) , ' old_e_snow : ', old_e_s(ji,jj,1,jl)771 WRITE(numout,*) ' e_snow : ', e_s(ji,jj,1,jl) , ' e_snow_b : ', e_s_b(ji,jj,1,jl) 786 772 WRITE(numout,*) ' d_e_s_trp : ', d_e_s_trp(ji,jj,1,jl) , ' d_e_s_thd : ', d_e_s_thd(ji,jj,1,jl) 787 WRITE(numout,*) ' smv_i : ', smv_i(ji,jj,jl) , ' old_smv_i : ', old_smv_i(ji,jj,jl)773 WRITE(numout,*) ' smv_i : ', smv_i(ji,jj,jl) , ' smv_i_b : ', smv_i_b(ji,jj,jl) 788 774 WRITE(numout,*) ' d_smv_i_trp: ', d_smv_i_trp(ji,jj,jl) , ' d_smv_i_thd: ', d_smv_i_thd(ji,jj,jl) 789 WRITE(numout,*) ' oa_i : ', oa_i(ji,jj,jl) , ' o ld_oa_i : ', old_oa_i(ji,jj,jl)775 WRITE(numout,*) ' oa_i : ', oa_i(ji,jj,jl) , ' oa_i_b : ', oa_i_b(ji,jj,jl) 790 776 WRITE(numout,*) ' d_oa_i_trp : ', d_oa_i_trp(ji,jj,jl) , ' d_oa_i_thd : ', d_oa_i_thd(ji,jj,jl) 791 777 END DO !jl … … 795 781 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~ ' 796 782 WRITE(numout,*) ' - Heat fluxes in and out the ice ***' 797 WRITE(numout,*) ' qsr_ini : ', pfrld(ji,jj) * qsr(ji,jj) + SUM( old_a_i(ji,jj,:) * qsr_ice(ji,jj,:) )798 WRITE(numout,*) ' qns_ini : ', pfrld(ji,jj) * qns(ji,jj) + SUM( old_a_i(ji,jj,:) * qns_ice(ji,jj,:) )783 WRITE(numout,*) ' qsr_ini : ', pfrld(ji,jj) * qsr(ji,jj) + SUM( a_i_b(ji,jj,:) * qsr_ice(ji,jj,:) ) 784 WRITE(numout,*) ' qns_ini : ', pfrld(ji,jj) * qns(ji,jj) + SUM( a_i_b(ji,jj,:) * qns_ice(ji,jj,:) ) 799 785 WRITE(numout,*) 800 786 WRITE(numout,*) … … 854 840 END DO 855 841 END DO 856 842 ! 857 843 END SUBROUTINE lim_prt_state 844 845 846 FUNCTION fice_cell_ave ( ptab ) 847 !!-------------------------------------------------------------------------- 848 !! * Compute average over categories, for grid cell (ice covered and free ocean) 849 !!-------------------------------------------------------------------------- 850 REAL (wp), DIMENSION (jpi,jpj) :: fice_cell_ave 851 REAL (wp), DIMENSION (jpi,jpj,jpl), INTENT (in) :: ptab 852 INTEGER :: jl ! Dummy loop index 853 854 fice_cell_ave (:,:) = 0.0_wp 855 856 DO jl = 1, jpl 857 fice_cell_ave (:,:) = fice_cell_ave (:,:) & 858 & + a_i (:,:,jl) * ptab (:,:,jl) 859 END DO 860 861 END FUNCTION fice_cell_ave 862 863 864 FUNCTION fice_ice_ave ( ptab ) 865 !!-------------------------------------------------------------------------- 866 !! * Compute average over categories, for ice covered part of grid cell 867 !!-------------------------------------------------------------------------- 868 REAL (kind=wp), DIMENSION (jpi,jpj) :: fice_ice_ave 869 REAL (kind=wp), DIMENSION (jpi,jpj,jpl), INTENT(in) :: ptab 870 871 fice_ice_ave (:,:) = 0.0_wp 872 WHERE ( at_i (:,:) .GT. 0.0_wp ) fice_ice_ave (:,:) = fice_cell_ave ( ptab (:,:,:)) / at_i (:,:) 873 874 END FUNCTION fice_ice_ave 875 858 876 859 877 #else -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90
r4792 r5038 97 97 !! 98 98 INTEGER :: ji, jj ! dummy loop indices 99 REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_ice_os ! albedo of the ice under overcast sky 100 REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_ice_cs ! albedo of ice under clear sky 101 REAL(wp), DIMENSION(:,:,:), POINTER :: zsist ! surface ice temperature (K) 99 REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_os ! ice albedo under overcast sky 100 REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_cs ! ice albedo under clear sky 101 REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_ice ! mean ice albedo 102 REAL(wp), DIMENSION(:,:,:), POINTER :: zsist ! ice surface temperature (K) 102 103 !!---------------------------------------------------------------------- 103 104 104 CALL wrk_alloc( jpi,jpj,1, zalb_ ice_os, zalb_ice_cs, zsist )105 CALL wrk_alloc( jpi,jpj,1, zalb_os, zalb_cs, zalb_ice, zsist ) 105 106 106 107 IF( kt == nit000 ) THEN … … 130 131 DO jj = 2, jpj 131 132 DO ji = 2, jpi ! NO vector opt. possible 132 u_oce(ji,jj) = 0.5_wp * ( ssu_m(ji-1,jj ) + ssu_m(ji-1,jj-1) ) * tmu(ji,jj) 133 v_oce(ji,jj) = 0.5_wp * ( ssv_m(ji ,jj-1) + ssv_m(ji-1,jj-1) ) * tmu(ji,jj) 133 u_oce(ji,jj) = 0.5_wp * ( ssu_m(ji-1,jj ) * umask(ji-1,jj ,1) & 134 & + ssu_m(ji-1,jj-1) * umask(ji-1,jj-1,1) ) * tmu(ji,jj) 135 v_oce(ji,jj) = 0.5_wp * ( ssv_m(ji ,jj-1) * vmask(ji ,jj-1,1) & 136 & + ssv_m(ji-1,jj-1) * vmask(ji-1,jj-1,1) ) * tmu(ji,jj) 134 137 END DO 135 138 END DO … … 138 141 ! 139 142 CASE( 'C' ) !== C-grid ice dynamics : U & V-points (same as ocean) 140 u_oce(:,:) = ssu_m(:,:) ! mean surface ocean current at ice velocity point141 v_oce(:,:) = ssv_m(:,:) 143 u_oce(:,:) = ssu_m(:,:) * umask(:,:,1) ! mean surface ocean current at ice velocity point 144 v_oce(:,:) = ssv_m(:,:) * vmask(:,:,1) 142 145 ! 143 146 END SELECT 144 147 145 148 ! ... masked sea surface freezing temperature [Kelvin] (set to rt0 over land) 146 tfu(:,:) = tfreez( sss_m ) + rt0149 tfu(:,:) = eos_fzp( sss_m ) + rt0 147 150 148 151 zsist (:,:,1) = sist (:,:) + rt0 * ( 1. - tmask(:,:,1) ) 149 152 150 ! ... ice albedo (clear sky and overcast sky) 153 ! Ice albedo 154 151 155 CALL albedo_ice( zsist, reshape( hicif, (/jpi,jpj,1/) ), & 152 156 reshape( hsnif, (/jpi,jpj,1/) ), & 153 zalb_ice_cs, zalb_ice_os ) 157 zalb_cs, zalb_os ) 158 159 SELECT CASE( ksbc ) 160 CASE( jp_core , jp_cpl ) ! CORE and COUPLED bulk formulations 161 162 ! albedo depends on cloud fraction because of non-linear spectral effects 163 zalb_ice(:,:,:) = ( 1. - cldf_ice ) * zalb_cs(:,:,:) + cldf_ice * zalb_os(:,:,:) 164 ! In CLIO the cloud fraction is read in the climatology and the all-sky albedo 165 ! (zalb_ice) is computed within the bulk routine 166 167 END SELECT 154 168 155 169 ! ... Sea-ice surface boundary conditions output from bulk formulae : … … 167 181 ! 168 182 SELECT CASE( ksbc ) 169 CASE( 3) ! CLIO bulk formulation170 CALL blk_ice_clio( zsist, zalb_ ice_cs, zalb_ice_os,&183 CASE( jp_clio ) ! CLIO bulk formulation 184 CALL blk_ice_clio( zsist, zalb_cs , zalb_os , zalb_ice , & 171 185 & utau_ice , vtau_ice , qns_ice , qsr_ice, & 172 186 & qla_ice , dqns_ice , dqla_ice , & … … 174 188 & fr1_i0 , fr2_i0 , cp_ice_msh , jpl ) 175 189 176 CASE( 4) ! CORE bulk formulation177 CALL blk_ice_core( zsist, u_ice , v_ice , zalb_ice _cs, &190 CASE( jp_core ) ! CORE bulk formulation 191 CALL blk_ice_core( zsist, u_ice , v_ice , zalb_ice , & 178 192 & utau_ice , vtau_ice , qns_ice , qsr_ice, & 179 193 & qla_ice , dqns_ice , dqla_ice , & 180 194 & tprecip , sprecip , & 181 195 & fr1_i0 , fr2_i0 , cp_ice_msh , jpl ) 182 IF( ltrcdm2dc_ice ) CALL blk_ice_meanqsr( zalb_ice _cs, qsr_ice_mean, jpl )183 184 CASE( 5 )! Coupled formulation : atmosphere-ice stress only (fluxes provided after ice dynamics)196 IF( ltrcdm2dc_ice ) CALL blk_ice_meanqsr( zalb_ice, qsr_ice_mean, jpl ) 197 198 CASE( jp_cpl ) ! Coupled formulation : atmosphere-ice stress only (fluxes provided after ice dynamics) 185 199 CALL sbc_cpl_ice_tau( utau_ice , vtau_ice ) 186 200 END SELECT … … 213 227 #endif 214 228 END IF 215 #if defined key_coupled216 229 ! ! Ice surface fluxes in coupled mode 217 IF( ksbc == 5) THEN230 IF( ksbc == jp_cpl ) THEN 218 231 a_i(:,:,1)=fr_i 219 232 CALL sbc_cpl_ice_flx( frld, & 220 233 ! optional arguments, used only in 'mixed oce-ice' case 221 & palbi = zalb_ice _cs, psst = sst_m, pist = zsist )234 & palbi = zalb_ice, psst = sst_m, pist = zsist ) 222 235 sprecip(:,:) = - emp_ice(:,:) ! Ugly patch, WARNING, in coupled mode, sublimation included in snow (parsub = 0.) 223 236 ENDIF 224 #endif225 237 CALL lim_thd_2 ( kt ) ! Ice thermodynamics 226 238 CALL lim_sbc_flx_2 ( kt ) ! update surface ocean mass, heat & salt fluxes … … 252 264 IF( ln_limdyn ) CALL lim_sbc_tau_2( kt, ub(:,:,1), vb(:,:,1) ) ! using before instantaneous surf. currents 253 265 ! 254 CALL wrk_dealloc( jpi,jpj,1, zalb_ ice_os, zalb_ice_cs, zsist )266 CALL wrk_dealloc( jpi,jpj,1, zalb_os, zalb_cs, zalb_ice, zsist ) 255 267 ! 256 268 END SUBROUTINE sbc_ice_lim_2 -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
r4792 r5038 37 37 USE sbcice_cice ! surface boundary condition: CICE sea-ice model 38 38 USE sbccpl ! surface boundary condition: coupled florulation 39 USE cpl_oasis3, ONLY:lk_cpl ! are we in coupled mode?40 39 USE sbcssr ! surface boundary condition: sea surface restoring 41 40 USE sbcrnf ! surface boundary condition: runoffs 41 USE sbcisf ! surface boundary condition: ice shelf 42 42 USE sbcfwb ! surface boundary condition: freshwater budget 43 43 USE closea ! closed sea … … 82 82 INTEGER :: icpt ! local integer 83 83 !! 84 NAMELIST/namsbc/ nn_fsbc , ln_ana , ln_flx, ln_blk_clio, ln_blk_core, ln_cpl,&84 NAMELIST/namsbc/ nn_fsbc , ln_ana , ln_flx, ln_blk_clio, ln_blk_core, & 85 85 & ln_blk_mfs, ln_apr_dyn, nn_ice, nn_ice_embd, ln_dm2dc , ln_rnf, & 86 & ln_ssr , nn_fwb , ln_cdgw , ln_wave , ln_sdw, nn_lsm, cn_iceflx86 & ln_ssr , nn_isf , nn_fwb , ln_cdgw , ln_wave , ln_sdw, nn_lsm, nn_limflx 87 87 INTEGER :: ios 88 88 !!---------------------------------------------------------------------- … … 123 123 WRITE(numout,*) ' CORE bulk formulation ln_blk_core = ', ln_blk_core 124 124 WRITE(numout,*) ' MFS bulk formulation ln_blk_mfs = ', ln_blk_mfs 125 WRITE(numout,*) ' coupled formulation (T if key_ sbc_cpl) ln_cpl = ', ln_cpl126 WRITE(numout,*) ' Flux handling over ice categories cn_iceflx = ', TRIM (cn_iceflx)125 WRITE(numout,*) ' coupled formulation (T if key_oasis3) lk_cpl = ', lk_cpl 126 WRITE(numout,*) ' Multicategory heat flux formulation (LIM3) nn_limflx = ', nn_limflx 127 127 WRITE(numout,*) ' Misc. options of sbc : ' 128 128 WRITE(numout,*) ' Patm gradient added in ocean & ice Eqs. ln_apr_dyn = ', ln_apr_dyn … … 131 131 WRITE(numout,*) ' daily mean to diurnal cycle qsr ln_dm2dc = ', ln_dm2dc 132 132 WRITE(numout,*) ' runoff / runoff mouths ln_rnf = ', ln_rnf 133 WRITE(numout,*) ' iceshelf formulation nn_isf = ', nn_isf 133 134 WRITE(numout,*) ' Sea Surface Restoring on SST and/or SSS ln_ssr = ', ln_ssr 134 135 WRITE(numout,*) ' FreshWater Budget control (=0/1/2) nn_fwb = ', nn_fwb … … 137 138 ENDIF 138 139 139 ! Flux handling over ice categories 140 #if defined key_coupled 141 SELECT CASE ( TRIM (cn_iceflx)) 142 CASE ('ave') 143 ln_iceflx_ave = .TRUE. 144 ln_iceflx_linear = .FALSE. 145 CASE ('linear') 146 ln_iceflx_ave = .FALSE. 147 ln_iceflx_linear = .TRUE. 148 CASE default 149 ln_iceflx_ave = .FALSE. 150 ln_iceflx_linear = .FALSE. 140 ! LIM3 Multi-category heat flux formulation 141 SELECT CASE ( nn_limflx) 142 CASE ( -1 ) 143 IF(lwp) WRITE(numout,*) ' Use of per-category fluxes (nn_limflx = -1) ' 144 CASE ( 0 ) 145 IF(lwp) WRITE(numout,*) ' Average per-category fluxes (nn_limflx = 0) ' 146 CASE ( 1 ) 147 IF(lwp) WRITE(numout,*) ' Average then redistribute per-category fluxes (nn_limflx = 1) ' 148 CASE ( 2 ) 149 IF(lwp) WRITE(numout,*) ' Redistribute a single flux over categories (nn_limflx = 2) ' 151 150 END SELECT 152 IF(lwp) WRITE(numout,*) ' Fluxes averaged over all ice categories ln_iceflx_ave = ', ln_iceflx_ave153 IF(lwp) WRITE(numout,*) ' Fluxes distributed linearly over ice categories ln_iceflx_linear = ', ln_iceflx_linear154 #endif155 151 ! 156 152 #if defined key_top && ! defined key_offline … … 180 176 rnfmsk_z(:) = 0.0_wp 181 177 ENDIF 178 IF( nn_isf .EQ. 0 ) THEN ! no specific treatment in vicinity of ice shelf 179 IF( sbc_isf_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'sbc_init : unable to allocate sbc_isf arrays' ) 180 fwfisf (:,:) = 0.0_wp 181 END IF 182 182 IF( nn_ice == 0 ) fr_i(:,:) = 0.e0 ! no ice in the domain, ice fraction is always zero 183 183 … … 186 186 187 187 fmmflx(:,:) = 0.0_wp ! freezing-melting array initialisation 188 189 taum(:,:) = 0.0_wp ! Initialise taum for use in gls in case of reduced restart 188 190 189 191 ! ! restartability … … 206 208 IF( ( nn_ice == 3 .OR. nn_ice == 4 ) .AND. nn_ice_embd == 0 ) & 207 209 & CALL ctl_stop( 'LIM3 and CICE sea-ice models require nn_ice_embd = 1 or 2' ) 208 #if defined key_coupled 209 IF( ln_iceflx_ave .AND. ln_iceflx_linear ) & 210 & CALL ctl_stop( ' ln_iceflx_ave and ln_iceflx_linear options are not compatible' ) 211 IF( ( nn_ice ==3 .AND. lk_cpl) .AND. .NOT. ( ln_iceflx_ave .OR. ln_iceflx_linear ) ) & 212 & CALL ctl_stop( ' With lim3 coupled, either ln_iceflx_ave or ln_iceflx_linear must be set to .TRUE.' ) 213 #endif 210 IF( ( nn_ice /= 3 ) .AND. ( nn_limflx >= 0 ) ) & 211 & WRITE(numout,*) 'The nn_limflx>=0 option has no effect if sea ice model is not LIM3' 212 IF( ( nn_ice == 3 ) .AND. ( lk_cpl ) .AND. ( ( nn_limflx == -1 ) .OR. ( nn_limflx == 1 ) ) ) & 213 & CALL ctl_stop( 'The chosen nn_limflx for LIM3 in coupled mode must be 0 or 2' ) 214 IF( ( nn_ice == 3 ) .AND. ( .NOT. lk_cpl ) .AND. ( nn_limflx == 2 ) ) & 215 & CALL ctl_stop( 'The chosen nn_limflx for LIM3 in forced mode cannot be 2' ) 216 214 217 IF( ln_dm2dc ) nday_qsr = -1 ! initialisation flag 215 218 … … 236 239 ! ! Choice of the Surface Boudary Condition (set nsbc) 237 240 icpt = 0 238 IF( ln_ana ) THEN ; nsbc = 1; icpt = icpt + 1 ; ENDIF ! analytical formulation239 IF( ln_flx ) THEN ; nsbc = 2; icpt = icpt + 1 ; ENDIF ! flux formulation240 IF( ln_blk_clio ) THEN ; nsbc = 3; icpt = icpt + 1 ; ENDIF ! CLIO bulk formulation241 IF( ln_blk_core ) THEN ; nsbc = 4; icpt = icpt + 1 ; ENDIF ! CORE bulk formulation242 IF( ln_blk_mfs ) THEN ; nsbc = 6; icpt = icpt + 1 ; ENDIF ! MFS bulk formulation243 IF( l n_cpl ) THEN ; nsbc = 5; icpt = icpt + 1 ; ENDIF ! Coupled formulation244 IF( cp_cfg == 'gyre') THEN ; nsbc = 0; ENDIF ! GYRE analytical formulation245 IF( lk_esopa ) nsbc = -1! esopa test, ALL formulations241 IF( ln_ana ) THEN ; nsbc = jp_ana ; icpt = icpt + 1 ; ENDIF ! analytical formulation 242 IF( ln_flx ) THEN ; nsbc = jp_flx ; icpt = icpt + 1 ; ENDIF ! flux formulation 243 IF( ln_blk_clio ) THEN ; nsbc = jp_clio ; icpt = icpt + 1 ; ENDIF ! CLIO bulk formulation 244 IF( ln_blk_core ) THEN ; nsbc = jp_core ; icpt = icpt + 1 ; ENDIF ! CORE bulk formulation 245 IF( ln_blk_mfs ) THEN ; nsbc = jp_mfs ; icpt = icpt + 1 ; ENDIF ! MFS bulk formulation 246 IF( lk_cpl ) THEN ; nsbc = jp_cpl ; icpt = icpt + 1 ; ENDIF ! Coupled formulation 247 IF( cp_cfg == 'gyre') THEN ; nsbc = jp_gyre ; ENDIF ! GYRE analytical formulation 248 IF( lk_esopa ) nsbc = jp_esopa ! esopa test, ALL formulations 246 249 ! 247 250 IF( icpt /= 1 .AND. .NOT.lk_esopa ) THEN … … 254 257 IF(lwp) THEN 255 258 WRITE(numout,*) 256 IF( nsbc == -1 ) WRITE(numout,*) ' ESOPA test All surface boundary conditions' 257 IF( nsbc == 0 ) WRITE(numout,*) ' GYRE analytical formulation' 258 IF( nsbc == 1 ) WRITE(numout,*) ' analytical formulation' 259 IF( nsbc == 2 ) WRITE(numout,*) ' flux formulation' 260 IF( nsbc == 3 ) WRITE(numout,*) ' CLIO bulk formulation' 261 IF( nsbc == 4 ) WRITE(numout,*) ' CORE bulk formulation' 262 IF( nsbc == 5 ) WRITE(numout,*) ' coupled formulation' 263 IF( nsbc == 6 ) WRITE(numout,*) ' MFS Bulk formulation' 264 ENDIF 265 ! 266 CALL sbc_ssm_init ! Sea-surface mean fields initialisation 267 ! 268 IF( ln_ssr ) CALL sbc_ssr_init ! Sea-Surface Restoring initialisation 269 ! 270 IF( nn_ice == 4 ) CALL cice_sbc_init( nsbc ) ! CICE initialisation 271 ! 259 IF( nsbc == jp_esopa ) WRITE(numout,*) ' ESOPA test All surface boundary conditions' 260 IF( nsbc == jp_gyre ) WRITE(numout,*) ' GYRE analytical formulation' 261 IF( nsbc == jp_ana ) WRITE(numout,*) ' analytical formulation' 262 IF( nsbc == jp_flx ) WRITE(numout,*) ' flux formulation' 263 IF( nsbc == jp_clio ) WRITE(numout,*) ' CLIO bulk formulation' 264 IF( nsbc == jp_core ) WRITE(numout,*) ' CORE bulk formulation' 265 IF( nsbc == jp_cpl ) WRITE(numout,*) ' coupled formulation' 266 IF( nsbc == jp_mfs ) WRITE(numout,*) ' MFS Bulk formulation' 267 ENDIF 268 ! 269 CALL sbc_ssm_init ! Sea-surface mean fields initialisation 270 ! 271 IF( ln_ssr ) CALL sbc_ssr_init ! Sea-Surface Restoring initialisation 272 ! 273 IF( nn_ice == 4 ) CALL cice_sbc_init( nsbc ) ! CICE initialisation 274 ! 275 IF( nsbc == jp_cpl ) CALL sbc_cpl_init (nn_ice) ! OASIS initialisation. must be done before first time step 276 272 277 END SUBROUTINE sbc_init 273 278 … … 320 325 SELECT CASE( nsbc ) ! Compute ocean surface boundary condition 321 326 ! ! (i.e. utau,vtau, qns, qsr, emp, sfx) 322 CASE( 0) ; CALL sbc_gyre ( kt ) ! analytical formulation : GYRE configuration323 CASE( 1) ; CALL sbc_ana ( kt ) ! analytical formulation : uniform sbc324 CASE( 2) ; CALL sbc_flx ( kt ) ! flux formulation325 CASE( 3) ; CALL sbc_blk_clio( kt ) ! bulk formulation : CLIO for the ocean326 CASE( 4) ; CALL sbc_blk_core( kt ) ! bulk formulation : CORE for the ocean327 CASE( 5) ; CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice ) ! coupled formulation328 CASE( 6) ; CALL sbc_blk_mfs ( kt ) ! bulk formulation : MFS for the ocean329 CASE( -1)330 CALL sbc_ana ( kt ) ! ESOPA, test ALL the formulations331 CALL sbc_gyre ( kt ) !332 CALL sbc_flx ( kt ) !333 CALL sbc_blk_clio( kt ) !334 CALL sbc_blk_core( kt ) !335 CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice ) !327 CASE( jp_gyre ) ; CALL sbc_gyre ( kt ) ! analytical formulation : GYRE configuration 328 CASE( jp_ana ) ; CALL sbc_ana ( kt ) ! analytical formulation : uniform sbc 329 CASE( jp_flx ) ; CALL sbc_flx ( kt ) ! flux formulation 330 CASE( jp_clio ) ; CALL sbc_blk_clio( kt ) ! bulk formulation : CLIO for the ocean 331 CASE( jp_core ) ; CALL sbc_blk_core( kt ) ! bulk formulation : CORE for the ocean 332 CASE( jp_cpl ) ; CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice ) ! coupled formulation 333 CASE( jp_mfs ) ; CALL sbc_blk_mfs ( kt ) ! bulk formulation : MFS for the ocean 334 CASE( jp_esopa ) 335 CALL sbc_ana ( kt ) ! ESOPA, test ALL the formulations 336 CALL sbc_gyre ( kt ) ! 337 CALL sbc_flx ( kt ) ! 338 CALL sbc_blk_clio( kt ) ! 339 CALL sbc_blk_core( kt ) ! 340 CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice ) ! 336 341 END SELECT 337 342 … … 342 347 CASE( 2 ) ; CALL sbc_ice_lim_2( kt, nsbc ) ! LIM-2 ice model 343 348 CASE( 3 ) ; CALL sbc_ice_lim ( kt, nsbc ) ! LIM-3 ice model 344 !is it useful?345 349 CASE( 4 ) ; CALL sbc_ice_cice ( kt, nsbc ) ! CICE ice model 346 350 END SELECT 347 351 348 352 IF( ln_icebergs ) CALL icb_stp( kt ) ! compute icebergs 353 354 IF( nn_isf /= 0 ) CALL sbc_isf( kt ) ! compute iceshelves 349 355 350 356 IF( ln_rnf ) CALL sbc_rnf( kt ) ! add runoffs to fresh water fluxes … … 414 420 CALL iom_put( "qsr" , qsr ) ! solar heat flux 415 421 IF( nn_ice > 0 ) CALL iom_put( "ice_cover", fr_i ) ! ice fraction 422 CALL iom_put( "taum" , taum ) ! wind stress module 423 CALL iom_put( "wspd" , wndm ) ! wind speed module over free ocean or leads in presence of sea-ice 416 424 ENDIF 417 425 ! 418 426 CALL iom_put( "utau", utau ) ! i-wind stress (stress can be updated at 419 427 CALL iom_put( "vtau", vtau ) ! j-wind stress each time step in sea-ice) 420 CALL iom_put( "taum", taum ) ! wind stress module421 CALL iom_put( "wspd", wndm ) ! wind speed module422 428 ! 423 429 IF(ln_ctl) THEN ! print mean trends (used for debugging) 424 CALL prt_ctl(tab2d_1=fr_i , clinfo1=' fr_i - : ', mask1=tmask, ovlap=1 )425 CALL prt_ctl(tab2d_1=(emp-rnf ), clinfo1=' emp-rnf - : ', mask1=tmask, ovlap=1 )426 CALL prt_ctl(tab2d_1=(sfx-rnf ), clinfo1=' sfx-rnf - : ', mask1=tmask, ovlap=1 )430 CALL prt_ctl(tab2d_1=fr_i , clinfo1=' fr_i - : ', mask1=tmask, ovlap=1 ) 431 CALL prt_ctl(tab2d_1=(emp-rnf + fwfisf), clinfo1=' emp-rnf - : ', mask1=tmask, ovlap=1 ) 432 CALL prt_ctl(tab2d_1=(sfx-rnf + fwfisf), clinfo1=' sfx-rnf - : ', mask1=tmask, ovlap=1 ) 427 433 CALL prt_ctl(tab2d_1=qns , clinfo1=' qns - : ', mask1=tmask, ovlap=1 ) 428 434 CALL prt_ctl(tab2d_1=qsr , clinfo1=' qsr - : ', mask1=tmask, ovlap=1 ) -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
r4792 r5038 19 19 USE phycst ! physical constants 20 20 USE sbc_oce ! surface boundary condition variables 21 USE sbcisf ! PM we could remove it I think 21 22 USE closea ! closed seas 22 23 USE fldread ! read input field at current time step … … 24 25 USE iom ! I/O module 25 26 USE lib_mpp ! MPP library 27 USE eosbn2 28 USE wrk_nemo ! Memory allocation 26 29 27 30 IMPLICIT NONE … … 98 101 INTEGER :: z_err = 0 ! dummy integer for error handling 99 102 !!---------------------------------------------------------------------- 103 REAL(wp), DIMENSION(:,:), POINTER :: ztfrz ! freezing point used for temperature correction 104 ! 105 CALL wrk_alloc( jpi,jpj, ztfrz) 106 100 107 ! 101 108 IF( kt == nit000 ) CALL sbc_rnf_init ! Read namelist and allocate structures … … 134 141 WHERE( sf_t_rnf(1)%fnow(:,:,1) == -999._wp ) ! if missing data value use SST as runoffs temperature 135 142 rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 143 END WHERE 144 WHERE( sf_t_rnf(1)%fnow(:,:,1) == -222._wp ) ! where fwf comes from melting of ice shelves or iceberg 145 ztfrz(:,:) = -1.9 !tfreez( sss_m(:,:) ) !PM to be discuss (trouble if sensitivity study) 146 rnf_tsc(:,:,jp_tem) = ztfrz(:,:) * rnf(:,:) * r1_rau0 - rnf(:,:) * lfusisf * r1_rau0_rcp 136 147 END WHERE 137 148 ELSE ! use SST as runoffs temperature … … 175 186 CALL iom_rstput( kt, nitrst, numrow, 'rnf_sc_b', rnf_tsc(:,:,jp_sal) ) 176 187 ENDIF 188 CALL wrk_dealloc( jpi,jpj, ztfrz) 177 189 ! 178 190 END SUBROUTINE sbc_rnf -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90
r4292 r5038 14 14 USE oce ! ocean dynamics and tracers 15 15 USE dom_oce ! ocean space and time domain 16 USE sbc_oce ! Surface boundary condition: ocean fields17 16 USE sbc_oce ! surface boundary condition: ocean fields 18 17 USE sbcapr ! surface boundary condition: atmospheric pressure 19 USE prtctl ! Print control (prt_ctl routine)20 USE iom18 USE eosbn2 ! equation of state and related derivatives 19 ! 21 20 USE in_out_manager ! I/O manager 21 USE prtctl ! Print control 22 USE iom ! IOM library 22 23 23 24 IMPLICIT NONE … … 54 55 INTEGER, INTENT(in) :: kt ! ocean time step 55 56 ! 57 INTEGER :: ji, jj ! loop index 56 58 REAL(wp) :: zcoef, zf_sbc ! local scalar 59 REAL(wp), DIMENSION(jpi,jpj,jpts) :: zts 60 REAL(wp), DIMENSION(jpi,jpj) :: zub, zvb,zdep 57 61 !!--------------------------------------------------------------------- 62 63 ! !* first wet T-, U-, V- ocean level (ISF) variables (T, S, depth, velocity) 64 DO jj = 1, jpj 65 DO ji = 1, jpi 66 zub(ji,jj) = ub (ji,jj,miku(ji,jj)) 67 zvb(ji,jj) = vb (ji,jj,mikv(ji,jj)) 68 zts(ji,jj,jp_tem) = tsn(ji,jj,mikt(ji,jj),jp_tem) 69 zts(ji,jj,jp_sal) = tsn(ji,jj,mikt(ji,jj),jp_sal) 70 END DO 71 END DO 72 ! 73 IF( lk_vvl ) THEN 74 DO jj = 1, jpj 75 DO ji = 1, jpi 76 zdep(ji,jj) = fse3t_n(ji,jj,mikt(ji,jj)) 77 END DO 78 END DO 79 ENDIF 58 80 ! ! ---------------------------------------- ! 59 81 IF( nn_fsbc == 1 ) THEN ! Instantaneous surface fields ! 60 82 ! ! ---------------------------------------- ! 61 ssu_m(:,:) = ub(:,:,1) 62 ssv_m(:,:) = vb(:,:,1) 63 sst_m(:,:) = tsn(:,:,1,jp_tem) 64 sss_m(:,:) = tsn(:,:,1,jp_sal) 83 ssu_m(:,:) = zub(:,:) 84 ssv_m(:,:) = zvb(:,:) 85 IF( ln_useCT ) THEN ; sst_m(:,:) = eos_pt_from_ct( zts(:,:,jp_tem), zts(:,:,jp_sal) ) 86 ELSE ; sst_m(:,:) = zts(:,:,jp_tem) 87 ENDIF 88 sss_m(:,:) = zts(:,:,jp_sal) 65 89 ! ! removed inverse barometer ssh when Patm forcing is used (for sea-ice dynamics) 66 90 IF( ln_apr_dyn ) THEN ; ssh_m(:,:) = sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) … … 68 92 ENDIF 69 93 ! 70 IF( lk_vvl ) fse3t_m(:,:) = fse3t_n(:,:,1)94 IF( lk_vvl ) fse3t_m(:,:) = zdep(:,:) 71 95 ! 72 96 ELSE … … 77 101 IF(lwp) WRITE(numout,*) '~~~~~~~ mean fields initialised to instantaneous values' 78 102 zcoef = REAL( nn_fsbc - 1, wp ) 79 ssu_m(:,:) = zcoef * ub(:,:,1) 80 ssv_m(:,:) = zcoef * vb(:,:,1) 81 sst_m(:,:) = zcoef * tsn(:,:,1,jp_tem) 82 sss_m(:,:) = zcoef * tsn(:,:,1,jp_sal) 83 ! ! removed inverse barometer ssh when Patm forcing is used 103 ssu_m(:,:) = zcoef * zub(:,:) 104 ssv_m(:,:) = zcoef * zvb(:,:) 105 IF( ln_useCT ) THEN ; sst_m(:,:) = zcoef * eos_pt_from_ct( zts(:,:,jp_tem), zts(:,:,jp_sal) ) 106 ELSE ; sst_m(:,:) = zcoef * zts(:,:,jp_tem) 107 ENDIF 108 sss_m(:,:) = zcoef * zts(:,:,jp_sal) 109 ! ! removed inverse barometer ssh when Patm forcing is used (for sea-ice dynamics) 84 110 IF( ln_apr_dyn ) THEN ; ssh_m(:,:) = zcoef * ( sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) ) 85 ELSE ; ssh_m(:,:) = zcoef * 111 ELSE ; ssh_m(:,:) = zcoef * sshn(:,:) 86 112 ENDIF 87 IF( lk_vvl ) fse3t_m(:,:) = zcoef * fse3t_n(:,:,1) 113 ! 114 IF( lk_vvl ) fse3t_m(:,:) = zcoef * zdep(:,:) 88 115 ! ! ---------------------------------------- ! 89 116 ELSEIF( MOD( kt - 2 , nn_fsbc ) == 0 ) THEN ! Initialisation: New mean computation ! … … 99 126 ! ! Cumulate at each time step ! 100 127 ! ! ---------------------------------------- ! 101 ssu_m(:,:) = ssu_m(:,:) + ub(:,:,1) 102 ssv_m(:,:) = ssv_m(:,:) + vb(:,:,1) 103 sst_m(:,:) = sst_m(:,:) + tsn(:,:,1,jp_tem) 104 sss_m(:,:) = sss_m(:,:) + tsn(:,:,1,jp_sal) 128 ssu_m(:,:) = ssu_m(:,:) + zub(:,:) 129 ssv_m(:,:) = ssv_m(:,:) + zvb(:,:) 130 IF( ln_useCT ) THEN ; sst_m(:,:) = sst_m(:,:) + eos_pt_from_ct( zts(:,:,jp_tem), zts(:,:,jp_sal) ) 131 ELSE ; sst_m(:,:) = sst_m(:,:) + zts(:,:,jp_tem) 132 ENDIF 133 sss_m(:,:) = sss_m(:,:) + zts(:,:,jp_sal) 105 134 ! ! removed inverse barometer ssh when Patm forcing is used (for sea-ice dynamics) 106 IF( ln_apr_dyn ) THEN ; ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) - 0.5 * 135 IF( ln_apr_dyn ) THEN ; ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) - 0.5 * ( ssh_ib(:,:) + ssh_ibb(:,:) ) 107 136 ELSE ; ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) 108 137 ENDIF 109 IF( lk_vvl ) fse3t_m(:,:) = fse3t_m(:,:) + fse3t_n(:,:,1) 138 ! 139 IF( lk_vvl ) fse3t_m(:,:) = fse3t_m(:,:) + zdep(:,:) 110 140 111 141 ! ! ---------------------------------------- ! -
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90
r4792 r5038 10 10 !!---------------------------------------------------------------------- 11 11 !! sbc_ssr : add to sbc a restoring term toward SST/SSS climatology 12 !! sbc_ssr_init : initialisation of surface restoring 12 13 !!---------------------------------------------------------------------- 13 14 USE oce ! ocean dynamics and tracers … … 16 17 USE phycst ! physical constants 17 18 USE sbcrnf ! surface boundary condition : runoffs 19 ! 18 20 USE fldread ! read input fields 19 21 USE iom ! I/O manager … … 93 95 ! 94 96 IF( nn_sstr == 1 ) THEN !* Temperature restoring term 95 !CDIR COLLAPSE96 97 DO jj = 1, jpj 97 98 DO ji = 1, jpi
Note: See TracChangeset
for help on using the changeset viewer.