Changeset 14072 for NEMO/trunk/src/OCE/ISF/isfcpl.F90
- Timestamp:
- 2020-12-04T08:48:38+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/src/OCE/ISF/isfcpl.F90
r14053 r14072 30 30 PRIVATE 31 31 32 PUBLIC isfcpl_rst_write, isfcpl_init ! iceshelf restart read and write 33 PUBLIC isfcpl_ssh, isfcpl_tra, isfcpl_vol, isfcpl_cons ! iceshelf correction for ssh, tra, dyn and conservation 32 PUBLIC isfcpl_rst_write, isfcpl_init ! iceshelf restart read and write 33 PUBLIC isfcpl_ssh, isfcpl_tra, isfcpl_vol, isfcpl_cons ! iceshelf correction for ssh, tra, dyn and conservation 34 34 35 35 TYPE isfcons … … 57 57 !!--------------------------------------------------------------------- 58 58 !! *** ROUTINE iscpl_init *** 59 !! 60 !! ** Purpose : correct ocean state for new wet cell and horizontal divergence 59 !! 60 !! ** Purpose : correct ocean state for new wet cell and horizontal divergence 61 61 !! correction for the dynamical adjustement 62 62 !! … … 74 74 ! start on an euler time step 75 75 l_1st_euler = .TRUE. 76 ! 76 ! 77 77 ! allocation and initialisation to 0 78 78 CALL isf_alloc_cpl() … … 88 88 IF(lwp) WRITE(numout,*) ' isfcpl_init:', id 89 89 IF (id == 0) THEN 90 IF(lwp) WRITE(numout,*) ' isfcpl_init: restart variables for ice sheet coupling are missing, skip coupling for this leg ' 90 IF(lwp) WRITE(numout,*) ' isfcpl_init: restart variables for ice sheet coupling are missing, skip coupling for this leg ' 91 91 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' 92 92 IF(lwp) WRITE(numout,*) '' … … 119 119 #if ! defined key_qco 120 120 e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 121 #endif 121 #endif 122 122 END SUBROUTINE isfcpl_init 123 123 124 124 125 125 SUBROUTINE isfcpl_rst_write( kt, Kmm ) 126 126 !!--------------------------------------------------------------------- 127 127 !! *** ROUTINE iscpl_rst_write *** 128 !! 128 !! 129 129 !! ** Purpose : write icesheet coupling variables in restart 130 130 !! … … 143 143 ! 144 144 zgdepw(:,:,jk) = gdepw(:,:,jk,Kmm) 145 END DO 145 END DO 146 146 ! 147 147 CALL iom_rstput( kt, nitrst, numrow, 'tmask' , tmask ) … … 154 154 END SUBROUTINE isfcpl_rst_write 155 155 156 156 157 157 SUBROUTINE isfcpl_ssh(Kbb, Kmm, Kaa) 158 !!---------------------------------------------------------------------- 158 !!---------------------------------------------------------------------- 159 159 !! *** ROUTINE iscpl_ssh *** 160 !! 160 !! 161 161 !! ** Purpose : basic guess of ssh in new wet cell 162 !! 162 !! 163 163 !! ** Method : basic extrapolation from neigbourg cells 164 164 !! … … 176 176 CALL iom_get( numror, jpdom_auto, 'ssmask' , zssmask_b ) ! need to extrapolate T/S 177 177 178 ! compute new ssh if we open a full water column 178 ! compute new ssh if we open a full water column 179 179 ! rude average of the closest neigbourgs (e1e2t not taking into account) 180 180 ! … … 229 229 END SUBROUTINE isfcpl_ssh 230 230 231 231 232 232 SUBROUTINE isfcpl_tra(Kmm) 233 !!---------------------------------------------------------------------- 233 !!---------------------------------------------------------------------- 234 234 !! *** ROUTINE iscpl_tra *** 235 !! 236 !! ** Purpose : compute new tn, sn in case of evolving geometry of ice shelves 237 !! 235 !! 236 !! ** Purpose : compute new tn, sn in case of evolving geometry of ice shelves 237 !! 238 238 !! ** Method : tn, sn : basic extrapolation from neigbourg cells 239 239 !! … … 250 250 REAL(wp):: zdz, zdzm1, zdzp1 251 251 !! 252 REAL(wp), DIMENSION(jpi,jpj) :: zdmask 252 REAL(wp), DIMENSION(jpi,jpj) :: zdmask 253 253 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztmask0, zwmaskn 254 254 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztmask1, zwmaskb, ztmp3d 255 255 REAL(wp), DIMENSION(jpi,jpj,jpk,jpts) :: zts0 256 256 !!---------------------------------------------------------------------- 257 ! 257 ! 258 258 CALL iom_get( numror, jpdom_auto, 'tmask' , ztmask_b ) ! need to extrapolate T/S 259 259 !CALL iom_get( numror, jpdom_auto, 'wmask' , zwmask_b ) ! need to extrapolate T/S 260 260 !CALL iom_get( numror, jpdom_auto, 'gdepw_n', zdepw_b(:,:,:) ) ! need to interpol vertical profile (vvl) 261 261 ! 262 ! 262 ! 263 263 ! compute new T/S (interpolation) if vvl only for common wet cell in before and after wmask 264 264 !PM: Is this IF needed since change to VVL by default … … 376 376 & in your domain cfg computation' ) 377 377 END_3D 378 ! 378 ! 379 379 END SUBROUTINE isfcpl_tra 380 380 381 381 382 382 SUBROUTINE isfcpl_vol(Kmm) 383 !!---------------------------------------------------------------------- 383 !!---------------------------------------------------------------------- 384 384 !! *** ROUTINE iscpl_vol *** 385 !! 386 !! ** Purpose : compute the correction of the local divergence to apply 385 !! 386 !! ** Purpose : compute the correction of the local divergence to apply 387 387 !! during the first time step after the coupling. 388 388 !! … … 390 390 !! - compute vertical input 391 391 !! - compute correction 392 !! 392 !! 393 393 !!---------------------------------------------------------------------- 394 394 !! 395 395 INTEGER, INTENT(in) :: Kmm ! ocean time level index 396 396 !!---------------------------------------------------------------------- 397 INTEGER :: ji, jj, jk 397 INTEGER :: ji, jj, jk 398 398 INTEGER :: ikb, ikt 399 399 !! … … 421 421 ! 422 422 ! 1.2: get volume flux after coupling (>0 out) 423 ! properly mask velocity 423 ! properly mask velocity 424 424 ! (velocity are still mask with old mask at this stage) 425 425 uu(:,:,jk,Kmm) = uu(:,:,jk,Kmm) * umask(:,:,jk) … … 459 459 ! 460 460 ! 3.2: get 3d tr(:,:,:,:,Krhs) increment to apply at the first time step 461 ! temperature and salt content flux computed using local ts(:,:,:,:,Kmm) 461 ! temperature and salt content flux computed using local ts(:,:,:,:,Kmm) 462 462 ! (very simple advection scheme) 463 463 ! (>0 out) … … 473 473 END SUBROUTINE isfcpl_vol 474 474 475 475 476 476 SUBROUTINE isfcpl_cons(Kmm) 477 !!---------------------------------------------------------------------- 477 !!---------------------------------------------------------------------- 478 478 !! *** ROUTINE iscpl_cons *** 479 !! 479 !! 480 480 !! ** Purpose : compute the corrective increment in volume/salt/heat to put back the vol/heat/salt 481 481 !! removed or added during the coupling processes (wet or dry new cell) 482 !! 482 !! 483 483 !! ** Method : - compare volume/heat/salt before and after 484 484 !! - look for the closest wet cells (share amoung neigbourgs if there are) 485 485 !! - build the correction increment to applied at each time step 486 !! 486 !! 487 487 !!---------------------------------------------------------------------- 488 488 ! … … 496 496 INTEGER :: iig , ijg, ik ! dummy indices 497 497 INTEGER :: jisf ! start, end and current position in the increment array 498 INTEGER :: ingb, ifind ! 0/1 target found or need to be found 499 INTEGER :: nisfl_area ! global number of cell concerned by the wet->dry case 498 INTEGER :: ingb, ifind ! 0/1 target found or need to be found 499 INTEGER :: nisfl_area ! global number of cell concerned by the wet->dry case 500 500 INTEGER, DIMENSION(jpnij) :: nisfl ! local number of cell concerned by the wet->dry case 501 501 ! 502 502 REAL(wp) :: z1_sum, z1_rdtiscpl 503 503 REAL(wp) :: zdtem, zdsal, zdvol, zratio ! tem, sal, vol increment 504 REAL(wp) :: zlon , zlat ! target location 504 REAL(wp) :: zlon , zlat ! target location 505 505 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztmask_b ! mask before 506 506 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ze3t_b ! scale factor before … … 522 522 nstp_iscpl = nitend - nit000 + 1 523 523 rdt_iscpl = nstp_iscpl * rn_Dt 524 z1_rdtiscpl = 1._wp / rdt_iscpl 524 z1_rdtiscpl = 1._wp / rdt_iscpl 525 525 526 526 IF (lwp) WRITE(numout,*) ' nb of stp for cons = ', nstp_iscpl … … 552 552 zdsal = ts(ji,jj,jk,jp_sal,Kmm) * e3t(ji,jj,jk,Kmm) * tmask (ji,jj,jk) & 553 553 - zs_b(ji,jj,jk) * ze3t_b(ji,jj,jk) * ztmask_b(ji,jj,jk) 554 554 555 555 ! volume, heat and salt differences in each cell (>0 means correction is an outward flux) 556 556 ! in addition to the geometry change unconservation, need to add the divergence correction as it is flux across the boundary … … 575 575 DO ji = Nis0,Nie0 576 576 jip1=MIN(ji+1,jpi) ; jim1=MAX(ji-1,1) ; jjp1=MIN(jj+1,jpj) ; jjm1=MAX(jj-1,1) ; 577 IF ( tmask(ji,jj,jk) == 0._wp .AND. ztmask_b(ji,jj,jk) == 1._wp ) THEN 577 IF ( tmask(ji,jj,jk) == 0._wp .AND. ztmask_b(ji,jj,jk) == 1._wp ) THEN 578 578 nisfl(narea) = nisfl(narea) + MAX(SUM(tmask(jim1:jip1,jjm1:jjp1,jk)),1._wp) 579 579 ENDIF … … 582 582 ENDDO 583 583 ! 584 ! global 584 ! global 585 585 CALL mpp_sum('isfcpl',nisfl ) 586 586 ! … … 636 636 ! share data among all processes because for some point we need to find the closest wet point (could be on other process) 637 637 DO jproc=1,jpnij 638 ! 638 ! 639 639 ! share total number of isf point treated for proc jproc 640 640 IF (jproc==narea) THEN … … 660 660 ingb = zisfpts(jisf)%ngb 661 661 ELSE 662 iig =0 ; ijg =0 ; ik =0 662 iig =0 ; ijg =0 ; ik =0 663 663 zdvol=-HUGE(1.0) ; zdsal=-HUGE(1.0) ; zdtem=-HUGE(1.0) 664 zlat =-HUGE(1.0) ; zlon =-HUGE(1.0) 664 zlat =-HUGE(1.0) ; zlon =-HUGE(1.0) 665 665 ingb = 0 666 666 END IF … … 711 711 INTEGER, INTENT(inout) :: kpts 712 712 !!---------------------------------------------------------------------- 713 INTEGER, INTENT(in ) :: ki, kj, kk ! target location (kfind=0) 713 INTEGER, INTENT(in ) :: ki, kj, kk ! target location (kfind=0) 714 714 ! ! or source location (kfind=1) 715 715 INTEGER, INTENT(in ), OPTIONAL :: kfind ! 0 target cell already found 716 716 ! ! 1 target to be determined 717 REAL(wp), INTENT(in ) :: pdvol, pdsal, pdtem, pratio ! vol/sal/tem increment 717 REAL(wp), INTENT(in ) :: pdvol, pdsal, pdtem, pratio ! vol/sal/tem increment 718 718 ! ! and ratio in case increment span over multiple cells. 719 719 !!---------------------------------------------------------------------- 720 720 INTEGER :: ifind 721 721 !!---------------------------------------------------------------------- 722 ! 722 ! 723 723 ! increment position 724 724 kpts = kpts + 1
Note: See TracChangeset
for help on using the changeset viewer.