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 11949 for NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DOM/istate.F90 – NEMO

Ignore:
Timestamp:
2019-11-22T15:29:17+01:00 (4 years ago)
Author:
acc
Message:

Merge in changes from 2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps. This just creates a fresh copy of this branch to use as the merge base. See ticket #2341

Location:
NEMO/branches/2019/dev_r11943_MERGE_2019/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src

    • Property svn:mergeinfo deleted
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DOM/istate.F90

    r10499 r11949  
    5151CONTAINS 
    5252 
    53    SUBROUTINE istate_init 
     53   SUBROUTINE istate_init( Kbb, Kmm, Kaa ) 
    5454      !!---------------------------------------------------------------------- 
    5555      !!                   ***  ROUTINE istate_init  *** 
     
    5757      !! ** Purpose :   Initialization of the dynamics and tracer fields. 
    5858      !!---------------------------------------------------------------------- 
     59      INTEGER, INTENT( in )  ::  Kbb, Kmm, Kaa   ! ocean time level indices 
     60      ! 
    5961      INTEGER ::   ji, jj, jk   ! dummy loop indices 
    6062!!gm see comment further down 
     
    7678      rhd  (:,:,:  ) = 0._wp   ;   rhop (:,:,:  ) = 0._wp      ! set one for all to 0 at level jpk 
    7779      rn2b (:,:,:  ) = 0._wp   ;   rn2  (:,:,:  ) = 0._wp      ! set one for all to 0 at levels 1 and jpk 
    78       tsa  (:,:,:,:) = 0._wp                                   ! set one for all to 0 at level jpk 
     80      ts  (:,:,:,:,Kaa) = 0._wp                                   ! set one for all to 0 at level jpk 
    7981      rab_b(:,:,:,:) = 0._wp   ;   rab_n(:,:,:,:) = 0._wp      ! set one for all to 0 at level jpk 
    8082#if defined key_agrif 
    81       ua   (:,:,:  ) = 0._wp   ! used in agrif_oce_sponge at initialization 
    82       va   (:,:,:  ) = 0._wp   ! used in agrif_oce_sponge at initialization     
     83      uu   (:,:,:  ,Kaa) = 0._wp   ! used in agrif_oce_sponge at initialization 
     84      vv   (:,:,:  ,Kaa) = 0._wp   ! used in agrif_oce_sponge at initialization     
    8385#endif 
    8486 
    8587      IF( ln_rstart ) THEN                    ! Restart from a file 
    8688         !                                    ! ------------------- 
    87          CALL rst_read                        ! Read the restart file 
    88          IF (ln_iscpl)       CALL iscpl_stp   ! extrapolate restart to wet and dry 
     89         CALL rst_read( Kbb, Kmm )            ! Read the restart file 
     90         IF (ln_iscpl)       CALL iscpl_stp( Kbb, Kmm )   ! extrapolate restart to wet and dry 
    8991         CALL day_init                        ! model calendar (using both namelist and restart infos) 
    9092         ! 
     
    9799         ! 
    98100         IF( ln_tsd_init ) THEN                
    99             CALL dta_tsd( nit000, tsb )       ! read 3D T and S data at nit000 
     101            CALL dta_tsd( nit000, ts(:,:,:,:,Kbb) )       ! read 3D T and S data at nit000 
    100102            ! 
    101             sshb(:,:)   = 0._wp               ! set the ocean at rest 
     103            ssh(:,:,Kbb)   = 0._wp               ! set the ocean at rest 
    102104            IF( ll_wd ) THEN 
    103                sshb(:,:) =  -ssh_ref  ! Added in 30 here for bathy that adds 30 as Iterative test CEOD  
     105               ssh(:,:,Kbb) =  -ssh_ref  ! Added in 30 here for bathy that adds 30 as Iterative test CEOD  
    104106               ! 
    105107               ! Apply minimum wetdepth criterion 
     
    107109               DO jj = 1,jpj 
    108110                  DO ji = 1,jpi 
    109                      IF( ht_0(ji,jj) + sshb(ji,jj)  < rn_wdmin1 ) THEN 
    110                         sshb(ji,jj) = tmask(ji,jj,1)*( rn_wdmin1 - (ht_0(ji,jj)) ) 
     111                     IF( ht_0(ji,jj) + ssh(ji,jj,Kbb)  < rn_wdmin1 ) THEN 
     112                        ssh(ji,jj,Kbb) = tmask(ji,jj,1)*( rn_wdmin1 - (ht_0(ji,jj)) ) 
    111113                     ENDIF 
    112114                  END DO 
    113115               END DO  
    114116            ENDIF  
    115             ub  (:,:,:) = 0._wp 
    116             vb  (:,:,:) = 0._wp   
     117            uu  (:,:,:,Kbb) = 0._wp 
     118            vv  (:,:,:,Kbb) = 0._wp   
    117119            ! 
    118120         ELSE                                 ! user defined initial T and S 
    119             CALL usr_def_istate( gdept_b, tmask, tsb, ub, vb, sshb  )          
     121            CALL usr_def_istate( gdept(:,:,:,Kbb), tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  )          
    120122         ENDIF 
    121          tsn  (:,:,:,:) = tsb (:,:,:,:)       ! set now values from to before ones 
    122          sshn (:,:)     = sshb(:,:)    
    123          un   (:,:,:)   = ub  (:,:,:) 
    124          vn   (:,:,:)   = vb  (:,:,:) 
    125          hdivn(:,:,jpk) = 0._wp               ! bottom divergence set one for 0 to zero at jpk level 
    126          CALL div_hor( 0 )                    ! compute interior hdivn value   
    127 !!gm                                    hdivn(:,:,:) = 0._wp 
     123         ts  (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb)       ! set now values from to before ones 
     124         ssh (:,:,Kmm)     = ssh(:,:,Kbb)    
     125         uu   (:,:,:,Kmm)   = uu  (:,:,:,Kbb) 
     126         vv   (:,:,:,Kmm)   = vv  (:,:,:,Kbb) 
     127         hdiv(:,:,jpk) = 0._wp               ! bottom divergence set one for 0 to zero at jpk level 
     128         CALL div_hor( 0, Kbb, Kmm )         ! compute interior hdiv value   
     129!!gm                                    hdiv(:,:,:) = 0._wp 
    128130 
    129131!!gm POTENTIAL BUG : 
    130 !!gm  ISSUE :  if sshb /= 0  then, in non linear free surface, the e3._n, e3._b should be recomputed 
     132!!gm  ISSUE :  if ssh(:,:,Kbb) /= 0  then, in non linear free surface, the e3._n, e3._b should be recomputed 
    131133!!             as well as gdept and gdepw....   !!!!!  
    132134!!      ===>>>>   probably a call to domvvl initialisation here.... 
     
    138140!            ALLOCATE( zuvd(jpi,jpj,jpk,2) ) 
    139141!            CALL dta_uvd( nit000, zuvd ) 
    140 !            ub(:,:,:) = zuvd(:,:,:,1) ;  un(:,:,:) = ub(:,:,:) 
    141 !            vb(:,:,:) = zuvd(:,:,:,2) ;  vn(:,:,:) = vb(:,:,:) 
     142!            uu(:,:,:,Kbb) = zuvd(:,:,:,1) ;  uu(:,:,:,Kmm) = uu(:,:,:,Kbb) 
     143!            vv(:,:,:,Kbb) = zuvd(:,:,:,2) ;  vv(:,:,:,Kmm) = vv(:,:,:,Kbb) 
    142144!            DEALLOCATE( zuvd ) 
    143145!         ENDIF 
    144146         ! 
    145147!!gm This is to be changed !!!! 
    146 !         ! - ML - sshn could be modified by istate_eel, so that initialization of e3t_b is done here 
     148!         ! - ML - ssh(:,:,Kmm) could be modified by istate_eel, so that initialization of e3t(:,:,:,Kbb) is done here 
    147149!         IF( .NOT.ln_linssh ) THEN 
    148150!            DO jk = 1, jpk 
    149 !               e3t_b(:,:,jk) = e3t_n(:,:,jk) 
     151!               e3t(:,:,jk,Kbb) = e3t(:,:,jk,Kmm) 
    150152!            END DO 
    151153!         ENDIF 
     
    157159      ! Do it whatever the free surface method, these arrays being eventually used 
    158160      ! 
    159       un_b(:,:) = 0._wp   ;   vn_b(:,:) = 0._wp 
    160       ub_b(:,:) = 0._wp   ;   vb_b(:,:) = 0._wp 
     161      uu_b(:,:,Kmm) = 0._wp   ;   vv_b(:,:,Kmm) = 0._wp 
     162      uu_b(:,:,Kbb) = 0._wp   ;   vv_b(:,:,Kbb) = 0._wp 
    161163      ! 
    162 !!gm  the use of umsak & vmask is not necessary below as un, vn, ub, vb are always masked 
     164!!gm  the use of umsak & vmask is not necessary below as uu(:,:,:,Kmm), vv(:,:,:,Kmm), uu(:,:,:,Kbb), vv(:,:,:,Kbb) are always masked 
    163165      DO jk = 1, jpkm1 
    164166         DO jj = 1, jpj 
    165167            DO ji = 1, jpi 
    166                un_b(ji,jj) = un_b(ji,jj) + e3u_n(ji,jj,jk) * un(ji,jj,jk) * umask(ji,jj,jk) 
    167                vn_b(ji,jj) = vn_b(ji,jj) + e3v_n(ji,jj,jk) * vn(ji,jj,jk) * vmask(ji,jj,jk) 
     168               uu_b(ji,jj,Kmm) = uu_b(ji,jj,Kmm) + e3u(ji,jj,jk,Kmm) * uu(ji,jj,jk,Kmm) * umask(ji,jj,jk) 
     169               vv_b(ji,jj,Kmm) = vv_b(ji,jj,Kmm) + e3v(ji,jj,jk,Kmm) * vv(ji,jj,jk,Kmm) * vmask(ji,jj,jk) 
    168170               ! 
    169                ub_b(ji,jj) = ub_b(ji,jj) + e3u_b(ji,jj,jk) * ub(ji,jj,jk) * umask(ji,jj,jk) 
    170                vb_b(ji,jj) = vb_b(ji,jj) + e3v_b(ji,jj,jk) * vb(ji,jj,jk) * vmask(ji,jj,jk) 
     171               uu_b(ji,jj,Kbb) = uu_b(ji,jj,Kbb) + e3u(ji,jj,jk,Kbb) * uu(ji,jj,jk,Kbb) * umask(ji,jj,jk) 
     172               vv_b(ji,jj,Kbb) = vv_b(ji,jj,Kbb) + e3v(ji,jj,jk,Kbb) * vv(ji,jj,jk,Kbb) * vmask(ji,jj,jk) 
    171173            END DO 
    172174         END DO 
    173175      END DO 
    174176      ! 
    175       un_b(:,:) = un_b(:,:) * r1_hu_n(:,:) 
    176       vn_b(:,:) = vn_b(:,:) * r1_hv_n(:,:) 
     177      uu_b(:,:,Kmm) = uu_b(:,:,Kmm) * r1_hu(:,:,Kmm) 
     178      vv_b(:,:,Kmm) = vv_b(:,:,Kmm) * r1_hv(:,:,Kmm) 
    177179      ! 
    178       ub_b(:,:) = ub_b(:,:) * r1_hu_b(:,:) 
    179       vb_b(:,:) = vb_b(:,:) * r1_hv_b(:,:) 
     180      uu_b(:,:,Kbb) = uu_b(:,:,Kbb) * r1_hu(:,:,Kbb) 
     181      vv_b(:,:,Kbb) = vv_b(:,:,Kbb) * r1_hv(:,:,Kbb) 
    180182      ! 
    181183   END SUBROUTINE istate_init 
Note: See TracChangeset for help on using the changeset viewer.