New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 14200 for NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/DYN/sshwzv.F90 – NEMO

Ignore:
Timestamp:
2020-12-17T15:36:44+01:00 (4 years ago)
Author:
mcastril
Message:

Merging r14117 through r14199 into dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/DYN/sshwzv.F90

    r14053 r14200  
    1818   !!   ssh_atf       : time filter the ssh arrays 
    1919   !!   wzv           : compute now vertical velocity 
    20    !!   ssh_init_rst  : ssh set from restart or domcfg.nc file or usr_def_istat_ssh 
    2120   !!---------------------------------------------------------------------- 
    2221   USE oce            ! ocean dynamics and tracers variables 
     
    2928   USE bdy_oce , ONLY : ln_bdy, bdytmask   ! Open BounDarY 
    3029   USE bdydyn2d       ! bdy_ssh routine 
     30   USE wet_dry        ! Wetting/Drying flux limiting 
    3131#if defined key_agrif 
    3232   USE agrif_oce 
     
    4141   USE lib_mpp        ! MPP library 
    4242   USE timing         ! Timing 
    43    USE wet_dry        ! Wetting/Drying flux limiting 
    44    USE usrdef_istate, ONLY : usr_def_istate_ssh   ! user defined ssh initial state  
    4543    
    4644   IMPLICIT NONE 
     
    5149   PUBLIC   wAimp          ! called by step.F90 
    5250   PUBLIC   ssh_atf        ! called by step.F90 
    53    PUBLIC   ssh_init_rst   ! called by domain.F90 
    5451 
    5552   !! * Substitutions 
     
    436433      ! 
    437434   END SUBROUTINE wAimp 
    438  
    439  
    440    SUBROUTINE ssh_init_rst( Kbb, Kmm, Kaa ) 
    441       !!--------------------------------------------------------------------- 
    442       !!                   ***  ROUTINE ssh_init_rst  *** 
    443       !! 
    444       !! ** Purpose :   ssh initialization of the sea surface height (ssh) 
    445       !! 
    446       !! ** Method  :   set ssh from restart or read configuration, or user_def 
    447       !!              * ln_rstart = T 
    448       !!                   USE of IOM library to read ssh in the restart file 
    449       !!                   Leap-Frog: Kbb and Kmm are read except for l_1st_euler=T 
    450       !! 
    451       !!              * otherwise  
    452       !!                   call user defined ssh or 
    453       !!                   set to -ssh_ref in wet and drying case with domcfg.nc 
    454       !! 
    455       !!              NB: ssh_b/n are written by restart.F90 
    456       !!---------------------------------------------------------------------- 
    457       INTEGER, INTENT(in) ::   Kbb, Kmm, Kaa   ! ocean time level indices 
    458       ! 
    459       INTEGER ::   ji, jj, jk 
    460       !!---------------------------------------------------------------------- 
    461       ! 
    462       IF(lwp) THEN 
    463          WRITE(numout,*) 
    464          WRITE(numout,*) 'ssh_init_rst : ssh initialization' 
    465          WRITE(numout,*) '~~~~~~~~~~~~ ' 
    466       ENDIF 
    467       ! 
    468       !                            !=============================! 
    469       IF( ln_rstart ) THEN         !==  Read the restart file  ==! 
    470          !                         !=============================! 
    471          ! 
    472          !                                     !*  Read ssh at Kmm 
    473          IF(lwp) WRITE(numout,*) 
    474          IF(lwp) WRITE(numout,*)    '      Kmm sea surface height read in the restart file' 
    475          CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm) ) 
    476          ! 
    477          IF( l_1st_euler ) THEN                !* Euler at first time-step 
    478             IF(lwp) WRITE(numout,*) 
    479             IF(lwp) WRITE(numout,*) '      Euler first time step : ssh(Kbb) = ssh(Kmm)' 
    480             ssh(:,:,Kbb) = ssh(:,:,Kmm) 
    481             ! 
    482          ELSE                                  !* read ssh at Kbb 
    483             IF(lwp) WRITE(numout,*) 
    484             IF(lwp) WRITE(numout,*) '      Kbb sea surface height read in the restart file' 
    485             CALL iom_get( numror, jpdom_auto, 'sshb', ssh(:,:,Kbb) ) 
    486          ENDIF 
    487          !                         !============================! 
    488       ELSE                         !==  Initialize at "rest"  ==! 
    489          !                         !============================! 
    490          ! 
    491          IF(lwp) WRITE(numout,*) 
    492          IF(lwp) WRITE(numout,*)    '      initialization at rest' 
    493          ! 
    494          IF( ll_wd ) THEN                      !* wet and dry  
    495             ! 
    496             IF( ln_read_cfg  ) THEN                 ! read configuration : ssh_ref is read in domain_cfg file 
    497 !!st  why ssh is not masked : i.e. ssh(:,:,Kmm) = -ssh_ref*ssmask(:,:), 
    498 !!st  since at the 1st time step lbclnk will be applied on ssh at Kaa but not initially at Kbb and Kmm 
    499                ssh(:,:,Kbb) = -ssh_ref 
    500                ! 
    501                DO_2D( 1, 1, 1, 1 ) 
    502                   IF( ht_0(ji,jj)-ssh_ref <  rn_wdmin1 ) THEN   ! if total depth is less than min depth 
    503                      ssh(ji,jj,Kbb) = rn_wdmin1 - ht_0(ji,jj) 
    504                   ENDIF 
    505                END_2D 
    506             ELSE                                    ! user define configuration case   
    507                CALL usr_def_istate_ssh( tmask, ssh(:,:,Kbb) ) 
    508             ENDIF 
    509             ! 
    510          ELSE                                  !* user defined configuration 
    511             CALL usr_def_istate_ssh( tmask, ssh(:,:,Kbb) ) 
    512             ! 
    513          ENDIF 
    514          ! 
    515          ssh(:,:,Kmm) = ssh(:,:,Kbb)           !* set now values from to before ones 
    516          ssh(:,:,Kaa) = 0._wp  
    517       ENDIF 
    518       ! 
    519    END SUBROUTINE ssh_init_rst 
    520435       
    521436   !!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.