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 13761 for NEMO/branches – NEMO

Changeset 13761 for NEMO/branches


Ignore:
Timestamp:
2020-11-09T18:49:23+01:00 (3 years ago)
Author:
techene
Message:

#2385 set ssh separately from istate variables to remove domqco.F90 duplicates

Location:
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DOM/domqco.F90

    r13734 r13761  
    303303!           CALL usr_def_istate( gdept_0, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  ) 
    304304!           ! 
    305             ssh(:,:,:) = 0._wp 
     305!!st            ssh(:,:,:) = 0._wp 
     306            CALL usr_def_ssh( tmask, ssh(:,:,Kbb) ) 
     307            ! 
     308            ssh(:,:,Kmm) = ssh(:,:,Kbb) 
    306309            ! 
    307310         ENDIF           ! end of ll_wd edits 
     
    310313      ! 
    311314   END SUBROUTINE qco_rst_read 
    312  
    313     
    314    SUBROUTINE qco_rst_read2( kt, Kbb, Kmm ) 
    315       !!--------------------------------------------------------------------- 
    316       !!                   ***  ROUTINE qco_rst_read  *** 
    317       !! 
    318       !! ** Purpose :   Read ssh in restart file 
    319       !! 
    320       !! ** Method  :   use of IOM library 
    321       !!                if the restart does not contain ssh, 
    322       !!                it is set to the _0 values. 
    323       !!---------------------------------------------------------------------- 
    324       INTEGER, INTENT(in) ::   kt         ! ocean time-step 
    325       INTEGER, INTENT(in) ::   Kbb, Kmm   ! ocean time level indices 
    326       ! 
    327       INTEGER ::   ji, jj, jk 
    328       INTEGER ::   id1, id2     ! local integers 
    329       !!---------------------------------------------------------------------- 
    330       ! 
    331       IF( ln_rstart ) THEN                   !* Read the restart file 
    332          CALL rst_read_open                  !  open the restart file if necessary 
    333          ! 
    334          id1 = iom_varid( numror, 'sshb', ldstop = .FALSE. ) 
    335          id2 = iom_varid( numror, 'sshn', ldstop = .FALSE. ) 
    336          ! 
    337          !                             ! --------- ! 
    338          !                             ! all cases ! 
    339          !                             ! --------- ! 
    340          ! 
    341          IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist 
    342             CALL iom_get( numror, jpdom_auto, 'sshb'   , ssh(:,:,Kbb), ldxios = lrxios    ) 
    343             CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    ) 
    344             CALL iom_get( numror, jpdom_auto, 'r3tb'   , r3t(:,:,Kbb), ldxios = lrxios    ) 
    345             CALL iom_get( numror, jpdom_auto, 'r3tn'   , r3t(:,:,Kmm), ldxios = lrxios    ) 
    346             CALL iom_get( numror, jpdom_auto, 'r3ub'   , r3u(:,:,Kbb), ldxios = lrxios, cd_type = 'U'    ) 
    347             CALL iom_get( numror, jpdom_auto, 'r3un'   , r3u(:,:,Kmm), ldxios = lrxios, cd_type = 'U'    ) 
    348             CALL iom_get( numror, jpdom_auto, 'r3vb'   , r3v(:,:,Kbb), ldxios = lrxios, cd_type = 'V'    ) 
    349             CALL iom_get( numror, jpdom_auto, 'r3vn'   , r3v(:,:,Kmm), ldxios = lrxios, cd_type = 'V'    ) 
    350             CALL iom_get( numror, jpdom_auto, 'r3f'    , r3f(:,:)    , ldxios = lrxios, cd_type = 'F'    ) 
    351              
    352             ! needed to restart if land processor not computed 
    353             IF(lwp) write(numout,*) 'qco_rst_read : ssh(:,:,Kbb) and ssh(:,:,Kmm) found in restart files' 
    354             !!WHERE ( ssmask(:,:) == 0.0_wp )   !!gm/st ==> sm should not be necessary on ssh while it was required on e3 
    355             !!   ssh(:,:,Kmm) = 0._wp 
    356             !!   ssh(:,:,Kbb) = 0._wp 
    357             !!END WHERE 
    358             IF( l_1st_euler ) THEN 
    359                ssh(:,:,Kbb) = ssh(:,:,Kmm) 
    360             ENDIF 
    361          ELSE IF( id1 > 0 ) THEN 
    362             IF(lwp) write(numout,*) 'qco_rst_read WARNING : ssh(:,:,Kmm) not found in restart files' 
    363             IF(lwp) write(numout,*) 'sshn set equal to sshb.' 
    364             IF(lwp) write(numout,*) 'neuler is forced to 0' 
    365             CALL iom_get( numror, jpdom_auto, 'sshb', ssh(:,:,Kbb), ldxios = lrxios ) 
    366             ssh(:,:,Kmm) = ssh(:,:,Kbb) 
    367             l_1st_euler = .TRUE. 
    368          ELSE IF( id2 > 0 ) THEN 
    369             IF(lwp) write(numout,*) 'qco_rst_read WARNING : ssh(:,:,Kbb) not found in restart files' 
    370             IF(lwp) write(numout,*) 'sshb set equal to sshn.' 
    371             IF(lwp) write(numout,*) 'neuler is forced to 0' 
    372             CALL iom_get( numror, jpdom_auto, 'sshn', ssh(:,:,Kmm), ldxios = lrxios ) 
    373             ssh(:,:,Kbb) = ssh(:,:,Kmm) 
    374             l_1st_euler = .TRUE. 
    375          ELSE 
    376             IF(lwp) write(numout,*) 'qco_rst_read WARNING : ssh(:,:,Kmm) not found in restart file' 
    377             IF(lwp) write(numout,*) 'ssh_b and ssh_n set to zero' 
    378             IF(lwp) write(numout,*) 'neuler is forced to 0' 
    379             ssh(:,:,:) = 0._wp 
    380             l_1st_euler = .TRUE. 
    381          ENDIF 
    382          ! 
    383       ELSE                                   !* Initialize at "rest" 
    384          ! 
    385          IF( ll_wd ) THEN   ! MJB ll_wd edits start here - these are essential 
    386             ! 
    387             IF( cn_cfg == 'wad' ) THEN            ! Wetting and drying test case 
    388                CALL usr_def_istate( gdept(:,:,:,Kbb), tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  ) 
    389                ts (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb)       ! set now values from to before ones 
    390                ssh(:,:    ,Kmm) = ssh(:,:    ,Kbb) 
    391                uu (:,:,:  ,Kmm) = uu (:,:,:  ,Kbb) 
    392                vv (:,:,:  ,Kmm) = vv (:,:,:  ,Kbb) 
    393             ELSE                                  ! if not test case 
    394                ssh(:,:,Kmm) = -ssh_ref 
    395                ssh(:,:,Kbb) = -ssh_ref 
    396                ! 
    397                DO_2D( 1, 1, 1, 1 ) 
    398                   IF( ht_0(ji,jj)-ssh_ref <  rn_wdmin1 ) THEN ! if total depth is less than min depth 
    399                      ssh(ji,jj,Kbb) = rn_wdmin1 - (ht_0(ji,jj) ) 
    400                      ssh(ji,jj,Kmm) = rn_wdmin1 - (ht_0(ji,jj) ) 
    401                   ENDIF 
    402                END_2D 
    403             ENDIF 
    404             ! 
    405             DO ji = 1, jpi 
    406                DO jj = 1, jpj 
    407                   IF ( ht_0(ji,jj) .LE. 0.0 .AND. NINT( ssmask(ji,jj) ) .EQ. 1) THEN 
    408                     CALL ctl_stop( 'qco_rst_read: ht_0 must be positive at potentially wet points' ) 
    409                   ENDIF 
    410                END DO 
    411             END DO 
    412             ! 
    413          ELSE 
    414             ! 
    415             ! Just to read set ssh in fact, called latter once vertical grid 
    416             ! is set up: 
    417 !           CALL usr_def_istate( gdept_0, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  ) 
    418 !           ! 
    419             ssh(:,:,:) = 0._wp 
    420             r3t(:,:,:) = 0._wp 
    421             r3u(:,:,:) = 0._wp 
    422             r3v(:,:,:) = 0._wp 
    423             r3f(:,:  ) = 0._wp 
    424             ! 
    425          ENDIF           ! end of ll_wd edits 
    426          ! 
    427       ENDIF 
    428       ! 
    429    END SUBROUTINE qco_rst_read2 
    430315 
    431316 
  • NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/USR/usrdef_istate.F90

    r13295 r13761  
    2323 
    2424   PUBLIC   usr_def_istate   ! called in istate.F90 
     25   PUBLIC   usr_def_ssh      ! called by domqco.F90 
    2526 
    2627   !! * Substitutions 
     
    8081   END SUBROUTINE usr_def_istate 
    8182 
     83    
     84   SUBROUTINE usr_def_ssh( ptmask, pssh ) 
     85      !!---------------------------------------------------------------------- 
     86      !!                   ***  ROUTINE usr_def_istate  *** 
     87      !!  
     88      !! ** Purpose :   Initialization of ssh 
     89      !! 
     90      !! ** Method  :   Set as null 
     91      !!---------------------------------------------------------------------- 
     92      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   ptmask  ! t-point ocean mask   [m] 
     93      REAL(wp), DIMENSION(jpi,jpj)         , INTENT(  out) ::   pssh    ! sea-surface height   [m] 
     94      !!---------------------------------------------------------------------- 
     95      ! 
     96      IF(lwp) WRITE(numout,*) 
     97      IF(lwp) WRITE(numout,*) 'usr_def_ssh : GYRE configuration, analytical definition of initial state' 
     98      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~   ' 
     99      ! 
     100      ! Sea level: 
     101      pssh(:,:) = 0._wp 
     102       
     103   END SUBROUTINE usr_def_ssh 
     104 
    82105   !!====================================================================== 
    83106END MODULE usrdef_istate 
Note: See TracChangeset for help on using the changeset viewer.